BookmarkSubscribeRSS Feed
EricSpear
Calcite | Level 5
Hello,

I'm saving my output using ods document and I'd like to manipulate the results. In my document I have the results of a proc tabulate that breaks the table into multiple pages. I'd like to rearrange the pages using proc document. However, all of the pages seem to be grouped together as one output object.

I decided an approach might be to use the BY statement. Indeed, this generates "bygroup1" and "bygroup2" etc. for each page of the table. That is progress. The only problem is that the Name, Description, and Document Path in the Document all use the name "bygroupN" when I really need to know the actual values. That is, I need to know the page title of that page of the table. I need to know this so I can properly rearrange the pages in the output.

Does my question make sense? I someone can give me some ideas.
Thanks.
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi, Eric:
Play around with the DETAILS option on the PROC DOCUMENT LIST statement. In this example, I also put an ODS OUTPUT statement into the example so you could see that the document info can go into a dataset (if for example, you wanted to make some macro variables) .

(You can also read the ODS DOCUMENT store directly with a LIBNAME engine, I'm just not sure how/where/whether the LABEL for the BY line is accessible by that method.)

cynthia
PS -- I have discovered that if I use BY groups with the BY variable in the TITLE statement (using Title '#BYVAL(byvar)';) that this title stays with the output object and generally when I rearrange the output objects the titles end up in the right places, even when rearranged.

SAS 9.2 has some new enhancements to ODS DOCUMENT and you can read about them here:
http://support.sas.com/documentation/cdl/en/odsug/59523/HTML/default/odsugwhatsnew902.htm (scroll down the page until you see the section for ODS DOCUMENT)
[pre]
ods listing;
options linesize=150;
ods output Document.Properties=work.myprop;

proc document name=work.shoedoc;
title ' the objects in the document store';
list / levels=3 details;
run;
quit;

proc print data=work.myprop;
title 'what is by group info for the document store';
var path type label;
run;[/pre]

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 540 views
  • 0 likes
  • 2 in conversation