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...


I need help in merging two different datasets. I am merging
by date and I want to propagate observations from one
dataset to the corresponding dates. One dataset has a
unique date for each day of the month, while the other
dataset has same date for different patient visits. For
example I want to spread an observation on the 31DEC2008
from one dataset to several observations with the same date
on a second dataset for all the patients who visited on
that date. I have tried to merge the two and the result is
not what I wanted. Instead I get a dataset whereby all the
dates have missing values where observations from the first
datset should have spread.



I need help in merging two different datasets. I am merging by date and I want to propagate observ..

Answer / kumaraswamy maduri

data new;
date1="31Dec2008"d;
run;

data new1;
input date1 date9. subj;
cards;
31dec2008 1
30dec2008 1
30dec2008 2
31dec2008 2
;
run;

proc sort;by date1;run;

data comp;
merge new(in=x) new1;
by date1;
if x;
run;

I have used the above code. I got perfect results.

Please correct me if I misunderstood your question.

Is This Answer Correct ?    6 Yes 0 No

Post New Answer

More SAS Interview Questions

How would you identify a macro variable? : sas-macro

0 Answers  


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

0 Answers  


What is the difference between an informat and a format? Name three informats or formats.

13 Answers   Accenture, IBM,


How can I remove header from output data set?

0 Answers  


i want for interview question & answer plz it need immediate send t my mail raviprakashmot@gmal.cm

0 Answers   SAS,


What is the purpose of the trailing and How would you use them?

8 Answers  


what is the use of LRECL option.

1 Answers   L&T,


What SAS statements would you code to read an external raw data file to a DATA step?

6 Answers   Accenture,


how to intersect the tables by using PROC MIXED?

1 Answers   CitiGroup,


Explain how merging helps to combine data sets.

0 Answers  


How would you create a data set with 1 observation and 30 variables from a data set with 30 observations and 1 variable?

1 Answers   Quintiles,


6) Explain about below automatic variables a) _N_ b) _ERROR_ c) _CHAR_ d) _NUMERIC_ e) _ALL_ f) FIRST.BY VARIABLE g) LAST.BY VARIABLE h) _NAME_ i) _TYPE_ j) _FREQ_ k) _STAT_ l) _BREAK

1 Answers   IBM, SAS,


Categories