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 (June 2004, week 4)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Thu, 24 Jun 2004 18:07:51 -0400
Reply-To:     "Buchanan, Gordon" <gordon.buchanan@GMACRFC.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Buchanan, Gordon" <gordon.buchanan@GMACRFC.COM>
Subject:      Re: %SYSFUNC and PUT function
Comments: To: Talbot Michael Katz <topkatz@MSN.COM>

You can also use the fact the the %sysfunc function lets you specify a format as the second parameter. This works fine:

%let v=%sysfunc(abs(&i), z4.);

Just use some function that does not change the value of your number; in this case I use ABS.

I often use this to reformat date macro variables as in:

%let d=25jun2004; %let prt_d=%sysfunc(abs("&date"d), mmddyy10.);

On Thu, 24 Jun 2004 01:06:57 -0400, Talbot Michael Katz <topkatz@MSN.COM> wrote:

>Hi. > >I wanted to create integer macro variables of equal length, using the Zw.d >format, e.g., 0001, 0002, 0003,... > >I figured I would do something like: >%let v = %sysfunc(put(&i.,Z4.));


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