BookmarkSubscribeRSS Feed
dash
Obsidian | Level 7
How can I report the below data state wise (AP KA TN) in two pages in stead of three; AP and KA data should be in one page and TN data in another page.
plz check. I have written the program like that.(displaying in three separate pages)
data prod_sales;
input state $ pcode $ area $ month stock sale;
cards;
AP N79 HYD 1 40 20
TN N79 CHN 1 30 10
KA N79 BAN 1 45 20
AP N79 HYD 2 30 15
TN N79 CHN 2 10 10
KA N79 BAN 2 45 30
TN N79 CHN 3 20 10
KA N79 BAN 3 25 20
AP N79 HYD 3 20 15
;
proc report data=prod_sales nowd headline;
define state/order;
define area/order;
define pcode/order;
break after state/page;
compute after state;
line 65*'-';
line 'End of the report';
endcomp;
compute before _page_;
line 'This report belongs to: ' state $6.;
endcomp;
run;
1 REPLY 1
NickR
Quartz | Level 8
Try this...

data prod_sales;
set prod_sales;
if state in ('AP','KA') then mypage=1;
else mypage=2;
run;

proc report data=prod_sales nowd headline;
column mypage state pcode area month stock sale;
define mypage/order order=intenal noprint;
define state/order;
define area/order;
define pcode/order;
break after mypage/page;
compute after mypage;
line 65*'-';
line 'End of the report';
endcomp;
compute before _page_;
line 'This report belongs to: ' state $6.;
endcomp;
run;

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore Now →

Health and Life Sciences Learning

 

Need courses to help you with SAS Life Sciences Analytics Framework, SAS Health Cohort Builder, or other topics? Check out the Health and Life Sciences learning path for all of the offerings.

LEARN MORE

Discussion stats
  • 1 reply
  • 1929 views
  • 0 likes
  • 2 in conversation