今回はCATX関数について解説します。
/* , */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=2222; Id3=2222;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
data data2; set data1;
Id4 = catx(",", Id1, Id2, Id3) ;
run;


- catxにより、変数をカンマで結合することができる。
/* , 文字列 */
data data1;
Id1="1111"; Id2="1111"; Id3="1111";
output;
Id1="2222"; Id2="2222"; Id3="2222";
output;
Id1="3333"; Id2="3333"; Id3="3333";
output;
run;
data data2; set data1;
Id4 = catx(",", Id1, Id2, Id3) ;
run;


- catxにより、変数をカンマで結合することができる。
/* , Id2 . */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=.; Id3=2222;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
data data2; set data1;
Id4 = catx(",", Id1, Id2, Id3) ;
run;


- catxにより、変数をカンマで結合することができる。
- nullを結合しようとすると「.」で扱われる。
/* , Id3 . */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=2222; Id3=.;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
data data2; set data1;
Id4 = catx(",", Id1, Id2, Id3) ;
run;


- catxにより、変数をカンマで結合することができる。
- nullを結合しようとすると「.」で扱われる。
/* | */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=2222; Id3=2222;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
data data2; set data1;
Id4 = catx("|", Id1, Id2, Id3) ;
run;


- catxにより、変数を「|」で結合することができる。
/* | , */
data data1;
Id1=1111; Id2=1111; Id3=1111;
output;
Id1=2222; Id2=2222; Id3=2222;
output;
Id1=3333; Id2=3333; Id3=3333;
output;
run;
data data2; set data1;
Id4 = catx("|",",", Id1, Id2, Id3) ;
run;


- catxにより、変数を「|」で結合することができる。
- 1番目の引数「|」で区切り、それ以外の「,」「Id1」「Id2」「Id3」を結合している。