Can anyone help me solve this problem (picking youngest child of dataset)??

Reply
Occasional Contributor
Posts: 12

Can anyone help me solve this problem (picking youngest child of dataset)??

Any input on how to create an Excel file with the first name, DOB of child and Name of child of the youngest child (clearly bulb born on 22-nov-80).

Thanks

last namefirst nameDOB of ChildName of Child

ArmstrongCharlene23-Dec-02Fan
LeeLi-Hwa22-Nov-80Bulb
GillBalwant6-Jun-03Bowl
GILLSatwant28-Jan-07Shephard

Dave

Respected Advisor
Posts: 4,934

Re: Can anyone help me solve this problem (picking youngest child of dataset)??

Isn't Bulb the oldest and Shephard being born the most recently the youngest?

PG
Occasional Contributor
Posts: 12

Re: Can anyone help me solve this problem (picking youngest child of dataset)??

You are absolutely right sorry about that.

Shepard would be the youngest.

After proc sorting the dataset by DOB what would be the best to remove Shepard's info (first name, DOB and name) and setting up another file in excel.

thanks

Super User
Posts: 19,869

Re: Can anyone help me solve this problem (picking youngest child of dataset)??

*select the minimum;

proc sql;

create table want as

select * from have

where dob=(select min(dob) from have);

quit;

*use export in SAS to get the code or tagsets which generates an XML file;

ods tagsets.excelxp file="C:\temp\test.xml" style=journal;

proc print data=want noobs;

run;

ods tagsets.excelxp close;

Occasional Contributor
Posts: 12

Re: Can anyone help me solve this problem (picking youngest child of dataset)??

Thank you very much !

Ask a Question
Discussion stats
  • 4 replies
  • 214 views
  • 0 likes
  • 3 in conversation