BookmarkSubscribeRSS Feed
kimdukes77
Obsidian | Level 7

I am creating a report that writes out to odf and csv simultaneously using proc report.

 

Is it possible to tailor the output, insomuch that I want to include some additional variables when writing to csv?

 

Thanks

5 REPLIES 5
RW9
Diamond | Level 26 RW9
Diamond | Level 26

And how are you doing this?  We cannot see your code.  If your writing "simulataneously" to multiple ods destinations, then by its definition, the output for each will be the same, as its the same code.  

kimdukes77
Obsidian | Level 7

Yes I thought so much, just trying to avoid having to write out the code a second time for csv destination.  Thanks anyway.

RW9
Diamond | Level 26 RW9
Diamond | Level 26

Again it depends on your code which I can't see, but CSV files can be created very easily with:

proc export data=have outfile="...want.csv" dbms=csv;
run;

You don't need to create any code for that, just that step.

ODF (I assume you mean the format used by LIbreOffice) is different, I assume your creating an Excel type file, using tagsets.

sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10

Explore using ODS <destination> (ID=xx) ....;   -- where you declare each of your targets, each with a unique ID-value and follow that with your desired PROC (or otherwise) invocation.  And remember to follow-up with a suitable ODS....CLOSE; for each destination or _ALL_ otherwise.

 

Scott Barry
SBBWorks, Inc.

 

RW9
Diamond | Level 26 RW9
Diamond | Level 26

I think the OP was asking to have different content of outputs from the same procedure, not how to output to different destinations.  Without some major macro code, I don't see how one proc report can create two different outputs - i.e. in this case a different set of variables on the two different outputs.  Hence there would need to be two different output steps.

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

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
  • 5 replies
  • 2137 views
  • 0 likes
  • 3 in conversation