Converting Numeric and Character Data
1Converting Numeric Variables and Character Variables in SASRandall Reilly; Covance Clinical Pharmacology; Madison, WIINTRODUCTIONThis paper gives a general understanding of how to convert Numeric and Character SAS variables Numeric VARIABLES TO Character VARIABLESThe simpliest way to convert Numeric data to Character data is using the PUT function. Converting numbers tocharacters is quite you have only whole numbers use the following statement:charvar = STRIP(PUT(numvar, 8.));This will output the Character values as whole numbersExample:FROMTO77696934341212***Yo u should always format the new Character variables ( format charvar $8.) and you should always strip the newvariable since Numeric data is right justified and characters are left justified. If you don t you may run into thefollowing:format numvar 8. charvar $ numvar is not justified you will, in most cases get no data populating charvar. In other cases you will only getpartial : Numeric $5 Positions - 12345678 Positions - ***If you have Numeric data (subject numbers for example).
3 FROM TO 7.1 7.10 23.87 23.87 12 12.00 697.45 697.45 998.9 998.90 53702.12456 53702.12 CONVERTING CHARACTER VARIABLES TO NUMERIC VARIABLES The simpliest way to convert numeric data to character data is using the INPUT function.
Download Converting Numeric and Character Data
Information
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
Related search queries
Converting Address Book, Converting Address Book Converting, Converting ppm to ppt and, Converting ppm to ppt, Converting Existing Elevations When the, CONVERTING NON POSI REAR END, Converting, Building Blocks Tips for the scales, Viscosity Converting Chart, Converting from Intravenous to Oral Antibiotic, Converting from Intravenous to Oral Antibiotic Therapy, COMPARISON OF ANGIOTENSIN CONVERTING