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

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
  • 742 views
  • 0 likes
  • 2 in conversation