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.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.