Dear all,
I want to print an extra line BETWEEN groups.
When I use COMPUTE AFTER groupx this will work BUT the line will also be printed at the end of the report (after the last group)!!
And that is not what I want.
I tried something like:
COMPUTE after prod_cl;
PROD='TOTAL' ;
IF prod_cl='EXTERNAL2' then do;
line " ";
line " ";
line "--Not included above--" ;
end;
ENDCOMP;
but the IF is ignored and the line statement is always executed.....
any suggestions ??
Regards,
Herman
Yes, LINE statements are always executed even when they're within the scope of an IF or DO. LINE statement behavior is counter-intutitive (to say the least). When PROC REPORT executes a COMPUTE block, it first removes all the LINE statements, then executes the remaining code, and only then executes the LINE statements in the order they appear in the COMPUTE block. See the Restriction here.
However, this SAS note describes a clever trick that allows a LINE statement to appear to be conditionally executed.
Yes, LINE statements are always executed even when they're within the scope of an IF or DO. LINE statement behavior is counter-intutitive (to say the least). When PROC REPORT executes a COMPUTE block, it first removes all the LINE statements, then executes the remaining code, and only then executes the LINE statements in the order they appear in the COMPUTE block. See the Restriction here.
However, this SAS note describes a clever trick that allows a LINE statement to appear to be conditionally executed.
Don't miss out on SAS Innovate - Register now for the FREE Livestream!
Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.