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!
filename out 'c:\out.csv' ;
1
filename 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!
data _null_;
file out dsd;
set sashelp.class;
put (_all_) (:);
run;
1
DATA _null_;
2
file out dsd;
3
SET sashelp.class;
4
put (_all_) (:);
5
RUN;
3 Code Block
FILENAME
Explanation : Release of the file reference 'out'.
Copied!
filename out ;
1
filename 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.
SAS and all other SAS Institute Inc. product or service names are registered trademarks or trademarks of SAS Institute Inc. in the USA and other countries. ® indicates USA registration. WeAreCAS is an independent community site and is not affiliated with SAS Institute Inc.
This site uses technical and analytical cookies to improve your experience.
Read more.