Under
z/OS, the X and
TSO statements are identical when the AEQ, A
nn,
WEQ, and W
nn prefixes are omitted.
On other operating environments, the TSO statement has no effect,
whereas the X statement is always processed.
When a prefix that contains
a colon is included in the X statement, it executes a user program
synchronously or asynchronously. It can also execute multiple user
programs in concurrent asynchronous mode.
The example below attaches
the program
mypgm
, passes it to
myparms
,
and does not return until the program completes processing. All of
the text between
mypgm
and the terminating
semicolon are considered to be parameters.
X XEQ: mypgm myparms;
The example below attaches
the program
mypgm
, passes it to
myparms
,
and returns to a SAS prompt while the program executes.
X AEQ: mypgm myparms;
data x;x=1;run;
proc print;run;
X WEQ:;
Note: You can use the WEQ: prefix
in a subsequent X statement to cause SAS to wait for the program to
complete before continuing.
Concurrent asynchronous execution
The example below attaches
two programs, executes some more SAS statements, and waits for each
to execute separately. To wait for a particular program to execute,
issue an X Wnn: statement where
the value of nn is the same
as the value of the nn in the
corresponding X Ann: statement.
X A01: pgm1 parms1;
X A02: pgm2 parms2;
data x;x=1;run;
proc print;run;
X W02:;
X W01:;