Transcription of Converting Numeric and Character Data
{{id}} {{{paragraph}}}
1 Converting Numeric Variables and Character Variables in SASR andall 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**You should always format the new Character variables ( format charvar $8.)
CONVERTING CHARACTER VARIABLES TO NUMERIC VARIABLES The simpliest way to convert numeric data to character data is using the INPUT function. If you have only numeric data as an integer in a character variable use the following statement: numvar = INPUT(charvar, 8.); Example: FROM TO 7 7 69 69 34 34 12 12
Domain:
Source:
Link to this page:
Please notify us if you found a problem with this document:
{{id}} {{{paragraph}}}
Destring — Convert string variables to numeric variables, Destring— Convert string variables to numeric variables, Convert, Numeric, Split — Split string variables into parts, Numeric variables, Variables, Split string variables into parts, Chapter 305 Multiple Regression, Symbolic, Symbolic Variables, Variables Symbolic, Macro variable, Array, Numeric SAS, Floating point, Lecture 2: MIPS Instruction Set