You gonna learn SAS/IML language ,it is very like Matlab .
and read @Rick_SAS blog would give you a lot help .
For your last question.
%let dsid=%sysfunc(open(sashelp.class));
%let nvar=%sysfunc(attrn(&dsid,nvar));
%let dsid=%sysfunc(close(&dsid));
%put nvar= &nvar;
... View more