BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Programmer26
Calcite | Level 5
Hi All,

I am using Ods excel to create a excel report but i am getting this error instead(mentioned in the subject line).
The code i am using is
Ods excel file= filepath/abc.xlsx style=htmlblue
Options(sheet_name=xyz);
Proc print data=test;
Run;
Ods excel(sheet_name=xyz1);
Proc print data=test2;
Run;
Ods excel close;
I tried using the memsize=max option but the option is throwing a warning " Option memsize should be used at the start of the sas system. Option ignored.
I relaunched the session but the same result.

Kindly help me out on this.
1 ACCEPTED SOLUTION

Accepted Solutions
Kurt_Bremser
Super User

@Programmer26 wrote:
Observations=220k
Vars=6

That's WAY beyond what constitutes a report. Run a simple export using a LIBNAME:

libname myex xlsx "filepath/abc.xlsx";

data myex.xyz;
set test;
run;

data myex.xyz1;
set test2;
run;

libname myex clear;

ODS EXCEL will add all the formatting tags for every cell, which are not necessary when exporting just data.

Since that needs to be kept as text (XML) in memory before the compressed file is written, you run out of memory.

View solution in original post

7 REPLIES 7
Kurt_Bremser
Super User

@Programmer26 wrote:
Observations=220k
Vars=6

That's WAY beyond what constitutes a report. Run a simple export using a LIBNAME:

libname myex xlsx "filepath/abc.xlsx";

data myex.xyz;
set test;
run;

data myex.xyz1;
set test2;
run;

libname myex clear;

ODS EXCEL will add all the formatting tags for every cell, which are not necessary when exporting just data.

Since that needs to be kept as text (XML) in memory before the compressed file is written, you run out of memory.

Programmer26
Calcite | Level 5
Kurt,
When i am using the code as you mentioned it is throwing a error stating
Could not find 'workbook.xml.rels'
Error: file myex.xyz does not exist.
Kurt_Bremser
Super User

I guess you have a damaged xlsx file. Make sure that it does not exist before you issue the LIBNAME.

After deleting the file, please run the code again and post the whole log using the </> button.

Programmer26
Calcite | Level 5
Thank you Kurt.
I checked and there were multiple files stored by the same name in that folder.
It is working fine now.

Thank you for the help!! 🙂

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

Register Now

Creating Custom Steps in SAS Studio

Check out this tutorial series to learn how to build your own steps in SAS Studio.

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
  • 7 replies
  • 4112 views
  • 0 likes
  • 2 in conversation