Proc summary data = LIB_TRN.FFMSUB_SELECTED_1804 nway missing;
by gpnr crms_org_id;
var prov_num;
output out= LIB_TRN.FFMSUB_SELECTED_AGG_1804(drop = _:)
sum= maxid(prov_num(gpnr crms_org_id reporting_period db_filialnummer
db_kontonummer ccdb_id kategorie gpname gbmerker
nachrichtlich))=;
quit;
WARNING: Variable gpnr already exists on file LIB_TRN.FFMSUB_SELECTED_AGG_1804.
WARNING: Variable crms_org_id already exists on file
LIB_TRN.FFMSUB_SELECTED_AGG_1804.
WARNING: The duplicate variables will not be included in the output dat
the output statement number 1.
Please help me to remove this warning .
The problem your code creates is that you are using these variables for two different purposes: GPNR and CRMS_ORG_ID. They are both part of the BY statement and part of the MAXID clause.
I can't see a reason to keep them in the MAXID clause, when they are already part of the BY statement.
Please help me reAD yR code . Easy to read code is not optional, it is key for anyone else looking at it. Several tools are made available for to post code, use the code window - its the {i} above the post area, this keeps code formatting and doesn't put smiley faces in for instance. Also, avoid coding in mixed case, thats not how you read a book.
You can try the autoname and autolabel options. Basically the warning is telling you that the variable being created from the sum already exists as a variable in the dataset, so you need to give it another name. The autoname should add sum_ to the name.
proc summary data=lib_trn.ffmsub_selected_1804 nway missing; by gpnr crms_org_id; var prov_num; output out=lib_trn.ffmsub_selected_agg_1804 sum=maxid(prov_num(gpnr crms_org_id reporting_period db_filialnummer db_kontonummer ccdb_id kategorie gpname gbmerker nachrichtlich))= / autoname autolabel; quit;
The problem your code creates is that you are using these variables for two different purposes: GPNR and CRMS_ORG_ID. They are both part of the BY statement and part of the MAXID clause.
I can't see a reason to keep them in the MAXID clause, when they are already part of the BY statement.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9.
Lock in the best rate now before the price increases on April 1.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.