The SAS Output Delivery System and reporting techniques

Using SCL file functions to File Print to ODS PDF

Reply
Occasional Contributor
Posts: 12

Using SCL file functions to File Print to ODS PDF

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
SAS Employee
Posts: 174

Re: Using SCL file functions to File Print to ODS PDF

Posted in reply to MarkBodt_NewZealand
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
Ask a Question
Discussion stats
  • 1 reply
  • 163 views
  • 0 likes
  • 2 in conversation