- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
How do I rename "real_date" to "year_qtr" to show in the proc summary output?
data for_summary;
set OUTPAT;
real_date=input(eventdate,YYMMDD10.);
format real_date date9.;
run;
proc summary data=for_summary;
where (cpt between '99201' and '99215')
or (cpt between '99241' and '99245')
or (cpt between '99381' and '99397')
or (cpt between '99354' and '99355')
or (cpt between '99401' and '99412')
;
where also real_date between '01JAN2021'd and '30JUN2021'd;
class real_date;
format real_date yyq6.;
var cost;
output out=EMpull2 sum=QTR_COST;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
In the penultimate line of your code, try:
output out= EMpull2 (rename=(sum=QTR_COST real_date=year_qtr) ) ;
SAS 9.4 (TS1M6) X64_10PRO WIN 10.0.17763 Workstation
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That worked. Now, I'm trying to have an output that shows the distinct count of an ID called "memberno" by quarter. So I would like to see how many distinct members there were in Q1 vs. Q2 along with the cpt codes and cost. So it would look like this:
cpt codes Q1 Q2 cost
code1 #ofmmbers with this code #of members with this code in $$$$
code2 #of members with this code
....
proc summary data=for_summary;
where (cpt between '99201' and '99215')
or (cpt between '99241' and '99245')
or (cpt between '99381' and '99397')
or (cpt between '99354' and '99355')
or (cpt between '99401' and '99412')
;
where also real_date between '01JAN2021'd and '30JUN2021'd;
class cpt real_date;
format real_date yyq6.;
var cost;
output out=EMpull2 (rename=(sum=QTR_COST real_date=year_qtr) ) ;
run;
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Define "output". Do you mean the print output in the Results window/tab, or the resulting dataset?