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.