Hello Community,
I just want one blank line in between my records of two groups.
My data:
data report;
input variable $ value $ group ;
cards;
Sex F 1
Sex M 1
Age <18 2
Age 18-30 2
Age 31-50 2
Age >50 2
;
run;
This is what I need in the pdf report:
I have tried this:
ods escapechar='~';
ods pdf file='line_test.pdf';
proc report nofs data=report headline ;
columns group variable value ;
define group / order noprint ;
define variable / display ;
define value / display ;
compute after group / style={fontsize=0.1pt };
length msg $ 64;
if group=1 then do;
msg = "~{newline 10}";
end;
else do;
msg = "~{newline 0}";
end;
line msg $64.;
endcomp;
run;
ods pdf close;
In html view it shows as I needed, but in pdf its different. In pdf it shows as :
I just need only a blank line in between and not at the end.
data report;
input variable $ value $ group ;
cards;
Sex F 1
Sex M 1
Age <18 2
Age 18-30 2
Age 31-50 2
Age >50 2
;
run;
proc sql noprint;
select max(group) into : n from report;
quit;
proc report nowd data=report headline ;
columns group variable value ;
define group / order noprint ;
define variable / display ;
define value / display ;
compute after group ;
str=' ';
len=ifn(group=&n,0,10);
line str $varying10. len;
endcomp;
run;
data report;
input variable $ value $ group ;
cards;
Sex F 1
Sex M 1
Age <18 2
Age 18-30 2
Age 31-50 2
Age >50 2
;
run;
proc sql noprint;
select max(group) into : n from report;
quit;
proc report nowd data=report headline ;
columns group variable value ;
define group / order noprint ;
define variable / display ;
define value / display ;
compute after group ;
str=' ';
len=ifn(group=&n,0,10);
line str $varying10. len;
endcomp;
run;
Thank you @Ksharp , this works as expected.
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
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.
Ready to level-up your skills? Choose your own adventure.