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

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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