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

Name and describe few sas character functions that are used for data cleaning in brief.

1081


Is the physical structure of the data set in the same orientation as the report? Do you need to reshape the data sets? What method should you use to reshape the data–DATA steps,PROC TRANSPOSE,output data set from a procedure?

2202


List down the reasons for choosing sas over other data analytics tools.

1228


What makes sas stand out to be the best over other data analytics tools?

1023


Mention how to limit decimal places for the variable using proc means?

1084


what is sas database server? : Sas-di

1078


What are the advantages of using sas?

1110


What does PROC print, and PROC contents do?

1189


how are numeric and character missing values represented internally? : Sas programming

1109


What are the 3 components in sas programming?

1163


Given an unsorted data set, how to read the last observation to a new data set?

1312


I am preparing SAS Certified Advanced Programmer for SAS 9 in 2014. If anybody has the latest dumps for this exam, please mail me at dhiman.mukherjee@gmail.com

2675


how we can create a FLAG datasets? Ex:-ID age_group no_persons 1 to 10 10 to 20 3 11 to 20 21 to 30 7 21 to 3o 31 to 40 5

2077


what are 5 ways to perform a table lookup in sas? : Sas-administrator

1194


What is the use of stop statement?

1034