Submitting SAS Statements


Full Substitution

If you want to substitute many values into a SUBMIT block, it can be tedious to explicitly list the name of every SAS/IML matrix that you reference. You can use an asterisk (*) in the SUBMIT statement as a "wildcard character" to indicate that all SAS/IML matrices are available for parameter substitution. This is called full substitution and is shown in the following statements:

proc iml;
DSName = "Sashelp.Class";
NumObs = 1;

submit *;
proc print data=&DSName(obs=&NumObs);
run;
endsubmit;

Figure 10.4: Full Substitution

Obs Name Sex Age Height Weight
1 Alfred M 14 69 112.5



If the SUBMIT block contains a parameter reference (that is, a token that begins with an ampersand (&) for which there is no matching SAS/IML matrix, the parameter reference is not modified prior to being sent to the SAS language processor. In this way, you can reference SAS macro variables in a SUBMIT block.