how to write code for left outer join in SAs using datastep?

Answers were Sorted based on User's Feedback



how to write code for left outer join in SAs using datastep?..

Answer / uma

first sort these datasets by common variable DEPT_ID,Then
use the following:
data left_join;
merge emp (in=a) dept (in=b);
by dept_id;
if a then output;
run;

Is This Answer Correct ?    22 Yes 2 No

how to write code for left outer join in SAs using datastep?..

Answer / aniruddha

Data left_outer;
merge emp(in=a) dept(in=b);
by deptno;
if a=1 and b=0;
run;

Is This Answer Correct ?    22 Yes 8 No

how to write code for left outer join in SAs using datastep?..

Answer / lakshmi

data left_join;
merge data1(in=a) data2(in=b);
by subjid;
if a;
run;

Is This Answer Correct ?    10 Yes 3 No

how to write code for left outer join in SAs using datastep?..

Answer / jbhjhj

dnt use set it wnt work.
use merge with in statements as above.

Is This Answer Correct ?    8 Yes 6 No

how to write code for left outer join in SAs using datastep?..

Answer / venkatesh

if you use x=1 and y=0
you must use set statement also
try this
data a b;
merge one two;
by id;
if x=1 and y=1 then output a;
if x=1 and y=0 then output b;
data new;
set a b;
run;

Is This Answer Correct ?    1 Yes 0 No

how to write code for left outer join in SAs using datastep?..

Answer / raghava

proc sql;
select *
from one left join two
on one.X=two.X;
quit;

The above is code for lefjoin.

Is This Answer Correct ?    1 Yes 0 No

how to write code for left outer join in SAs using datastep?..

Answer / vk

Data Left_outer;
set data1(in=x) data2(in=y);
if x=0 and y=1;
run;

Is This Answer Correct ?    9 Yes 12 No

how to write code for left outer join in SAs using datastep?..

Answer / pnprasad

There is no such Inner & Left Joins. In SAS only one join
i.e Right Join. If you want Left Join you have to use the
data set in the second place. For example: D1 D2 are the
data sets for D2 you want to make, UPDATE D1 D2;

Is This Answer Correct ?    1 Yes 22 No

Post New Answer

More SAS Interview Questions

What statement do you code to tell SAS that it is to write to an external file?

5 Answers  


If you set a label in the data step and call a proc freq on the data, how do you display the data without the labels and just the variables.

1 Answers  


what is sas database server? : Sas-di

0 Answers  


Write a SAS macro to calculate number of numbers in an email address

2 Answers  


Of all your work, where have you been the most successful?

0 Answers   Oracle, Six Sigma,






Did you used proc lifetest? when?

2 Answers   Accenture, Parexel, Quintiles,


What are the five ways to do a table lookup in sas? : sas-grid-administration

0 Answers  


Why do we use QUIT commmand for proc datasets and proc sql ???

3 Answers  


Describe a time when you were really stuck on a problem and how you solved it?

1 Answers  


Explain the difference between informat and format with an example.

0 Answers  


Explain the purpose of substr functions in sas programming.

0 Answers  


What do you code to create a macro? : sas-macro

0 Answers  


Categories