BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi ,

I've an execl file ' laptop_review.xls' and want to import in SAS Permanently in 'C' .

i used a code :

libname dis "C:\Cwa";
PROC IMPORT OUT= WORK.sales1
DATAFILE= "C:\laptop_review.xls"
DBMS=EXCEL REPLACE;
SHEET="review";
GETNAMES=YES;
MIXED=YES;
USEDATE=YES;
SCANTIME=YES;
RUN;
proc print data=sales1;
run;

it works in the SAS windows but its not created permanently in 'C'

Kind regards
markc
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
You have asked this same question many times already, and the fact that you are asking again implies that you have not read any of the suggested documentation on the topic of temporary vs permanent SAS libraries.
You have EXPLICITLY coded:
[pre]
OUT=WORK.sales1
[/pre]

...which means that the file will only live in the WORK library during your SAS session and will go away when the SAS session is over.

You have a LIBNAME statement in your code:
[pre]
libname dis "C:\Cwa";
[/pre]

this means that
[pre]
OUT=DIS.sales1
[/pre]

...would cause the dataset to be written to the physical location:
c:\Cwa\sales1.sas7bdat (which is how the dataset looks in Windows Explorer).

The reference DIS.SALES1 is the proper TWO-LEVEL name for a permanent SAS dataset, as described in my previous answer to this same question in this post:
http://support.sas.com/forums/thread.jspa?messageID=32427纫

Other folks have also explained how to save a dataset permanently in response to this same and related questions in these postings:
http://support.sas.com/forums/thread.jspa?messageID=32418红
http://support.sas.com/forums/thread.jspa?messageID=32344繘
http://support.sas.com/forums/thread.jspa?messageID=32368繰

I still suggest that you read some of the documentation about SAS datasets and the concepts of a SAS library -- both permanent and temporary.
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a000086013.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002316278.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000986902.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000930616.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a002316280.htm
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a000998603.htm

Understanding how a SAS LIBNAME statement works and understanding the difference between WORK and permanent SAS libraries and how to use LIBREFs is fundamental knowledge --
you will not be successful in your SAS programming endeavors without taking the time to really understand these concepts.

cynthia

sas-innovate-2024.png

Today is the last day to save with the early bird rate! Register today for just $695 - $100 off the standard rate.

 

Plus, pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 618 views
  • 0 likes
  • 2 in conversation