LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (February 2005, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Tue, 15 Feb 2005 13:03:08 -0500
Reply-To:     "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         "Howard Schreier <hs AT dc-sug DOT org>" <nospam@HOWLES.COM>
Subject:      Re: Convert ZIP into character and add missing zeroes infront

However, there is the SSNw. format, which was provided specifically for U.S. social security numbers stored as numerics.

The Z5. format does the job for U.S. zip codes, but it was not designed for that purpose alone. If you have 9-digit zips stored as numerics, and you want them displayed with the customary hyphen between the 5th and 6th digits, it won't help you.

On Tue, 15 Feb 2005 09:23:20 -0800, Choate, Paul@DDS <pchoate@DDS.CA.GOV> wrote:

>Karen - you need to look into picture formats under Proc Format - SAS >provides examples of what you want. > >hth > >Paul Choate >DDS Data Extraction >(916) 654-2160 > >-----Original Message----- >From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Karen >Grimm >Sent: Tuesday, February 15, 2005 7:14 AM >To: SAS-L@LISTSERV.UGA.EDU >Subject: Re: Convert ZIP into character and add missing zeroes infront > >Is there a similar format that will do the same thing for Social Security >numbers? > >On Mon, 14 Feb 2005 13:00:03 -0800, Choate, Paul@DDS <pchoate@DDS.CA.GOV> >wrote: > >>Try the z5. format - it writes numbers to characters with leading zeros. >> >> >>Zip5=put(zip,z5.); >> >>Paul Choate >>DDS Data Extraction >>(916) 654-2160 >> >>-----Original Message----- >>From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of >Nick . >>Sent: Monday, February 14, 2005 12:58 PM >>To: SAS-L@LISTSERV.UGA.EDU >>Subject: Convert ZIP into character and add missing zeroes infront >> >>Hello SAS experts, >> >>I have ZIP codes in numeric form like 7001 (it's missing a zero infront to >>make it a legitimate 5-digit zip code), 60073(has 5- digits, it's fine), >1, >>etc. I would like to convert my numeric ZIPS into characters and at the >same >>time add leading zeroes to make them legitimate 5-digits ZIPs. How do I do >>that? Thnaks much. >> >>ZIP >>7001 >>1 >>23 >>345 >> >> >>I would like ZIP to become a character variable like >> >>ZIP >>07001 >>00001 >>00023 >>00345 >> >>-- >>___________________________________________________________ >>Sign-up for Ads Free at Mail.com >>http://promo.mail.com/adsfreejump.htm


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