Hello everyone,
I have a sample code as below, which includes if statements . As we know, if the variable has character type we need to put " " after if statement, if it has numeric type we need to put .(period) after if statement.
For character type variable, In the following code, "if "statement works fine when I put " " in the if statement. However, if I put .(period) in the "if" statement ,it changes the whole values .
I want to understand the reason why .(period) changes the all values if variable is character type.
I'm asking this question because I pull the whole if statements from SQL and this variables can be numeric type or character type, if I replace whole .(period) values with " " then some of my character type will be affected wrong.
Here is my sample code;
Data Have;
Length Variable $ 20 Value 8;
Infile Datalines Missover;
Input Variable Value;
Datalines;
. 1000
Istanbul 1000
Istanbul 1000
. 1000
;
Run;
Data Want;
Set Have;
If Variable=" " Then Value=1600;
Run;
/*Change Whole Values*/
Data Want;
Set Have;
If Variable=. Then Value=1600;
Run;
May I have breif information, please?
Thank you
... View more