BookmarkSubscribeRSS Feed
Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

Hello,

I have some problems with exporting my dataset to excel.

I used this code:

proc export

data=myfolder.ssbf03

DBMS=excel

outfile="users/Username/Desktop/thesis.xslx

Run

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,

  TABLE, _DEBUG_. 

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!

13 REPLIES 13
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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";

run;

Note that you need to ensure the path user/username/desktop exists and you have write access to it.

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

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:

Schermafbeelding 2015-03-24 om 13.00.42.png

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:

Schermafbeelding 2015-03-24 om 13.07.23.png

Can you see what the problem is based on these error messages?

Thank you so much for your help !

RW9
Diamond | Level 26 RW9
Diamond | Level 26

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.

Ksharp
Super User

DBMS=XLSX

Tom
Super User Tom
Super User

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.

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

I use the SAS University Edition.

When I try this code:

proc export data=myfolder.ssbf03 DBMS=xlsx outfile="users/boclaes/Desktop/thesis.xlsx";

run;

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.

Schermafbeelding 2015-03-24 om 14.41.01.png

Ksharp
Super User

Your path is wrong. If you have already set the shared fold as Doc said, you should use .

outfile="/myfolders/thesis.xlsx";

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

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:

Schermafbeelding 2015-03-23 om 22.20.16.png

In the SAS information center, I get this message :

Schermafbeelding 2015-03-24 om 15.11.08.png

Could any of this have anything to do with the problem?

Thanks in advance!

Ksharp
Super User

Check SAS University Edition 's Documentation to setup the share fold .

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

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:

data=myfolders.ssbf03

But I got the error message that the libref 'MYFOLDERS' exceeds 8 characters.

Tom
Super User Tom
Super User

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 ....

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

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?

Bo7
Calcite | Level 5 Bo7
Calcite | Level 5

I've finally have the dataset which i need for my master thesis.

Thank you all so much for  your help, I really appreciate all your comments!

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 13 replies
  • 5351 views
  • 0 likes
  • 4 in conversation