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

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."

 

1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

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[*]);

 

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

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[*]);

 

ghosh
Barite | Level 11

Before you use them in formula, you should define them with their max length, for example:

Length test1 test2 test3 $10;

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 450 views
  • 0 likes
  • 3 in conversation