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 (September 2008, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Wed, 3 Sep 2008 09:26:19 -0700
Reply-To:   Learner <pradev@GMAIL.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Learner <pradev@GMAIL.COM>
Organization:   http://groups.google.com
Subject:   Re: Picture format
Comments:   To: sas-l@uga.edu
Content-Type:   text/plain; charset=ISO-8859-1

On Sep 3, 11:38 am, gerhard.hellrie...@T-ONLINE.DE (Gerhard Hellriegel) wrote: > Question is, do you really have time-variables? Not chracter variables > which look like time variable? > If that is the case, you should convert that to real time-variables: > > data a; > x="16:23"; > y="17:10:07"; > tx=input(x,time10.); > ty=input(y,time10.); > put tx time8.; > put ty time8.; > run; > > If you have already numeric time - variables, siply assign a wider time- > format. time8. should do what you want. > > Gerhard > > > > On Wed, 3 Sep 2008 08:12:49 -0700, Learner <pra...@GMAIL.COM> wrote: > >Hi, > > >I have a time variable with hours and minutes for example, 16:20, > >2:27, 6:18 etc. I want to add zero if the length of the time variable > >is less than 5 like 02:27. Please let me know how to do this by using > >the picture format. > > >Thank you, > >Learner- Hide quoted text - > > - Show quoted text -

The time variable I mentioned is a character variable. I got my desired value by using if length(time) ne 5 then time1=compress('0'||time); else time1=time;

But, I want to try it using the picture format. Iam not sure if I can use picture format in this. Just want to learn new stuff.

Thank you -L


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