I am not understanding what you want, so can you explain in more detail please? How do you want to make Table 2 from Table 1? The step after that is just the DIAG function, as the 2nd "22" in the result matrix is a typo, right?
Diag is the option. i was wandering how to put that in the shape of table 1.
proc iml;
N=nrow(table1);
test= diag(table2);
result=??
run;
The 2025 SAS Hackathon Kicks Off on June 11!
Watch the live Hackathon Kickoff to get all the essential information about the SAS Hackathon—including how to join, how to participate, and expert tips for success.