Published on :
ETL SASHELP

Export SASHELP.CLASS to CSV

This code is also available in: Deutsch Español Français English
This script uses a _NULL_ type Data Step to read the SASHELP.CLASS example table and write its content line by line to an external file in CSV format (delimited).
Data Analysis

Type : SASHELP


The data comes from the standard SASHELP library (CLASS table).

1 Code Block
FILENAME
Explanation :
Definition of a file reference (fileref) named 'out' pointing to a local physical path.
Copied!
1filename out 'c:\out.csv' ;
2 Code Block
DATA STEP
Explanation :
DATA step without creating an output table (_null_). It configures the output file with the DSD option (delimiter management), reads the data, and writes all variables (_all_) formatted (:).
Copied!
1DATA _null_;
2 file out dsd;
3 SET sashelp.class;
4 put (_all_) (:);
5RUN;
3 Code Block
FILENAME
Explanation :
Release of the file reference 'out'.
Copied!
1filename out ;
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.