|
That's very close to the B8601DTw.d format, though that format has a T
between the date and the time, and has 4 digit year and decimal time (though
perhaps you can adjust those with the w.d)
Mary, I think you would need to swap MMDDYY6. with YYMMDDN6. in your example
to have YY come first. You also don't need to take the timepart of
timestamp, TOD does that for you.
data test;
infile cards missover;
informat timestamp datetime16. chardatetime $16.;
input timestamp;
chardatetime=put(datepart(timestamp),YYMMDDN6.) ||
compress(put(timestamp,tod9.),': ');
format timestamp datetime16.;
cards;
15MAR09:00:05:19
;
run;
-Joe
On Thu, Mar 26, 2009 at 5:27 PM, Mary <mlhoward@avalon.net> wrote:
> Santosh,
>
>
> I'm not sure how to get a format like that, but I was able to convert it to
> a character variable that you could output:
>
>
> data test;
> infile cards missover;
> informat timestamp datetime16. chardatetime $16.;
> input timestamp;
> chardatetime=put(datepart(timestamp),mmddyy6.) ||
> compress(put(timepart(timestamp),tod9.),': ');
> format timestamp datetime16.;
> cards;
> 15MAR09:00:05:19
> ;
> run;
>
> -Mary
>
>
>
> ----- Original Message -----
> From: "Santosh Kandi" <skandi@TI.COM>
> To: <SAS-L@LISTSERV.UGA.EDU>
> Sent: Thursday, March 26, 2009 4:43 PM
> Subject: Converting Date Time format (MVS SAS)
>
>
> Hello All,
>>
>> I am running SAS on MVS to read SMF30 records and want to the know the
>> easiest way to convert the Date/Time format
>> FROM: 15MAR09:00:05:19
>> TO: YYMMDDHHMMSS
>>
>> When I read SMF records I use "SMFSTAMP8." for Input and then format it
>> with:FORMAT SMF30SIT DATETIME16. This gives me the format 15MAR09:00:05:19
>>
>> But my requirement is output is as YYMMDDHHMMSS
>>
>> Thanks for you help.
>> Santosh
>>
>
|