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
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
Submit your idea!
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.