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: 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
  • 2 replies
  • 365 views
  • 0 likes
  • 3 in conversation