DATA Step, Macro, Functions and more

saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

Reply
Occasional Contributor
Posts: 7

saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

 

Hi there, 

 

Using the following code, the file psrai_merged_noidnew.sas7bdat created can not be opened in SAS 9.4 
Can anyone tell if it's a problem of the codes below, or other issues? How can the codes be modified if so? The data set to_share2 works fine in SAS. 
 
libname library "C:\CTS - backup - Aug16_2016\CSC\2011\data\share" ;
data library.psrai_merged_noIDnew;
  set to_share2; 
run;
 
Thanks!
Li
Super User
Posts: 19,815

Re: saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

Your code is backwards - which means you may have destroyed your dataset.

 

Data OUTPUT_DATA<- this is the data set(s) CREATED;

SET INPUT_DATA; <- This is the data set(s) USED;

 

Your code should be:

 

libname library "C:\CTS - backup - Aug16_2016\CSC\2011\data\share" ;

data to_share2;
  set library.psrai_merged_noIDnew; 
run;
Super User
Posts: 11,343

Re: saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

Please post the log of the code you ran with the LIbname and data step.

Do you get any error message in the log?

If the data set to_share2 was made for a different operating system there may be issues with conversion.

Occasional Contributor
Posts: 7

Re: saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

Here is the log related to the codes I previous posted. These codes are at the end of a longer SAS file. Also, there are some comments in my codes. It seems that the new file psrai_merged_noIDnew is created, but don't know why it can't be opened in SAS. If it's an issue of OS, how can I fix that? Thanks!

 

8575 libname library "C:\CTS - backup - Aug16_2016\CSC\2011\data\share" ;
NOTE: Libref LIBRARY refers to the same physical library as TMP1.
NOTE: Libref LIBRARY was successfully assigned as follows:
Engine: V9
Physical Name: C:\CTS - backup - Aug16_2016\CSC\2011\data\Share
8576
8577 *export SAS format - not being able to open sas file generated - have to figure out if it's
8577! sas versin or what
8578 can try to generate the SAS file correctly by opening SAS, importing the CSV and then saving
8578! it some other way;
8579 data library.psrai_merged_noIDnew;
8580 set to_share2;
8581 run;

NOTE: There were 1000 observations read from the data set WORK.TO_SHARE2.
NOTE: The data set LIBRARY.PSRAI_MERGED_NOIDNEW has 1000 observations and 727 variables.
NOTE: DATA statement used (Total process time):
real time 0.54 seconds
cpu time 0.51 seconds

 

 

Super User
Posts: 19,815

Re: saved a sas file created in SAS in desktop C drive but it can't be opened by SAS 9.4, why?

@lic054  You don't explain how it can't be opened or show where you're trying to use the data, only that it was created.

 

Please explain how you can't open it, if you get an error message include error message and log.

If no error message pops up check your log.

 

The OS shouldn't be an issue, you'll at worst get a CEDA (Cross Environment Data Access) note.

Ask a Question
Discussion stats
  • 4 replies
  • 251 views
  • 0 likes
  • 3 in conversation