Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

How would you code a merge that will write the matches of
both to one data set, the non-matches from the left-most
data set to a second data set, and the non-matches of the
right-most data set to a third data set?

Answer Posted / sas job searcher

data x1y1
x1y0
x0y1;
/* x1y1, x1y0, x0y1 are output data set names */
merge left_most(in=x) right_most(in=y);
by id;
/* write all matches to x1y1: */
if x=1 and y=1 then output x1y1;
/* non-matches from the left-most data set: */
if x=1 and y=0 then output x1y0;
/* non-matches from the right-most data set: */
if x=0 and y=1 then output x0y1;
run;

Is This Answer Correct ?    11 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I have a dataset concat having variable a b & c. How to rename a b to e & f?

1034


what is the use of sas management console? : Sas-di

1102


what is the Population you used in your project, is it ITT or PP?

2751


What is the use of %include statement?

1070


how many types prompting framework can be broken down to? : Sas-bi

1086


What are the difficulties u faced while doing vital signs table or dataset?

2402


How to include or exclude specific variables in a data set?

1126


what is the difference between unique key and primary key? : Sas-di

1142


What is the good sas programming practices for processing large data sets?

1131


What are the differences between proc means and proc summary?

1151


What is program data vector (pdv)?

1301


explain the difference between proc means and proc summary?

1137


what is sas and what are the functions? : Sas-administrator

1001


Explain substr function?

1121


How to create an external dataset with sas code?

1169