data xxx;
input grp_cnts Count_grp_cnts Tr_Amt Tdate ;
datalines;
2 45 21000 200910
12 15 51000 200910
11 545 1000 200910
03 248 5000 200910
;
run;
/*creating a report:*/
PROC REPORT DATA = XXX;
COLUMN Tr_Amt Tr_Amt = STD_TRNS_AMTS Count_grp_cnts Tr_Amt = LMT;
DEFINE Tdate/ GROUP;
DEFINE LMT/GROUP ORDER=DATA;
DEFINE Tr_Amt /ANALYSIS MEAN FORMAT = 20.2 ' AVG_AMT';
DEFINE STD_TRNS_AMTS / ANALYSIS MEAN FORMAT = 20.2 ' STD_TRNS_AMTS ';
DEFINE Count_grp_cnts/ ANALYSIS SUM FORMAT = 20.2 ' Count_grp_cnts';
RBREAK AFTER /SUMMARIZE DOL;
DEFINE LMT / COMPUTED 'LTD';
COMPUTE BEFORE LMT;
LMT = Tr_Amt + 5 * STD_TRNS_AMTS ;
ENDCOMP;
RUN;
Hi All,
I am trying to create a Report using Proc Report. The details are attached, I am not able to generate the reports because of the
ERROR: COMPUTED conflicts with earlier use of Tr_Amt
Kindly suggest me this.
Thanks!
See this example:
proc report data=temp;
column tdate Count_grp_cnts (sum mean std),tr_amt lmt;
define tdate / group;
define Count_grp_cnts / analysis sum;
define tr_amt / analysis;
define lmt / computed;
compute lmt;
lmt = tr_amt.mean + 5 * tr_amt.std;
endcomp;
run;
Hi All,
I m trying to create a Report using Proc Report by creating computed columns. I m getting another ERROR: You can only BREAK on GROUPing and ORDERing variables.
kindly suggest.
Please show us how the report should look like.
Which statistic of tr_amt should be used in the calculation of lmt? the sum or the mean?
See this example:
proc report data=temp;
column tdate Count_grp_cnts (sum mean std),tr_amt lmt;
define tdate / group;
define Count_grp_cnts / analysis sum;
define tr_amt / analysis;
define lmt / computed;
compute lmt;
lmt = tr_amt.mean + 5 * tr_amt.std;
endcomp;
run;
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.