BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
jpagitt
Obsidian | Level 7

SAS 9.4 TS1M5

 

I am trying to figure out a way of exporting an excel worksheet within the same workbook as my data output that is text only. This worksheet would be a glossary of terms and general information regarding the data. In the past, I have just used extensive footnotes, but I have reached the footnote limit as the amount of data definitions needed to provide to the customer is rather extensive in this case.

 

I am using ods excel to export. I believe that I could create this using datalines and I am sure that most likely needs to be part of it unless I stored the text in a separate txt file and imported it which can be done, but ultimately I don't want this to appear as a table per se in the excel - no presence of a label or field name.

 

I assume that this is a pretty easy request, but I haven't been able to find an example that really fits what I am looking for. Does anyone have experience with creating something like this?

 

Thank you.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Krueger
Pyrite | Level 9

Apologies if I'm misunderstanding but what your asking in the title; to me contradicts what your saying you want. 

I am trying to figure out a way of exporting an excel worksheet within the same workbook as my data output that is text only. 

 

Are you just wanting like a readme.txt file? If so you can export to .txt:

 

data _null_;
  set sashelp.class;
  file "c:\temp\someFile.txt";
  put name age sex;
  file print;
  put name age sex;
run;

If your just trying to input "text" you can use the ODS TEXT= option. Details here: https://documentation.sas.com/?docsetId=odsug&docsetTarget=p14gx25pepks6dn1q9m7vkq3gfoi.htm&docsetVe...

 

Hopefully one of those helps.

View solution in original post

2 REPLIES 2
Krueger
Pyrite | Level 9

Apologies if I'm misunderstanding but what your asking in the title; to me contradicts what your saying you want. 

I am trying to figure out a way of exporting an excel worksheet within the same workbook as my data output that is text only. 

 

Are you just wanting like a readme.txt file? If so you can export to .txt:

 

data _null_;
  set sashelp.class;
  file "c:\temp\someFile.txt";
  put name age sex;
  file print;
  put name age sex;
run;

If your just trying to input "text" you can use the ODS TEXT= option. Details here: https://documentation.sas.com/?docsetId=odsug&docsetTarget=p14gx25pepks6dn1q9m7vkq3gfoi.htm&docsetVe...

 

Hopefully one of those helps.

jpagitt
Obsidian | Level 7

I don't really want a readme. We'd use that internally, but when it comes to what is sent off, I really just want a way of packaging everything together with the data definitions wrapped into the worksheet itself or into a separate worksheet of the same workbook.

 

Looks like the ODS TEXT= option is going to work for me though. Thanks!

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

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
  • 2 replies
  • 1114 views
  • 1 like
  • 2 in conversation