BookmarkSubscribeRSS Feed
rawindar
Calcite | Level 5

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

3 REPLIES 3
ballardw
Super User

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

Proc print data= <your dataset name> noobs;

var inf / style=[asis=on];

run;

Astounding
PROC Star

Take a look at PROC REPORT and the WRAP feature.

Cynthia_sas
SAS Super FREQ

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

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