> -----Original Message-----
> From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of
> Titaan Titaan
> Sent: Wednesday, July 21, 2010 12:26 PM
> To: SAS-L@LISTSERV.UGA.EDU
> Subject: Regarding date time values
> Hi all,
> I am unable to get SAS ISO 8601 date time values. I have 2 data sets.
> has SAS date with ISO format. It won't have time value. But another
> set has both date and time values(2 separate variables) with $10 and $5
> formats. I need to set(stack) these data sets and to get only one date
> variable with ISO format. Please help me in this regard.
> Thank you.
You need to tell us a little more about your data. Can you provide an example of you date in the first dataset and examples of date and time strings from your second dataset? An outline of what to do would be something like
Set data1(in=in_1) data(in=in_2);
If in_1 then datetime = dhms(date1,0,0,0);
If in_2 then datetime = dhms(input(date2,some_format.,0,0,input(time2, time_format.));
What formats to use depend on your data. So give us some examples if you need more help.
Daniel J. Nordlund
Washington State Department of Social and Health Services
Planning, Performance, and Accountability
Research and Data Analysis Division
Olympia, WA 98504-5204