Published on :
Utility SASHELP

Export JSON from SASHELP.ORSALES

This code is also available in: Deutsch Español Français
The script configures a temporary file to receive the JSON output from the SASHELP.ORSALES table generated by PROC JSON. Then, a DATA _NULL_ step reads this file and writes the raw JSON stream to the SAS© log.
Data Analysis

Type : SASHELP


The source table is SASHELP.ORSALES, available by default in SAS.

1 Code Block
PROC JSON
Explanation :
Defines a temporary file reference 'temp' and uses PROC JSON to export data from SASHELP.ORSALES to this file.
Copied!
1filename temp temp ;
2PROC JSON out=temp ;
3 export sashelp.orsales ;
4RUN ;
2 Code Block
DATA STEP
Explanation :
Reads the temporary file line by line and displays the JSON content in the log via the PUT _INFILE_ 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.