03-24-2015 04:04 AM
I have some problems with exporting my dataset to excel.
I used this code:
After running this code I've got following errors:
ERROR 22-322: Syntax error, expecting one of the following: ;, DATA, DBLABEL, DBMS, DEBUG, FILE, LABEL, OUTFILE, OUTTABLE, REPLACE,
ERROR 202-322: The option or parameter is not recognized and will be ignored.
Is there please someone who can help me to export this dataset. I'm not really familiar with programming so I have no idea what the problem is.
Thanks a lot!
03-24-2015 06:47 AM
Couple of things wrong with the code - missing double quotes after filename, and semi-colons missing at end points, dbms=excel but extension given as XLSX. Update to:
proc export data=myfolder.ssbf03 DBMS=excel outfile="users/Username/Desktop/thesis.xls";
Note that you need to ensure the path user/username/desktop exists and you have write access to it.
03-24-2015 08:14 AM
Thanks for your help, but I still cannot get it to work.
Could you maybe elaborate on what I have to do, and why exactly I have to do that?
Is it possible that the dataset is too big to export it to an excel file? I also tried to export it into a stata (dta) file, because that is the program I would like to use for my thesis research.
When I tried to run your code, I got following error message:
and since I am no programming expert, I have no idea what all these error messages mean.
I tried to export to a stata file, thinking the dataset was too large for an excel file and then I got this error message:
Can you see what the problem is based on these error messages?
Thank you so much for your help !
03-24-2015 09:07 AM
Is this the University Edition of SAS? If so then your best off posting your question in there.
I don't use UE so don't know what mappings/modules etc. you have. The first error to me would indicate that you don't have SAS/Access licensed. The second one indicates that the path you have given either doesn't exit, SAS can't see it, or you don't have permission to write to the area. Have a look through the UE version forum however as there is introductory examples and others will have the same issues.
03-24-2015 09:28 AM
If you code DBMS=EXCEL then SAS will expect to able to communicate with a running copy of EXCEL.
Use DBMS=XLSX and SAS will generate the xlsx file itself without the need for EXCEL.
03-24-2015 09:46 AM
I use the SAS University Edition.
When I try this code:
proc export data=myfolder.ssbf03 DBMS=xlsx outfile="users/boclaes/Desktop/thesis.xlsx";
I got a lot of error messages as you can see on the screenshot below.
Can anyone help me with that, I really don't how to advance.
03-24-2015 10:15 AM
I still get the same error message, but maybe it has something to do with the fact that it is called myfolder on my computer instead of myfolders, so without the "s". Because when I tried to make the folder I got an error message that there were too many characters as you can see here:
In the SAS information center, I get this message :
Could any of this have anything to do with the problem?
Thanks in advance!
03-24-2015 11:00 AM
I checked the documentation and corrected the name of my sharefolder into 'myfolders'.
But the problem now is that my dataset is in the 'MyFolders' map as you can see in the lefthand panel.
When I want to specify where my dataset is I used:
But I got the error message that the libref 'MYFOLDERS' exceeds 8 characters.
03-24-2015 11:10 AM
The LIBREF that you use when defining a libname is limited to 8 characters. But since its purpose is to serve as a place holder to point to the folder it does not have to match the name of the folder.
libname mystuff '/folders/myfolders';
proc export data=mystuff.ssbf03 ....
03-24-2015 06:11 PM
Thanks a lot for your help, I think I found the right code.
But now I've got the error message that my dataset contains more than 256 columns.
Is there a way to avoid this problem?