LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (March 2009, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 26 Mar 2009 18:13:27 -0500
Reply-To:   Joe Matise <snoopy369@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Joe Matise <snoopy369@GMAIL.COM>
Subject:   Re: Converting Date Time format (MVS SAS)
In-Reply-To:   <006c01c9ae62$023e11a0$832fa8c0@HP82083701405>
Content-Type:   text/plain; charset=ISO-8859-1

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 >> >


Back to: Top of message | Previous page | Main SAS-L page