I have a data with Char ID and I am separating that ID from other vars(numerical) in a matrix. After all calculations I just want to merge them back(horizontal concatenation) for the output:
(UID is CHAR, EMI is NUM)
INFO=UID||EMI;
But IML is not allowing me:
ERROR: All specified variables must be the same type.
Any idea if and how it can be done?
Thanks a lot in advance.
@thepushkarsingh wrote:
I have a data with Char ID and I am separating that ID from other vars(numerical) in a matrix. After all calculations I just want to merge them back(horizontal concatenation) for the output:
(UID is CHAR, EMI is NUM)
INFO=UID||EMI;
But IML is not allowing me:
ERROR: All specified variables must be the same type.
Any idea if and how it can be done?
Thanks a lot in advance.
Afaik this can't be done while in proc iml.
@thepushkarsingh wrote:
I have a data with Char ID and I am separating that ID from other vars(numerical) in a matrix. After all calculations I just want to merge them back(horizontal concatenation) for the output:
(UID is CHAR, EMI is NUM)
INFO=UID||EMI;
But IML is not allowing me:
ERROR: All specified variables must be the same type.
Any idea if and how it can be done?
Thanks a lot in advance.
Afaik this can't be done while in proc iml.
Yes, you can do it. Use the ROWNAME= option when you write the numerical matrix:
proc iml;
EMI = {1 2 3,
4 5 6,
7 8 9};
UID = {"A", "B", "C"};
create Want from EMI[rowname=UID];
append from EMI[rowname=UID];
close;
quit;
proc print data=Want;
run;
You can do it if you only want get a table .
proc iml;
use sashelp.class;
read all var {name age};
close;
age=age#100;
create want var {name age};
append;
close;
quit;
proc print;run;
Registration is open! SAS is returning to Vegas for an AI and analytics experience like no other! Whether you're an executive, manager, end user or SAS partner, SAS Innovate is designed for everyone on your team. Register for just $495 by 12/31/2023.
If you are interested in speaking, there is still time to submit a session idea. More details are posted on the website.
Learn how to run multiple linear regression models with and without interactions, presented by SAS user Alex Chaplin.
Find more tutorials on the SAS Users YouTube channel.