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.
Thanks,
Gina
Hi Gina,
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.
Cheers,
Michelle
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."
Should be:
"...with a SAS numeric informat of 5. to convert it to a number and store it in the new numeric variable NUM_CBTWSN."
Oops... Thanks for the correction Patrick. Yes brain and fingers mis-match. 🙂
thank you
Hi,
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)
thank you
thank you
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.
The function changes the character variable to numeric.
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.