BookmarkSubscribeRSS Feed
bhanl004
Fluorite | Level 6

Hi, 

 

So I'm very unfamiliar with SAS but have been working with the University Edition. I have a CD file of .sas7bdat files that I need to convert into CSV files. My issue is that when the CSV file is generated, I'm getting an error in the SAS log and my CSV file (which opens in excel) does not have anything in it. Data is the name of the library I created to hold my data (but I'm not even sure if I did that correctly) and this is the code I'm running (donor is the name of my data file I'm trying to convert): 

proc export data=data.donor
outfile=_dataout
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=donor.csv;

This is the error I'm getting: 

ERROR: File DATA.DONOR.DATA does not exist.
ERROR: Export unsuccessful. See SAS Log for details.
 
Again, I know almost nothing about SAS and how it works so I apologize if I'm missing any information needed to help answer this question, but any help would very much be appreciated. 
21 REPLIES 21
Reeza
Super User
What is the value for _dataout?

Show your full code please.
bhanl004
Fluorite | Level 6

Hi, 

 

That is my full code. I went to the "snippets" section and chose "generate CSV file" which gives me this:

 

proc export data=sashelp.cars
outfile=_dataout
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=cars.csv;

 

 

what I posted in my original question is what i changed it to so I could try and convert my file. Again, I seriously don't know anything about SAS and I'm trying to do this for a professor who also does not know SAS so thank you for your help!!! 

Reeza
Super User
Where did you create the library? Did you put the files in the myfolder you created?

What you need to do:

1. Place SAS files in myfolders (created at setup)
2. Assign a libname to that location, right click myfolders on the Servers FIles and FOlders pane to get the list of files
3. Then right click one of the files in the LIbrary pane and select Export. That will give you the code you need. Or use a snippet at that point. I suspect your other issues are affecting your export.

Have you verified that you can even see the data sets and that they're valid?
bhanl004
Fluorite | Level 6

So yes, my data is in the "myfolders" folder I created at set up. Should I be able to expand the library when I'm in the library tab to see my data?  Even when i try to recreate the library I'm not able to open the files or expand under the library I created. I'm able to open the files in SAS so i can see that they're valid and contain data, so I know thats ok. I just think I'm setting up my library wrong or something. 

Reeza
Super User
Show your full code - ie the libname statement and the log in this case that would have created the library with your data.
Reeza
Super User
libname mydata '/folders/myfolders/';


proc export data=myData.data1 outfile = "/folders/myfolders/data1.csv" dbms=csv replace;
run;

That's usually all you need then run the PROC EXPORT for each file. 

 

Change the DATA = to be your data set name and the name in the outfile portion as well. 

 


@bhanl004 wrote:

So yes, my data is in the "myfolders" folder I created at set up. Should I be able to expand the library when I'm in the library tab to see my data?  Even when i try to recreate the library I'm not able to open the files or expand under the library I created. I'm able to open the files in SAS so i can see that they're valid and contain data, so I know thats ok. I just think I'm setting up my library wrong or something. 


 

bhanl004
Fluorite | Level 6
libname data "/folders/myfolders";

run;

proc export data=donor.sas7bdat
outfile='_donor.csv'
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=donor.csv;

The lib statement runs successfully, but I still cannot expand it out when I'm under libraries so I cant select the export option.  

bhanl004
Fluorite | Level 6
this is my log: (sorry, I know this is all probably very simple but having never worked with SAS I just have no idea whats going on, I appreciate your help!!)
 
 
1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname data "/folders/myfolders";
NOTE: Libref DATA refers to the same physical library as MYDATA.
NOTE: Libref DATA was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
74
75 run;
76
77 proc export data=donor.sas7bdat
78 outfile='_donor.csv'
79 dbms=csv replace;
80 run;
 
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: Libref DONOR is not assigned.
ERROR: Export unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.02 seconds
cpu time 0.02 seconds
 
81
82 %let _DATAOUT_MIME_TYPE=text/csv;
83 %let _DATAOUT_NAME=donor.csv;
84
85
86
87 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
99
Tom
Super User Tom
Super User

@bhanl004 wrote:
libname data "/folders/myfolders";

run;

proc export data=donor.sas7bdat
outfile='_donor.csv'
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=donor.csv;

The lib statement runs successfully, but I still cannot expand it out when I'm under libraries so I cant select the export option.  


You created a libref of DATA, but you don't use it.

Instead you told PROC EXPORT to read the dataset named SAS7BAT from the libref named DONOR.

If you have a file named donor.sas7bdat in the folder you pointer DATA at then you can use either 

data=data.donor

in your PROC EXPORT statement.

 

Or just skip the libname statement and use:

data='/folders/myfolders/donor'

or

data='/folders/myfolders/donor.sas7bdat'

Note that if the file is actually named DONOR.sas7bdat or Donor.sas7bdat then SAS will not be able to see it. The name of the file must be in all lowercase because SAS University Edition is running on a Unix machine (virtual) and Unix treats the case of the letters in filenames as significant.

bhanl004
Fluorite | Level 6

So when I run that, I'm still getting the same error. 

 

Code:

 

libname data "/folders/myfolders";

run;

proc export data=DATA.donor
outfile='_donor.csv'
dbms=csv replace;
run;

%let _DATAOUT_MIME_TYPE=text/csv;
%let _DATAOUT_NAME=donor.csv;

 

Log:

 

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 libname data "/folders/myfolders";
NOTE: Libref DATA refers to the same physical library as MYDATA.
NOTE: Libref DATA was successfully assigned as follows:
Engine: V9
Physical Name: /folders/myfolders
74
75 run;
76
77 proc export data=DATA.donor
78 outfile='_donor.csv'
79 dbms=csv replace;
80 run;
 
NOTE: Unable to open parameter catalog: SASUSER.PARMS.PARMS.SLIST in update mode. Temporary parameter values will be saved to
WORK.PARMS.PARMS.SLIST.
ERROR: File DATA.DONOR.DATA does not exist.
ERROR: Export unsuccessful. See SAS Log for details.
NOTE: The SAS System stopped processing this step because of errors.
NOTE: PROCEDURE EXPORT used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
 
81
82 %let _DATAOUT_MIME_TYPE=text/csv;
83 %let _DATAOUT_NAME=donor.csv;
84
85
86
87 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
99
Tom
Super User Tom
Super User

You do not have a file in that folder named donor.sas7bdat.

If you think you have such a file double check the location (is it really in the directory you used?) and the file name (perhaps it is donors.sas7bdat? Perhaps the filename a blank in the beginning or end that you are no seeing). 

The filename (donor.sas7bdat) must be in all lowercase letters or SAS will not see it.

bhanl004
Fluorite | Level 6

Okay, so you helped me figure out the issue with my name/library. and now my code is running without issue, but my CSV file is still showing up blank with no values when I open it. I know there is data in the files I'm converting, so I'm not sure why this is happening. 

 

p.s. - thank you for the help!!! 

Reeza
Super User
Please try the code I posted instead of the code you're running and post the log.

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
  • 21 replies
  • 2545 views
  • 0 likes
  • 4 in conversation