BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
ambadi007
Quartz | Level 8

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.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
ChrisNZ
Tourmaline | Level 20

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.

View solution in original post

5 REPLIES 5
Shmuel
Garnet | Level 18

Please post the log you got using the {i} icon and clarify which variable get the uninitialized note

ambadi007
Quartz | Level 8
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

Shmuel
Garnet | Level 18

Why do you check variables that don't exist in the data set? What meaning does it have?

 

 

data_null__
Jade | Level 19

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;

 

 

ChrisNZ
Tourmaline | Level 20

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.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 5 replies
  • 933 views
  • 2 likes
  • 4 in conversation