Discover More Tips and Techniques on This Blog

DEXPORT and DIMPORT: DISPLAY MANAGER commands used to IMPORT and EXPORT the Tab delimited (Excel and .CSV) files;

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: dmDEXPORT 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;



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.

3 comments:

  1. Thanks... Sarath...

    For 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...

    ReplyDelete
  2. How do i import all the csv files in a library into SAS

    ReplyDelete
  3. read this...

    http://studysas.blogspot.com/2009/02/how-to-create-comma-separated-file-csv.html

    ReplyDelete

Disclosure:

In the spirit of transparency and innovation, I want to share that some of the content on this blog is generated with the assistance of ChatGPT, an AI language model developed by OpenAI. While I use this tool to help brainstorm ideas and draft content, every post is carefully reviewed, edited, and personalized by me to ensure it aligns with my voice, values, and the needs of my readers. My goal is to provide you with accurate, valuable, and engaging content, and I believe that using AI as a creative aid helps achieve that. If you have any questions or feedback about this approach, feel free to reach out. Your trust and satisfaction are my top priorities.