BookmarkSubscribeRSS Feed
MarkBodt_NZ
Obsidian | Level 7
Hi,

I've got some text that I want to print to a PDF using file functions in SCL. The text is the contents of a list box in a SAS/AF app. Extracting the text is no problem, but getting the filename statements right is.

Has anyone done this before?

The code I use logs a message:
WARNING: FILENAME statement syntax for PRINTER devices has changed.
The physical name "PDF" associated with logical name MYPRTR
is not a valid printer name. The default printer will be
used, with output redirected to the file "PDF".
sysmsg=FL_PrintFID=1000


And the PDF generated is empty.

Code is along the lines of:

submit continue;
ods results off;
ods pdf file="D:\SAS\V9Data\Report_F0138340.pdf" style=ABCLargePDF;
endsubmit;

rc=filename("MyPrtr",'PDF',"PRINTER");
sysmsg=sysmsg();
put 'filename statement' sysmsg= rc=;

FL_PrintFID=fopen("MyPRTR",'o');
sysmsg=sysmsg();
put sysmsg= FL_PrintFID=;

if (FL_PrintFID>0) then
do;
do x = 1 to lbListbox.rows;
lbListbox._getText( x, RowText );
put x= rowtext=;
rc=fput(FL_SetInitFID,trim(RowText),200);
rc=fwrite(FL_SetInitFID);
end;

rc=fclose(FL_PrintFID);
end;

*deallocate filename;
rc=filename("MyPrtr",' ');

submit continue;
ods PDF close;
endsubmit;


Message was edited by: 6 at May 31, 2006 7:07 PM
Message was edited by: 6 at May 31, 2006 7:07 PM
1 REPLY 1
David_SAS
SAS Employee
We have no SCL experts on the Base Reporting/ODS R&D team. Your best SAS resource is Technical Support; see http://support.sas.com/techsup/intro.html .

-- David Kelley, SAS

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
  • 1 reply
  • 699 views
  • 0 likes
  • 2 in conversation