BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
CathyVI
Pyrite | Level 9

Hi,

I did a left join of the two data and received this warning. Should I be concern about my outcome due to this warning or not. How can I rectify this issue for future codes.

/*perform left join*/
proc sql;
create table final_table_0607 as
select * from mth_0607 as x left join case_07 as y
on x.bene_id = y.bene_id;
quit;

>>>>>>>>>>>>>>>>>>>>>>

1 OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
72
73 proc sql;
74 create table final_table_0607 as
75 select * from mth_0607 as x left join case_07 as y
76 on x.bene_id = y.bene_id;
WARNING: Variable bene_id already exists on file WORK.FINAL_TABLE_0607.
NOTE: Table WORK.FINAL_TABLE_0607 created, with 14461320 rows and 19 columns.
1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26

There is a variable named bene_id in both data sets in this left join. The final output data set will contain only one of these variables named bene_id, which IN THIS SPECIFIC CASE is not a problem because you left join on BENE_ID, and so the values of both variables of BENE_ID must match. (There can be other cases where the two variables have different values, and only one of those variables will wind up in the output data set)

--
Paige Miller

View solution in original post

1 REPLY 1
PaigeMiller
Diamond | Level 26

There is a variable named bene_id in both data sets in this left join. The final output data set will contain only one of these variables named bene_id, which IN THIS SPECIFIC CASE is not a problem because you left join on BENE_ID, and so the values of both variables of BENE_ID must match. (There can be other cases where the two variables have different values, and only one of those variables will wind up in the output data set)

--
Paige Miller

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 380 views
  • 0 likes
  • 2 in conversation