BookmarkSubscribeRSS Feed
jabrul_scbd
Calcite | Level 5

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

4 REPLIES 4
Reeza
Super User

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. 

jabrul_scbd
Calcite | Level 5

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
RW9
Diamond | Level 26 RW9
Diamond | Level 26

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. 

Reeza
Super User

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...

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

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
  • 4 replies
  • 5223 views
  • 0 likes
  • 3 in conversation