The idea is that you can have a dataset with many variables so it would take much time writing each one by one.
How can you add all variable names from a dataset to a matrix, without explicitly writing each one by one ?
If there is no such defined option (e.g. within use/read/close options), then is there a trick to do that?
proc iml;
use MyData;
read all var _NUM_ into X;
For details and related issues, see Reading ALL variables INTO a matrix - The DO Loop
http://blogs.sas.com/content/iml/2012/01/16/reading-all-variables-into-a-matrix/
View solution in original post
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
Register now!
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.