Hello all,
According to Paper 252-2011, "Let's Give 'Em Something to ToC about: Transforming the Table of Contents of Your PDF File", by Bari Lawhorn, the second node for a data step object in your PDF can be removed by adding "file print ods=(objectlabel="");" to the data step (Page 8). However, when I do this, I still have the second node "Data NULL Table" in my Table of Contents. What am I missing? Please see my code and a picture of the table of contents below:
ods _all_ close;
ods noresults;
title;
footnote;
Options orientation=portrait
papersize=letter
nodate nonumber;
ods pdf file="X:\...\test.pdf";
ods proclabel="My Image";
data _null_;
file print ods=(objectlabel="");
declare odsout obj();
obj.image(file:"X:\...\myimage.jpg",
width: "1.0in", height: "1.5in",
just: c);
run;
ods pdf close;
Hi:
When I run the code in the paper:
Options orientation=portrait
papersize=letter
nodate nonumber;
ods pdf file="c:\temp\display10.pdf" ;
ods proclabel="A Table of the CLASS Data Set";
data _null_;
file print ods=(objectlabel="");
set sashelp.class;
put _ods_;
run;
ods proclabel="Another Table of the CLASS Data Set";
title "Displays Only the Name Variable";
data _null_;
file print;
set sashelp.class;
put name;
run;
ods pdf close;
I do get the same results that she shows in the Display 10 output. The difference between her code and what you're doing is that you are not really using FILE PRINT ODS. Note that in both her programs, she is using a PUT statement to write to the open destination and it is THIS output that is impacted by OBJECTLABEL.
If the OBJECTLABEL is NOT working for you with the FILE PRINT ODS syntax, it must have something to do with the difference between using a PUT to ODS and using the OBJ syntax to build your output. This is a question for researching in the documentation or opening a track with Tech Support.
Hope this helps,
Cynthia
Hi:
When I run the code in the paper:
Options orientation=portrait
papersize=letter
nodate nonumber;
ods pdf file="c:\temp\display10.pdf" ;
ods proclabel="A Table of the CLASS Data Set";
data _null_;
file print ods=(objectlabel="");
set sashelp.class;
put _ods_;
run;
ods proclabel="Another Table of the CLASS Data Set";
title "Displays Only the Name Variable";
data _null_;
file print;
set sashelp.class;
put name;
run;
ods pdf close;
I do get the same results that she shows in the Display 10 output. The difference between her code and what you're doing is that you are not really using FILE PRINT ODS. Note that in both her programs, she is using a PUT statement to write to the open destination and it is THIS output that is impacted by OBJECTLABEL.
If the OBJECTLABEL is NOT working for you with the FILE PRINT ODS syntax, it must have something to do with the difference between using a PUT to ODS and using the OBJ syntax to build your output. This is a question for researching in the documentation or opening a track with Tech Support.
Hope this helps,
Cynthia
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!
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.
Ready to level-up your skills? Choose your own adventure.