Help using Base SAS procedures

Proc report Conditional Allignment

Reply
Contributor
Posts: 36

Proc report Conditional Allignment

I have to regenrate RTF output in which first 5 row of values should be center alligned and rest of the row in page should be right allinged.

i have order = 1 for first 5 rows and order =2 for rest of the rows in that page.

How would I do that ?

 

Please suggest 

 

SAS Super FREQ
Posts: 709

Re: Proc report Conditional Allignment

Hi

 

You can use CALL DEFINE to set style information dynamically based on some values. See example below.

 

data newClass;
  rowNum = _n_;
  set sashelp.class;
run;

proc report data=newClass;
  column rowNum name sex age _dummy;
  define rowNum / display noprint;
  define name / style={width=6cm};
  define age / display;
  define _dummy / computed noprint;

  compute _dummy;
    if rowNum <= 5 then do;
      call define("name", "style", "style={just=center}");
    end;
    else do;
      call define("name", "style", "style={just=right}");
    end;
  endcomp;
run;
Ask a Question
Discussion stats
  • 1 reply
  • 143 views
  • 0 likes
  • 2 in conversation