Johnny:
Every bookmark in a PDF TOC is either a SAS folder or a SAS output object. That's the point of my previous posting. When you run a job, look in the SAS results window and compare what you see in the results window to the PDF TOC.
OK...now that you understand that every folder is going to become a bookmark and that every procedure you run will probably have a top folder and at least 1 output object, then your issue is how to insert more "levels" into the TOC structure.
That means in your new ODS document, you'd have to insert more "folders" into the ODS document. The MAKE command is like the MD or the makedir command-- it adds a folder into the ODS Document structure. Then when you replay the ODS Document, that folder becomes a level in the TOC.
When I make an ODS Document -- I like to keep the original ODS Document intact, the way ODS created it. That way, should it be necessary, I could prove to anyone that all I did was rearrange the structure -- not delete anything. (What can I say, in a previous life I worked for lawyers.)
So in my code, I have this scenario:
1) Create ODS Document from SAS Procedures -- sometimes, if I want to compare the "original" ODS result file to the replayed result file, I will also have an ODS HTML or ODS RTF step around #1. The objects and folders have funny names and you have to know these names in order to do the copying you want to do. That's the point of a PROC DOCUMENT step with the LIST statement. It reveals the internal names of the output objects and folders.
2) Make new ODS document with desired folder structure (have to use PROC DOCUMENT "batch" mode commands to do this -- like MAKE and COPY and DIR)
3) Copy objects and/or folders from #1 into #2 (DIR navigates through the ODS DOCUMENT to the folder you want, then COPY copies the objects)
4) Double check that #2 looks the way I want (I generally check this with the Document Window -- but a PROC DOCUMENT List works too) and then
5) Replay the ODS Document from #2 to whatever destination I want.
So that's how you interpret the code in the previous forum posting. If you are running SAS 9.1.3 SP4, then that code should work for you as long as you don't change it. If the code does NOT work for you, unchanged, then there's no point in going further until you can work with Tech Support to figure out why it's not working. (The only thing I can think of for why it doesn't work is that you are running SAS 8.2 or you're using EG and something in EG is interfering with ODS DOCUMENT.)
Here's a simple ODS DOCUMENT program to try. It has a BUNCH of arbitrary folder levels. I used PROC MEANS for the output object to copy into the new structure. I just copied the same output object into 3 different places.
When you run a procedure, it creates output objects. Your new document needs to have some output objects in it. You can't replay an ODS DOCUMENT that just has folders, but no output objects. This program follows the same general scenario as the 5 steps above.
To get the hang of ODS DOCUMENT, it is much easier to create an ODS DOCUMENT store to play around with and then pop open the ODS DOCUMENT window. Once you have a feel for making a new document store and making folders and copying/rearranging the objects and folders in the new document store, you'll have a much better understanding of what the batch syntax is doing.
To open the ODS DOCUMENT window in SAS 9.1.3, type odsdoc or odsdocument in the SAS command line. If you are running SAS 8.2, the ODS DOCUMENT window was not cooked yet, so it wasn't really available; although most of the batch syntax worked. Tech Support would have to help you with ODS DOCUMENT code that would run in SAS 8.2.
To find out more information on ODS DOCUMENT and read about the general concepts, search on the string:
"The DOCUMENT Procedure" (quotes included) in the SAS Help facility or online doc.
There are some things (graph device, graph catalog) to keep in mind when working with SAS/Graph and ODS Documents and the documentation contains a lot of good information on these topics. As you can see, the code syntax is lengthy and dense -- so if you need help with SAS/Graph and ODS Document, your best bet for help is to contact Tech Support.
cynthia
[pre]
title;
footnote;
options nodate nonumber center orientation=portrait;
ods noptitle;
**1) Make an ODS Document to start with;
ods document name=work.shoedoc(write);
proc means data=sashelp.shoes sum min mean median max;
var Sales;
run;
ods document close;
proc document name=work.shoedoc;
list / levels=all;
run;
quit;
** 2) make the new structure AND;
** 3) copy the same output object to 3 different places in the folder structure.;
proc document name=work.one_obj(write);
make F1, Wombat, Koala;
run;
dir;
run;
dir F1;
make FF1;
run;
dir FF1;
make FF2;
run;
dir FF2;
make FF3;
dir FF3;
copy \Work.shoedoc\Means#1\Summary#1 to ^;
run;
dir \Work.one_obj\;
run;
dir Wombat;
make newfolder;
dir newfolder;
copy \Work.shoedoc\Means#1\Summary#1 to ^;
run;
dir \Work.one_obj\Koala#1;
copy \Work.shoedoc\Means#1\Summary#1 to ^;
run;
setlabel \F1#1 "1.0";
setlabel \F1#1\FF1#1 "1.1";
setlabel \F1#1\FF1#1\FF2#1 "1.1.1" ;
setlabel \F1#1\FF1#1\FF2#1\FF3#1 "1.1.1.1";
setlabel \Wombat#1 "2.0" ;
setlabel \Wombat#1\newfolder#1 "2.1" ;
setlabel \Koala#1 "3.0";
obtitle1 \F1#1\FF1#1\FF2#1\FF3#1\Summary#1 "First display for this object";
obtitle1 \Wombat#1\newfolder#1\Summary#1 "Second display of Output Object from PROC MEANS";
obtitle1 \Koala#1\Summary#1 "Third display of MEANS object";
run;
quit;
** 4) Double check the levels in the new document store;
proc document name=work.one_obj;
list / levels=all;
run;
quit;
** 5) now replay the new document store to PDF with the contents= option;
ods pdf file='c:\temp\newtoc.pdf' contents=yes;
proc document name=work.one_obj;
replay;
run;
quit;
ods _all_ close;
ods listing;
[/pre]