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.

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

how does sas handle missing values in sort order? : Sas programming

870


What is program data vector (pdv)?

1184


What are the differences between sum function and using “+” operator?

1028


how can you put a "trace" in your program? : Sas programming

1001


What is the difference between proportion and average?

3261


how does sas handle missing values in: assignment statements, functions, a merge, an update, sort order, formats, procs? : Sas programming

980


what is sas application server? : Sas-di

995


why is a stop statement needed for the point=option on a set statement? : Sas programming

1033


Enlist the syntax rules followed in sas statements.

1027


What is SAS? What are the functions does it performs?

1137


what is broad cast agent? : Sas-bi

1009


What are common programming errors committed in sas

1094


How to specify variables to be processed by the freq procedure?

1023


What is substr function?

1114


what are the considerations when picking a SAS/STAT procedure?

3321