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