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 (August 2011, week 3)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Wed, 17 Aug 2011 11:39:52 -0400
Reply-To:     Jack Clark <jclark@HILLTOP.UMBC.EDU>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Jack Clark <jclark@HILLTOP.UMBC.EDU>
Subject:      Re: how Pad SSNO with 0
Comments: To: Jamil M Ibrahim <jibrahim@UMC.EDU>
In-Reply-To:  A<AFA9E34D9ECF3A4784A7AA3EE2FD3ED6148D8ED82C@EXMBX2.ntummc.umsmed.edu>
Content-Type: text/plain; charset="us-ascii"

Jamil,

Read your SSN as a numeric field, then apply the z9. format to create a 9-byte character variable with leading zeros.

Ssn_new = put(ssn,z9.);

Jack

Jack Clark Senior Programmer phone: 410-455-6256 fax: 410-455-6850 jclark@hilltop.umbc.edu

University of Maryland, Baltimore County Sondheim Hall, 3rd Floor 1000 Hilltop Circle Baltimore, MD 21250

Please consider the environment before printing this e-mail and/or any attachments.

Confidentiality Notice: This e-mail may contain information that is legally privileged and that is intended only for the use of the addressee(s) named above. If you are not the intended recipient, you are hereby notified that any disclosure, copying of this e-mail, distribution, or action taken in reliance on the contents of this e-mail and/or documents attributed to this e-mail is strictly prohibited. If you have received this information in error, please notify the sender immediately by phone and delete this entire e-mail. Thank you.-----Original Message----- From: SAS(r) Discussion [mailto:SAS-L@LISTSERV.UGA.EDU] On Behalf Of Jamil M Ibrahim Sent: Wednesday, August 17, 2011 11:29 AM To: SAS-L@LISTSERV.UGA.EDU Subject: how Pad SSNO with 0

Why it does not read the ssn? I try to pad the leading spaces in SSno with zeros DATA cars5; 666 667 ***get rid of commas using dlm=',' and double quotes using dsd in infile statement; SYMBOLGEN: Macro variable PATH resolves to C:\Admissions\admit03-04\ay03-04.csv SYMBOLGEN: Some characters in the above value which were subject to macro quoting have been unquoted for printing. 668 INFILE "&PATH" lrecl=400 missover pad dsd dlm=','; 669 670 length FName MName LName EthnDesc $25. ssn $9. ; 671 672 INPUT (Studno1 FName MName LName studno2 SSN Gender studno3 EthnicCd EthnDesc) ($) mcat 673 M1Avg M2Avg M3Avg CumAvg ; 674 675 ssn=input(ssn,z9.); Name = trim(left(lName)) || "? " || trim(left(fName)) ; --- 48 ERROR 48-59: The informat Z was not found or could not be loaded.

Thank you.

Dr. Jamil Ibrahim, Ph.D. Scientist IV, Research Supervisor, Professor, SHRP 2500 N State St. Jackson, MS 39216-4505 Tel: (601) 984-1197 Fax: (601) 984-1205 Email: jibrahim@umc.edu

Individuals who have received this information in error or are not authorized to receive it must promptly return or dispose of the information and notify the sender. Those individuals are hereby notified that they are strictly prohibited from reviewing, forwarding, printing, copying, distributing or using this information in any way.


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