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 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 3 replies
  • 1002 views
  • 0 likes
  • 3 in conversation