SAS/ODS

Reply
Contributor
Posts: 70

SAS/ODS

i have datavalue which has 1000 characters

inf=abc............................................................................................1000charcters

i need to generate a pdf report with these value with out omiting a single character.How can we solve this

Thanks in advance

Super User
Posts: 10,516

SAS/ODS

Have you tried PROC PRINT using style overrides? This might work.

Proc print data= <your dataset name> noobs;

var inf / style=[asis=on];

run;

Super User
Posts: 5,085

SAS/ODS

Take a look at PROC REPORT and the WRAP feature.

SAS Super FREQ
Posts: 8,743

Re: SAS/ODS

Hi:

  The problem with options like WRAP and FLOW is that they are LISTING-only options. The OP said that PDF was needed.

  If you just make your long variable, ODS PDF will try to do the best it can and will automatically wrap. But you can use the CELLWIDTH style attribute to alter the width of the cell and how the value "flows". See the attached screenshot. It was produced with the code below. If the long text string did have spaces, then the text inside the cell would have flowed a bit differently, ODS will try to break the line at a space or punctuation character, if possible.

cynthia

data makelong;
set sashelp.class;
  length longvar1 longvar2 $1000 tmp $100;
  keep name longvar1 longvar2;
  where name in ('Alfred','Alice');
  tmp = catt('aaaaaaaaaabbbbbbbbbbcccccccccc',
             'ddddddddddeeeeeeeeeeffffffffff',
             'gggggggggghhhhhhhhhh',
             'iiiiiiiiiijjjjjjj--Z');
                
  ** make longvar1 and longvar2 exactly 1000 characters;
  longvar1 = repeat(tmp,99);
  longvar2 = longvar1;
  lg = length(longvar1);
  put lg=;
  output;
run;

   

options orientation=landscape
        topmargin=.5in bottommargin=.5in
        leftmargin=.5in rightmargin=.5in;
             
ods listing close;
ods pdf file='c:\temp\compare_cellwidth.pdf';

** cellpadding puts a bit more white space around;

** the long text, making it easier to read;

      

  proc report data=makelong nowd
     style(report)={cellpadding=6pt};
     title '2) Use CELLWIDTH attribute for PDF to adjust size of LONGVAR cell';
     column name longvar1 longvar2;
     define name /order;
     define longvar1 / display
            style(column)={cellwidth=2in};
     define longvar2 / display
            style(column)={cellwidth=4in};
     compute after name;
       line ' ';
     endcomp;
     run;
ods _all_ close;
title;


got_1000_chars.jpg
Ask a Question
Discussion stats
  • 3 replies
  • 177 views
  • 0 likes
  • 4 in conversation