Hi Experts,
I have a data set and usually it will have variables Type1 Type2 Type3, but unfortunately this time there is no variables like that, so now if i am working on the below
if Type1 = "1" then label= "Type1";
else label= "NA";
f Type1 = "2" then label= "Type2";
else label= "NA";
etc....
so this time I am getting un initialized note, is there any way to avoid this? Need and needs this to run in future also with out any changes if the variable added next delivery by the data team.
Why do you want to avoid the note? The note is raising a valid point: the data expected by the program is not there.
If you always want the variables to be there, @data_null__ 's recommendation is the way to go.
But don't be surprised if this absent data causes issues later on and the issue goes undetected.
Please post the log you got using the {i} icon and clarify which variable get the uninitialized note
NOTE: VAriable Type1 is uninitialized
NOTE: VAriable Type2 is uninitialized
NOTE: VAriable Type3 is uninitialized
The variables Type1 Type2 Type3 is getting this note , due to this time these are not available
Why do you check variables that don't exist in the data set? What meaning does it have?
Explain how you use the variables when they exist. If they don't exist is the scenario simply the same as when they exist but all values are missing?
Could you achieve the same result if you define TYPE1-TYPE3.
data test;
length type1-type3 $1;
call missing(of type:);
set ...;
<the rest>
run;
Why do you want to avoid the note? The note is raising a valid point: the data expected by the program is not there.
If you always want the variables to be there, @data_null__ 's recommendation is the way to go.
But don't be surprised if this absent data causes issues later on and the issue goes undetected.
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 16. Read more here about why you should contribute and what is in it for you!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.