Previous Page | Next Page

Statements under z/OS

X Statement: z/OS

Issues an operating environment command during a SAS session.
Valid: anywhere
z/OS specifics: issues a TSO command or invokes a CLIST or a REXX exec
See: X Statement in SAS Language Reference: Dictionary

See Also


X <command>;
X XEQ: pgmname <parms>;
X AEQ: pgmname <parms>;
X WEQ: pgmname <parms>;
X Ann: pgmname <parms>;
X Wnn: pgmname <parms>;


Under z/OS, the X and TSO statements are identical when the AEQ, Ann, WEQ, and Wnn 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.

Synchronous execution

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;
Asynchronous execution

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;

Note:   You can use the WEQ: prefix in a subsequent X statement to cause SAS to wait for the program to complete before continuing.  [cautionend]

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:;

See Also

Previous Page | Next Page | Top of Page