BookmarkSubscribeRSS Feed
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi Dear,
Here is my sample coding

FILENAME PDFFILE 'C:\TEMP.PDF';
ODS LISTING CLOSE;
ODS PDF FILE=PDFFILE STYLE=STYLES.PRINTER;
DATA _NULL_;
FILE PRINT ODS;
TEST ='TESTING MY RECORD';
PUT TEST $20. _ODS_;
RUN;
ODS LISTING;

When I run . I see the following output in the PDF output.

-------------------------
| TEST |
------------------------

TESTING MY RECORD.

My problem is , I don't want to print the column header 'TEST'. I just want to print only
TESTING MY RECORD only. How can I do this.

Thanks so much for your help in advance.

Please note that
thanks again
Inpu
3 REPLIES 3
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Remove the ODS keyword on the FILE statement. Also, if you do not want the title line date and page number, consider adding these statements;

OPTIONS NODATE NONUMBER;
TITLE;

Scott Barry
SBBWorks, Inc.
Cynthia_sas
SAS Super FREQ
Hi:
This is a good introduction to using the DATA step with FILE PRINT ODS. Generally, it is NOT recommended to bypass ODS when writing output to an ODS destination file (although the output may look OK for some simple datasets, for complex or "free-format" reports, the output will never look the way it looked in the LISTING destination):
http://support.sas.com/techsup/technote/ts664.pdf

Another alternative is to use PROC REPORT with the NOHEADER option
http://support.sas.com/documentation/cdl/en/proc/61895/HTML/default/a002473620.htm#a003071998

The program below illustrates using NOHEADER in a few different ways.

cynthia

[pre]
data textline;
length test $400;
test='Twas brillig and the slithy toves '||
'Did gyre and gimble in the wabe. '||
'All mimsy were the borogroves. '||
'And the mome raths outgrabe.';
run;

ods listing close;
options nodate nonumber orientation=portrait;

ods pdf file='c:\temp\examp1.pdf' style=styles.printer;

proc report data=textline nowd noheader;
title 'Example 1';
column test;
run;

ods pdf close;

ods pdf file='c:\temp\examp2.pdf' style=styles.journal;

proc report data=textline nowd noheader;
title 'Example 2';
column test;
run;

ods pdf close;

ods pdf file='c:\temp\examp3.pdf' style=styles.printer;

proc report data=textline nowd noheader
style(report)={rules=none frame=void cellspacing=0 cellwidth=3in};
title 'Example 3';
column test;
run;

ods pdf close;

ods pdf file='c:\temp\examp4.pdf' style=styles.printer;

proc report data=textline nowd noheader
style(report)={rules=none frame=void cellspacing=0 cellwidth=5in just=l};
title 'Example 4';
column test;
run;

ods pdf close;
[/pre]
Inp
Obsidian | Level 7 Inp
Obsidian | Level 7
Hi Cynthia,
Thanks a lot.Amazing .It perfectly works to me.


Thanks again Cynthia,


regards Inp

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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