BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Jahanzaib
Quartz | Level 8

while merging data i got following error, can anyone look at it and tell me how to deal with it. 

 

Screenshot 2016-12-07 11.04.11.png

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

This message is telling you that COMPANY is part of both data sets that you are merging.  However, it has a different length in the two data sets.  You would need to examine the length (probably running  PROC CONTENTS on both data sets), select the longer length, and use that to define COMPANY.  You would do that by adding this sort of statement (using the longer length rather than 20):

 

length company $ 20;

 

It has to go BEFORE the MERGE statement.

View solution in original post

2 REPLIES 2
Astounding
PROC Star

This message is telling you that COMPANY is part of both data sets that you are merging.  However, it has a different length in the two data sets.  You would need to examine the length (probably running  PROC CONTENTS on both data sets), select the longer length, and use that to define COMPANY.  You would do that by adding this sort of statement (using the longer length rather than 20):

 

length company $ 20;

 

It has to go BEFORE the MERGE statement.

mkeintz
PROC Star

Or if the first dataset in the merge statement (E1 in your case) has company with the longer length, it will prevail.

 

In general the first encounter with a variable establishes its attributes (length, format, label), while the last encounter establishes the value.

 

 

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

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.

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
  • 2 replies
  • 887 views
  • 3 likes
  • 3 in conversation