How do I add a blank line in PROC REPORT positionally i.e. Insert a blank line after line 4?
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
You can comment this FAQ