I can not get what exactly "(" should be placed in the codes
How to solve this?
data trans_summary(drop=txn_amt_rmb);
set trans_list;
by party_id plus_minus_flag;
retain sum_rmb;
if first.plus_minus_flag then sum_rmb=0;
sum_rmb=(sum_rmb,txn_amt_rmb);
if last.plus_minus_flag then output;
run;
You reversed things on the OUTPUT statement. The original incorrect version:
output out=trans_summary sum_rmb=sum(txn_amt_rmb);
Within an OUTPUT statement, you need to reverse the request:
output out=trans_summary sum(txn_amt_rmb)=sum_rmb;
Or, since there is only one variable in the VAR statement, simply:
output out=trans_summary sum=sum_rmb;
This
sum_rmb=(sum_rmb,txn_amt_rmb);
should have been
sum_rmb = sum(sum_rmb,txn_amt_rmb);
This line:
sum_rmb=(sum_rmb,txn_amt_rmb);
Does not make sense. A variable cannot hold two parameters. Think your missing sum:
sum_rmb=sum(sum_rmb,txn_amt_rmb);
thank you~another little question..how to fix it
ERROR 73-322: expecting =
proc summary data=trans_list;
class party_id plus_minus_flag;
var txn_amt_rmb;
output out=trans_summary sum_rmb=sum(txn_amt_rmb);
run;
That is nothing like your first post. Please post examples of the actual question and code in future.
proc summary data=trans_list;
class party_id plus_minus_flag;
var txn_amt_rmb;
output out=trans_summary sum=sum_rmb;
run;
In the OUTPUT statement, you can't use a SUM function as you are trying to do, the SUM= option will create the sums of whatever variable(S) you have in the VAR statement, and then assign that sum to the variable name after the = sign.
output out=trans_summary sum=sum_txn_amt_rmb;
You reversed things on the OUTPUT statement. The original incorrect version:
output out=trans_summary sum_rmb=sum(txn_amt_rmb);
Within an OUTPUT statement, you need to reverse the request:
output out=trans_summary sum(txn_amt_rmb)=sum_rmb;
Or, since there is only one variable in the VAR statement, simply:
output out=trans_summary sum=sum_rmb;
@Geo- wrote:
thank you~another little question..how to fix it
ERROR 73-322: expecting =
proc summary data=trans_list; class party_id plus_minus_flag; var txn_amt_rmb; output out=trans_summary sum_rmb=sum(txn_amt_rmb); run;
Follow Maxim 1 and read the documentation for the summary procedure. Your mistake will become obvious.
Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!
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.