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-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 1 reply
  • 240 views
  • 0 likes
  • 2 in conversation