Home > OS >  How to use CATX function in SAS
How to use CATX function in SAS

Time:12-15

I got "ItIsBlue" by following program. If it's word1 to word3 in order, I would get "IsItBlue", I think. Why?? Please give me some advice.

data dt00;
 word1 = 'Is';
 word2 = 'It';
 word3 = 'Blue';
 all = catx(word1, word2, word3);
run;

CodePudding user response:

The first argument to CATX() is the string you want to insert between the non-missing values of the other arguments.

Typically it is used to insert a delimiter in a list of values.

var1=1;
var2=2;
var3=.;
var4=4;
var5=5;
list=catx(',',of var1-var5);

Will result in LIST being set to the string

1,2,4,5

If you wanted the arguments concatenated in the order they are listed use the CATS() function instead.

  • Related