02-22-2016 03:49 PM
02-22-2016 04:57 PM
You use informat to tell SAS how to read input, it has nothing to do with the display. Format is how SAS will display your data and has nothing to do with how SAS reads the data from the source.
02-22-2016 11:26 PM
length x $32 ;
format y 4.;
informat z 4.;
In above case , we have 3 variables x ,y, z.
After running the code we will get the below attributes of variables:-
X:- length $32
y:- length 8
z:- length 8
If u will check Y and Z variable. U can see that for 'Y' format statement has changed informat as well.
But for 'Z' variable informat statement has not changed format.
SO my question is why SAS is doing so?
02-23-2016 02:06 AM
I can't tell you why SAS is doing it, I can only tell you that SAS has (probably) been doing it this way for a long time. Just keep in mind that it does, and write your code accordingly.
Anytime I need a specific format or informat assigned to a variable, I always write it out explicitly; I never let a computer assume something that could bite me in the ass later.