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
Opal | Level 21

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 2024

Innovate_SAS_Blue.png

Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.

If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website. 

Register now!

From SAS Users blog
Want more? Visit our blog for more articles like these.
5 Steps to Your First Analytics Project Using SAS

For SAS newbies, this video is a great way to get started. James Harroun walks through the process using SAS Studio for SAS OnDemand for Academics, but the same steps apply to any analytics project.

Find more tutorials on the SAS Users YouTube channel.

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