The SAS Output Delivery System and reporting techniques

Convert LST output to PDF/RTF output

Reply
New Contributor
Posts: 2

Convert LST output to PDF/RTF output

[ Edited ]

Hi,

I am trying to create a rtf or pdf file using some existing lst outputs. It is producing rtf or pdf by the following code segement but the page is not fitting to the PDF or RTF according to LST file. That means page break is not working properly even I used PS and LS as the options. So would you please help me in this regard so that I can create a RTF/PDF according to the existing LST files.

 

Thanks in advance!

 

Here is my program:

 

    proc document name=import(write);
        import textfile='D:\study\study_001\lst\disp_t1.lst' to ^; setlabel textfile 'Table 1: 1 Test Table - 1';
        import textfile='D:\study\study_001\lst\disp_t2.lst' to ^; setlabel textfile 'Table 3: 1 Test Table - 2';
           list/details;
            obpage textfile /after;
        run;
    
    options nodate nostimer papersize=a4 orientation=landscape topmargin=".8in" leftmargin=".5in" rightmargin=".5in" bottommargin=".5in";        
    ods rtf file="D:\study\study_001\lst\rtf\test1.rtf" contents=yes toc_data;
       replay;
    run;
        ods rtf toc_data;

    quit;
    ods rtf close;
    

 

Regards,

Jabrul

Super User
Posts: 17,899

Re: LST 2 RTF/PDF

Make sure to set style = listing on your ODS PDF/RTF statement. 

 

I'm not sure exactly what you're trying to achieve, if the suggestion above doesn't work please detail your problem more clearly. Explaining your problem in the following method helps: Here's what I have, here's what I want, and here's what I've tried. 

New Contributor
Posts: 2

Re: LST 2 RTF/PDF

Dear Reeza,

 

Thanks for your reply.

Actually in my LST output suppose the pagesize is 40 for each page but whenever I am trying to convert these LST outputs to the RTF/PDF there is showing discripency in the page break according to LST file. That means 2 pages fitting into one page like the attachment or splitting one page into two pages and the second page is starting in the middle of the next page in the RTF/PDF. But I want that every page of the LST file will be fit into every page of the RTF/PDF.

 

I think now you will get my point.

 

 

Thanks,

Jabrul


11.PNG
Super User
Super User
Posts: 7,413

Re: LST 2 RTF/PDF

Sorry, I am not sure what you mean either.  Why do you have list output if you want RTF or PDF, why not just go directly to RTF/PDF using ODS.  Lst is plain text, i.e. it has nothing to indicate to document processor how it should be displayed, so you would need to do those kind of calculations yourself - which is really a bit pointless.  To do so, you would read in the text files to a dataset, then process to add page breaks/formatting etc., then report them out to RTF/PDF. 

Super User
Posts: 17,899

Re: LST 2 RTF/PDF

If you read the details section of the pagesize option you'll see that page size doesn't apply to PDF/RTF. You have other options for page  control, specifically pagestart option. 

 

http://support.sas.com/documentation/cdl/en/lesysoptsref/68023/HTML/default/viewer.htm#n02ek00ir5ihs...

Ask a Question
Discussion stats
  • 4 replies
  • 795 views
  • 0 likes
  • 3 in conversation