Now I want to break this column into two columns, one
aaa
bbb
ccc
and the other
xyz
yxz
zyx
How can I do that quickly in SAS EG? I know in Excel it can be done quickly by text to column… but SAS EG's split column function does something else… not want I want...
Not sure how you would do it by clicking on things, but it is trivial to do with a program.
So if you have a variable names MYVAR in a dataset named HAVE you can use this program to create a new dataset called WANT that adds two now columns names COL1 and COL2.
data want;
set have;
length col1 col2 $10 ;
col1 = scan(myvar,1,'_');
col2 = scan(myvar,2,'_');
run;
Not sure how you would do it by clicking on things, but it is trivial to do with a program.
So if you have a variable names MYVAR in a dataset named HAVE you can use this program to create a new dataset called WANT that adds two now columns names COL1 and COL2.
data want;
set have;
length col1 col2 $10 ;
col1 = scan(myvar,1,'_');
col2 = scan(myvar,2,'_');
run;
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9. Sign up by Dec. 31 to get the 2024 rate of just $495. Register now!