In reply to Adalbert Thomalla.

Use the TableCreateFromCAS function, followed by a call to TableGetVarname. Here is an example and two links to the documentation:

cas;
proc casutil;
load data=Sashelp.Iris casout="Iris" replace;
run;

/*
TableCreateFromCAS function:
https://go.documentation.sas.com/doc/en/pgmsascdc/v_051/casactiml/casactiml_langref_sect106.htm
Example of reading CAS table and getting variable names:
https://go.documentation.sas.com/doc/en/pgmsascdc/v_051/casactiml/casactiml_iml_examples36.htm
*/
proc cas;
loadactionset "iml";
source tblcreate;
/* Read numeric columns of CAS table */
opt = "KEEP=_NUMERIC_";
tbl = TableCreateFromCAS("", "Iris", opt);
varNames = TableGetVarName(tbl);
print varNames;
call TablePrint(tbl) colheader="Names" numobs=5;
/* extract some (or all) columns into a matrix */
X = TableGetVarData(tbl, varNames);
/* if you don't need the table, you can delete it and just keep the matrix */
free tbl;
print (X[1:5,])[colname=varNames];
endsource;
iml / code=tblcreate;
run;
quit;