I want to get the below output. However, when I run my below code I can not get the red marked part.
Is there anyone help me out?
Thanks a lot.
data x;
do var1='A', 'B', 'C'; output; end;
do var1='A', 'B', 'C';
do var2="aa",'bb', 'cc';
output;
end;
end;
do var1='A', 'B', 'C';
do var2="aa",'bb', 'cc';
do var3=1 to 20;
output;
end;
end;
end;
run;
data x;
set x;
length var4 $10;
if missing(var2) then do; level=1; var4=var1; end;
else if missing(var3) then do; level=2; var4=var2; end;
else do; level=3; var4=strip(var3); end;
run;
proc sort data=x; by var1 var2 var3; run;
data x;
set x;
_page=ceil(_n_/25);
keep _page level var4;
run;
ods rtf file="...\try.rtf";
proc report data=x;
column _page level var4;
define _page/ group noprint;
define level/ display order=data noprint;
define var4/display order=data;
break after _page/page;
compute var4;
if level=2 then call define(_col_, "style", "style=[indent=0.5 in]");
if level=3 then call define(_col_, "style", "style=[indent=1 in]");
endcomp;
run;
ods rtf close;
Thanks for your suggestion. Still I did not figure out how to get what I want.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
Still thinking about your presentation idea? The submission deadline has been extended to Friday, Nov. 14, at 11:59 p.m. ET.
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.