03-11-2012 03:35 AM
NUM_CBTWSN =input(NUM_CBTWS, 5.);
If NUM_CBTWSN is my new variable, what does the command "input(NUM_CBTWS, 5.)" mean? CBTWSN is the new variable and NUM_CBTWS is the old variable.
03-11-2012 04:44 AM
Your NUM_CBTWS is a character type variable and you are using the input function with a SAS numeric informat of 5. to convert it to a character type and store it in the new character variable NUM_CBTWSN.
You can learn more about the input function as per the documentation at, http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#p19en16vskd... and see Example 1.
03-11-2012 05:26 AM
I assume Michelle's fingers didn't type what she actually wanted to say.
"...with a SAS numeric informat of 5. to convert it to a character type and store it in the new character variable NUM_CBTWSN."
"...with a SAS numeric informat of 5. to convert it to a number and store it in the new numeric variable NUM_CBTWSN."
03-11-2012 03:51 PM
NUM_CBTWSN : it is the new variable created based on the existing variable NUM_CBTWS
input function is to convert a character variable type to numeric variable type.
so your new variable NUM_CBTWSN is a numeric variable which is having a length of 5 bytes(default 8 bytes)
03-11-2012 05:51 PM
I didn't see anyone point out an alternative that could also be true. If NUM_CBTWS is a numeric variable, then the function won't return an error, but will return a missing value.