Published on :

Export and Display JSON of sashelp.orsales

This code is also available in: Deutsch Español Français
Awaiting validation
This script configures a temporary file, uses the PROC JSON procedure to export data from the sashelp.orsales table without SAS© metadata tags, and then uses a DATA _NULL_ step to read this file and write its content to the SAS© log.
Data Analysis

Type : SASHELP


Uses the standard example table 'sashelp.orsales'.

1 Code Block
PROC JSON Data
Explanation :
Creation of a temporary file reference and execution of PROC JSON to export data. The 'pretty' option formats the JSON for readability and 'nosastags' removes SAS-specific metadata.
Copied!
1filename temp temp ;
2PROC JSON out=temp pretty nosastags ;
3 export sashelp.orsales ;
4RUN ;
2 Code Block
DATA STEP
Explanation :
DATA step without table creation (_null_) that reads the temporary file line by line and displays it in the log via the PUT statement.
Copied!
1DATA _null_ ;
2 INFILE temp ;
3 INPUT ;
4 put _infile_ ;
5RUN ;
This material is provided "as is" by We Are Cas. There are no warranties, expressed or implied, as to merchantability or fitness for a particular purpose regarding the materials or code contained herein. We Are Cas is not responsible for errors in this material as it now exists or will exist, nor does We Are Cas provide technical support for it.