how to write code for left outer join in SAs using datastep?
Answers were Sorted based on User's Feedback
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 |
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 |
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 |
Answer / jbhjhj
dnt use set it wnt work.
use merge with in statements as above.
Is This Answer Correct ? | 8 Yes | 6 No |
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 |
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 |
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 |
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 |
How can sas program be validated?
What is the difference between an informat and a format. Name three informats or formats.
How would you determine the number of missing or nonmissing values in computations?
how sas deals with business intelligence? : Sas-bi
how can you code the confidence intervals?
6 Answers Cytel, IIT, Ranbaxy,
1 new york 7,262,700 2 los angeles 3,259,340 3 philadelphia 1,642,900 how to read the above data using input statement consider the above data is in txt format externally u have to use infile and input statement.
i have a dataset with 100000 records. i want 100 records from that dataset and create a dataset.we need to pick the observations random order like 100obs,500obs,1020obs,1890obs,2565obs like that i need 100 obs in random order? how can we create this one?
What do you know about sas data set?
What are the analysis datasets created, and what are the new variables created in CLINICAL SAS
1 Answers Accenture, Sciformix,
sas implementing companies in pune implementing clinical projects if anyone knows plz send ans immediately
what are scrubing procedures in SAS?
What commands are used in the case of including or excluding any specific variables in the data set?