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

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;

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Cynthia_sas
SAS Super FREQ

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

View solution in original post

1 REPLY 1
Cynthia_sas
SAS Super FREQ

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

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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