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 (November 2008, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 18 Nov 2008 21:03:10 -0800
Reply-To:     Suvi <svbsas@GMAIL.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Suvi <svbsas@GMAIL.COM>
Organization: http://groups.google.com
Subject:      Prefixing Zero to Numeric Variable
Comments: To: sas-l@uga.edu
Content-Type: text/plain; charset=ISO-8859-1

Hi Friends,

I have a numeric varibale with defualt lenght( up to 8 digits) .In the data set values will come in different lenghts..

Please look at the below example.

data Test; input empid empname ; cards; 3450 AAA 124859 BBB 10210 CCC ; run;

Here i want to prefix 0 with the empid which is less then 8 digits.

Let us say for first obs it should be 00003450 , and second obs it should be 00124859.

Here we can do this by applying Z8. format. but i dont want to apply the format and i want to perfix zero as actual values.

Could you please help me to solve this?

Thanks & Regards Suvi.


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