sas >> ODS PDF and data _null_

by mswift » Thu, 04 Mar 2004 23:53:47 GMT

Has anyone had any success in using ODS PDF in a data _null_ step to put
specific variables and text strings in specific locations using version
8.2? Any samples?

Thanks

Mike Swift
Statistical Analyst
Research & Policy Analysis
AES/PHEAA
(717)720-3526


sas >> ODS PDF and data _null_

by khd8 » Fri, 05 Mar 2004 01:53:41 GMT


Depends on what you mean by a data _null_ step, with v8.2 you can
generate PDFs from a data null, but it will have a table structure (like
everything else in ODS) and doesn't give the "Drop text exactly where I
want it control that you have in the listing destination". If you want
a PDF file that is simply a reprint of your Listing output rendered as a
PDF, I think it would involve three steps

1) Generate Listing DATA NULL

2) Make an RTF out of the data null (see RTF FAQ page
http://support.sas.com/rnd/base/topics/templateFAQ/Template_rtf.html #faq

New FAQ (25 November 2002)

RTF25-How can I create RTF output that looks exactly like my listing
output?

ODS generates tabular output. Therefore, there is no direct way to make
the ODS RTF output look like the SAS listing output. Here are a couple
of indirect ways. The example below uses PROC PRINTTO to save the output
to a flat file and then uses a DATA step to read the output back in. The
only problem with this approach is that the page-eject characters are
simply ignored by RTF. This is because RTF has its own control words
that generate page breaks or section breaks.

A better method is to use a macro created and contributed by David Ward.
The macro saves the output to an external file, but unlike the below
example, it looks for the page breaks in the listing and changes the
values to RTF control characters that specify page breaks. The macro
allows some other options to be specified as well; see the @out2rtf
macro.

proc printto file='c:\temp\tmp.lst';

proc print data=sashelp.class;
title 'get listing look in rtf';
run;

proc printto;
run;

ods rtf file='c:\temp\monospace.rtf';
title 'Listing look in RTF';
options nodate nonumber;
data _null_;
infile 'c:\temp\tmp.lst' length=lg;
input @1 line $varying400. lg;
file print;
put @1 line $varying. lg;
run;

ods rtf close;

3) Run the RTF through Acrobat distiller (either manually or with DDE)

Holler if this doesn't make sense...

Kevin

XXXX@XXXXX.COM


-----Original Message-----
From: Mike Swift [mailto: XXXX@XXXXX.COM ]
Sent: Thursday, March 04, 2004 10:54 AM
Subject: ODS PDF and data _null_


Has anyone had any success in using ODS PDF in a data _null_ step to put
specific variables and text strings in specific locations using version
8.2? Any samples?

Thanks

Mike Swift
Statistical Analyst
Research & Policy Analysis
AES/PHEAA
(717)720-3526



sas >> ODS PDF and data _null_

by RHOADSM1 » Fri, 05 Mar 2004 05:55:29 GMT

This SHOULD be easy to do, with something like the following:

ods pdf file='temp.pdf';

data _null_;
set sashelp.class;
file print;
put @5 name +2 age +2 sex +2 height +2 weight;
run;

ods pdf close;

Unfortunately, there is a bug in this up through 8.2 that messes up the
alignment -- see http://support.sas.com/techsup/unotes/SN/005/005486.html
for details. The suggested workaround is to instead create a PostScript
file with ODS PRINTER, and then distill this to a PDF.

Supposedly this is fixed in Version 9. Haven't tried it yet.

Mike Rhoads
Westat
XXXX@XXXXX.COM


-----Original Message-----
From: Mike Swift [mailto: XXXX@XXXXX.COM ]
Sent: Thursday, March 04, 2004 10:54 AM
To: XXXX@XXXXX.COM
Subject: ODS PDF and data _null_


Has anyone had any success in using ODS PDF in a data _null_ step to put
specific variables and text strings in specific locations using version
8.2? Any samples?

Thanks

Mike Swift
Statistical Analyst
Research & Policy Analysis
AES/PHEAA
(717)720-3526


Similar Threads

1. Font size in PDF file using data _null_

Hi All,

I am working on a listing. I though to use the data _null_ and ods pdf
as this listing have lot of indentations and formatting. Everything is
fine but i just want to increase the font size of the body. I did for
titles and footers. I don't want to use the proc template. Is there
any way that just a simple option/statement which can change the font
size. I used the FONT =  option but it didn't work properly.
I just need to increase the font size of all the text which i am
displaying using put statement in Data _null_.

Thank you for your time.

2. Q: How to control paging using data _null_ ODS reporting

3. ods pfd document and data _null_ step

Hi, I have an old report that uses the data _null_ step to create a
text report. I would like to create a  pdf report.   When I add an ods
statement to create a pfd report, I see some misalignment and the cause
of the misalignment is funny rectangles with x in them.  Has anyone
seen this before?  This doesn't occur when I create a html file.

Renu

4. ods output with data _null_

5. The NULL and NOT NULL data values

Hi,
The NULL and NOT NULL are terms used to define a table in a database and is 
not a SAS-specific term. If I understand it right, NULL is a spesific data 
value, the '00'x. That is: '00' is the hexadecimal value of NULL. When using 
NULL when you define a table in a database, you tell the DBMS that "this 
field is allowed to contain the data value '00'x, right ? Similarly, when 
defining a database with NOT NULL, you tell the DBMS that "this field is not 
allowed to contain the data value '00'x, right again ? Or is it right to say 
that NOT NULL means that "this field must contain a value, but the value 
cannot be '00'x  ?

Then to the point: How does SAS test for the occurence of the data value 
NULL ? What does the following piece of code do ?:
proc sql;
   create table mytable as
      select
         var1,
         var2,
         var3
      from mytable_2
      where  var2 is not null
      or var3 is not null
   ;
quit;

What exactly does 'is not null' and 'is null' test for in SAS ? Does it test 
just for occurences of SPACE ('20'x) ?
If 'IS NOT NULL' does not test the absence of '00'x, how shold the PROC SQL 
above be written to take that into account ?

When extracting a flat file from a database table, will a value of '00'x in 
the table field be transferred to the file ? And when reading that file into 
a SAS dataset, will the '00'x value also be transferred from the file to the 
dataset ?

Regards, Rune


6. ods pdf...adding pages to a pdf file

7. NEW ODS PDF bug (PDF TOC)?

Hi, guys.

 

I installed the latest Hot Fix for ODS.

But it seems that there's one more bug.

 

I'm trying to customize PDF TOC (table of contents).

I got 21 datasets and want to display a link to each of them in the PDF
TOC when I display them with PROC REPORT.

 

For some reason I see links only to the last 7 of them.

 

I wonder if anyone encountered it before.

 

Any suggestions are welcomed

 

Here's my code:

 

Macro variable ALLDSNAME resolves to AE APO CHEM COAG CONMED CRIT_EP
CVHX CVPE DEMOG DISP DOSE ECG EXCRIT

            HEMA HX INCRIT PE RAND RISK URIN VITALS

SYMBOLGEN:

 

 

ods pdf file="E:\Therapeutic Area\compound &comp\&num\sas\external
files\&study._metadata.pdf";

 

.....................................

 

ods proclabel='Table of Contents' ;

proc print contents='';

title1 "&study Dataset Contents";

run;

 

............................................

 

%macro allreport;

%do i=1 %to 21;

%do;

ods proclabel="%SCAN(&alldsname.,&i.)" ;

proc report data=temp   ls=170 split='|' nowindows  contents='' ;

columns DSNAME variable varlabel type informat format length comment ;

define DSNAME/display width=8 flow 'Library|Member|Name' noprint ;

define variable/display width=10 flow 'Variable|Name' ;

define varlabel/display width=10 flow ;

define type/display width=10 flow ;

define informat/display width=10 flow 'Variable|Informat' ;

define format/display width=10 flow 'Varibale|Format' ;

define length/display width=8 flow 'Variable|Length' ;

define comment/display width=30 flow ;

 

title "%SCAN(&alldsname.,&i.)";

where dsname eq "%SCAN(&alldsname.,&i.)";

run;

%end;

%end;

%mend;

 

%allreport;

 

ods pdf close;

run;

 

 

 

 

 

Igor Kurbeko

Clinical Programmer Analyst

678 336 4328

 XXXX@XXXXX.COM  <mailto: XXXX@XXXXX.COM > 

<mailto: XXXX@XXXXX.COM >  

If you torture data sufficiently, it will confess to almost anything.

 

8. graphs are not shown in pdf when option CONTENTS is used in ODS PDF