DATA Step, Macro, Functions and more

Regarding join

Reply
Occasional Contributor
Posts: 19

Regarding join

I have a query and we need to join and none of the columns are present (unique)

How can we join?
Super User
Posts: 13,365

Re: Regarding join

Posted in reply to saikiran_nemani

Example of input data sets and what the result of the join should look like.

 

Sometimes data step Merge is appropriate instead of SQL join if the existing order of the two sets is important.

Occasional Contributor
Posts: 19

Re: Regarding join

Posted in reply to saikiran_nemani
We have to add a variable called Contractor from WMIS dataset to the existing query and on which join we can perform ?
Super User
Posts: 13,365

Re: Regarding join

Posted in reply to saikiran_nemani

@saikiran_nemani wrote:
We have to add a variable called Contractor from WMIS dataset to the existing query and on which join we can perform ?

Provide example data of the input data sets as data step. An Example:

data example;
   input x $ y z;
datalines;
abc  123 456
pdq  987.3  333
;
run;

Then a similar step to show what the result should be for the two small example input data sets.

 

That way we know 1) what the variable names and types are, 2) which data set they come from, 3) order of the data which may be critical if there are no columns to actually "join on".

Super User
Posts: 5,853

Re: Regarding join

Posted in reply to saikiran_nemani
@saikiran_nemani you leave too little information to let us give you usable feedback.
Provide the input sample data and desired output.
Data never sleeps
Ask a Question
Discussion stats
  • 4 replies
  • 156 views
  • 0 likes
  • 3 in conversation