13 users online | 13 Guests and 0 Registered

How do I add a blank line in PROC REPORT positionally i.e. Insert a blank line after line 4?


*** First add a 'dummy' column with the row numbers *** ;

data class ;
   set sashelp.class (keep = name sex age) ;
     row = _n_ ;
run ;


*** Use the LINE statement to insert bespoke text in a COMPUTE block *** ;
proc report data = class nowd ;
   column name sex age row ;
   define name / display ;
   define sex  / display ;
   define age  / display ;
   define row  / order noprint ;
   compute after row ;
     *** The LINE statement cannot be used within IF-THEN-ELSE logic because it will 'always' be executed regardless *** ;
     if row = 4 then
     do ;
       *** Use conditional logic to create text and varying lengths - one zero-length, one non-zero-length *** ;
       text = ' ' ;
       len = 20 ;
     end ;
     else
     do ;
       text = '' ;
       len = 0 ;
     end ;
     *** Apply the calculated text field using the $VARYING. format. Only non-zero length text is inserted in the report *** ;
   line text $varying. len ;
   endcomp ;
run ;
Author:
Alan D Rudland
Revision:
1.2
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.

Records in this category

Tags