05-23-2018 10:44 AM - edited 05-23-2018 10:47 AM
data a; input ID Gender $; cards; 1 M ; data b; input Date $10.; cards; 1/1/2010 1/2/2010 ; data want; if 0 then set a; set b; if _n_=1 then set a; run;
05-23-2018 10:59 AM
Thank you! One more question. How does this work if I have several observations in dataset A?
I have two datasets:
I'm trying to create a dataset that looks like this:
ID Gender Date
1 M 1/1/2010
1 M 1/2/2010
2 F 1/1/2010
2 F 1/2/2010
05-23-2018 11:09 AM
I would request you to provide us a more comprehensive and complete representative sample. Your data doesn't seem to have clear logic of match apart from mere plugging in 1 and 2 dates to gender category. Or is that all the data is?
05-23-2018 11:12 AM - edited 05-23-2018 11:13 AM
data a; input ID Gender $; cards; 1 M 2 F ; data b; input Date $10.; cards; 1/1/2010 1/2/2010 ; proc sql; create table want as select * from a,b order by id,gender; quit;
Need further help from the community? Please ask a new question.