One of my favorite methods of exporting excel or .csv file is to use the ‘DEXPORT’ command-line command. This certainly reduces the amount of typing required to export the SAS dataset. Another interesting point is DEXPORT command works fine in UNIX and PC.
Syntax: dm “DEXPORT libref.dsn 'filename.xls' replace;
"libref" is a library, "dsn" is the name of a SAS data set, and "filename.xls" is the name of the
tab delimited text file(excel) being created. If we don’t specify the Libname or it is work then
the dataset ‘dsn’ from the WORK directory is exported in a excel format to a specified location.
Replace option … replaces the file if it already exists.
Use DIMPORT command-line command to convert/import a tab delimited (excel or .csv etc) into a
SAS dataset.
Syntax: dm “DIMPORT ‘filename.csv’ exc" replace;
SAS dataset.
Syntax: dm “DIMPORT ‘filename.csv’ exc" replace;
DIMPORT command tells SAS to import or convert the tab delimited file (filename.csv) to a SAS
dataset named ‘exc’; Replace option … replaces the dataset named ‘exc’ if it already exists by
any chance.
Thanks... Sarath...
ReplyDeleteFor the putinng all the wonderful information together...
Most of the SAS users .. craving for this ... kind of Information.....
www.studysas.blogspot.com is one of the top blogs ....That I regularly visit for SAS information...
How do i import all the csv files in a library into SAS
ReplyDeleteread this...
ReplyDeletehttp://studysas.blogspot.com/2009/02/how-to-create-comma-separated-file-csv.html