BookmarkSubscribeRSS Feed
LtRogers
Calcite | Level 5

My proc tabulate

proc tabulate data=s_18  format=nlnum32. out=s_18_CF;
class original_currency yearno company_name company_bk company_type_code period_name typeno;
var   epifp;
by    Company_Name company_bk company_type_code period_name ;
 
table yearno='Year'*company_name='Company'*company_bk='nr'*company_type_code='Institutgroup'*original_currency='Curr'*period_name='Period'
all='Total', all='Total'*(epifp);
run;

I get this notes in the log and I can't understand why. Has anyone an idea of why? Why does SAS create new names?
NOTE: Variable Company_Name already exists on file WORK.S_18_CF, using Company_Name2 instead.
NOTE: Variable Company_BK already exists on file WORK.S_18_CF, using Company_BK2 instead.
NOTE: Variable Company_Type_Code already exists on file WORK.S_18_CF, using Company_Type_Code2 instead.
NOTE: Variable Period_Name already exists on file WORK.S_18_CF, using Period_Name2 instead.
NOTE: The above message was for the following BY group:
      Company name=XXX Company_BK=NNNN Company type code=SSS Period name=2022
1 REPLY 1
ChrisNZ
Tourmaline | Level 20

You're asking proc tabulate to use a variables in the table crossings AND in the BY groups.

The variables are used twice in your logic, so they appear twice in the output data set and need different names.

SAS Innovate 2025: Register Now

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!

How to Concatenate Values

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 66 views
  • 2 likes
  • 2 in conversation