Programming Tips 8
Pay attention to the following when using the INPUT function:
1. Use the Right Informat
Converting a variable from character to numeric is just a matter of finding the right informats.
Below is the list of informats that are commonly used:
You can also look up the list of informats on the SAS official website.
2. Invalid Data Error
When using the Input function, you might encounter a note from the Log tab:
NOTE: Invalid argument to function INPUT at line 60 column 9.
This is often due to an incomplete data point from the variable.
The Date variable above contains an incomplete date (which is very common by the way).
When converting the variable into numeric, SAS will show a note regarding the Invalid data.
Although this is not considered an error message, it is a good programming practice to clean it up before continuing your program.