Hi,
Since i am concatenating some variables that are not currently present in the current data but will be in future data extract, it is giving me "uninitialized" log message. How would I prevent this from happening without removing the variables in my program?
program (test3 not present in current data):
var=catx(', ' , test1, test2, test3);
log message:
"Note: Variable test3 is uninitialized."
Depends partly on how the rest of the program is structured.
One way that would work is to reference the variables in an ARRAY statement. If they are all of the same type (or at supposed to be) then you could record as:
array x test1-test3 ;
var=catx(', ' , of x[*]);
Depends partly on how the rest of the program is structured.
One way that would work is to reference the variables in an ARRAY statement. If they are all of the same type (or at supposed to be) then you could record as:
array x test1-test3 ;
var=catx(', ' , of x[*]);
Before you use them in formula, you should define them with their max length, for example:
Length test1 test2 test3 $10;
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.