BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
yportne1111
Calcite | Level 5

Please provide a simple example of how I can make a work.import file into a sas7bdat file. In other words I have a dataset in my work library with the default name import. I want to save it as import.sas7bdat.

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

Personally I prefer to "import" directly into the library:

 

libname mylib "<some path>";

proc import datafile="<path>filename.ext" 
       out=mylib.mydatasetname
   <other Import options>
run;

If you are using widgets to run the import then if you have the LIBRARY assigned before using the widget you should be able to indicate that library as the destination for the imported data.

View solution in original post

3 REPLIES 3
SASKiwi
PROC Star

This is probably the simplest way:

data '\Myfolder\import';
  set work.import;
run;

But using a LIBNAME is better:

libname MyLib '\Myfolder';

data MyLib.import;
  set work.import;
run;

 

ballardw
Super User

Personally I prefer to "import" directly into the library:

 

libname mylib "<some path>";

proc import datafile="<path>filename.ext" 
       out=mylib.mydatasetname
   <other Import options>
run;

If you are using widgets to run the import then if you have the LIBRARY assigned before using the widget you should be able to indicate that library as the destination for the imported data.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 775 views
  • 2 likes
  • 3 in conversation