BookmarkSubscribeRSS Feed
jerry898969
Pyrite | Level 9

Hello, I have a pdf file that i'm working to create using ODS PDF and ODSOUT.  I have part of that working correctly.  I would like to take the same out that I have for the pdf and just point it to a text file.  Is this possible with ODS or do I have to go through putting put statements and spacing the data out? Thank you

6 REPLIES 6
Reeza
Super User

That depends on what you're doing in the ODS PDF and what you mean by a text file.

Text files generally have no formatting, so you can look at ODS CSV perhaps. If it was a proc print there may not be any issues.

I'm assuming proc report would have issues, as would any graphical procs. 

You should be able to switch to an RTF file without many changes.

jerry898969
Pyrite | Level 9

Hi Reeza, Thank you for the reply.  I'm using odsout with a data _null_ statement.  So i'm creating a table and rows with my data and it looks good in a pdf file.  I want to show the data in a .txt file with the same spacing between the columns and rows without the formating other then justification.  I can't use RTF even though that works because we have users from all over the world and we have to put the data in the lowest know format so that is a text file for us. Thank you for your help

Reeza
Super User

Have you tried not using ODS at all then and just pointing to a file instead? You really need to provide a sample of what your code looks like otherwise we're guessing.

data _null_;

file "";

etc...

run;

jerry898969
Pyrite | Level 9

Hi Reeza, here is some test code i'm using to create a pdf file.  How can I use this to create a text file?

ods listing ; title; footnote ;

options orientation=portrait topmargin=1in bottommargin=1in rightmargin=1in leftmargin=1in pageno=1 ;

options nodate nonumber nocenter ;

ods listing close ;

ods escapechar='^' ;

ods pdf file = "c:\temp\temp.pdf" notoc ;

footnote1 j=c height=8pt  font='Courier New' 'Page ^{thispage} of ^{lastpage}' ;

data _null_ ;

    set vinfo ;

    by year ;

    if _n_ = 1 then declare odsout obj() ;

       

    if first.vname then do ;       

        obj.table_start(overrides: 'frame=void rules=none cellpadding=0in cellspacing=.06in ' ) ;

            obj.body_start() ;

                obj.row_start() ;

                    obj.format_cell(text: vlabel, column_span: 2,  overrides: "cellwidth=6.5in backgroundcolor=white just=left fontweight=bold font_face='Courier New' font_size=10pt ") ;                          

                obj.row_end() ;               

    end ;       

   

    if last.vname then do ;       

        obj.body_end() ;

        obj.table_end() ;

    end ;

run ;

ods pdf close ;

Cynthia_sas
SAS Super FREQ


Hi:

  This looks like a few of the previous questions you've posted. https://communities.sas.com/thread/58430 and https://communities.sas.com/thread/57685  Did you ever open a track with Tech Support? I thought you'd contacted them in one of the tracks. What did they tell you about using the new Report Writing Interface and setting up links for PDF? This looks like the same report you were trying to create in those earlier tracks.

cynthia

ballardw
Super User

And why is the title "Create Text file" when you want a PDF???? PDF is not Text....

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