Previous Topic: CASE()Next Topic: CPUTIME()


CP()

This function issues a VM CP command and returns a response from the CP. z/OS must be operating under VM.

Syntax

result = CP(command,[stem.])

Parameters

result

Error or completion status.

command

Command string to be passed to CP.

Note: VM systems are case-sensitive.

stem

Name of a stem variable in which individual lines of a response from a CP are returned. Include the period. The first line of the response returns in stem.1, the second line in stem.2, and so forth, without breaks.

The stem variable cannot be global (that is, it cannot begin with an ampersand).

Default: Results are returned on the stack and can be accessed with PULL() or a similar function.

Return Codes

0

COMMAND EXECUTED

101

ARG 1 MISSING OR INVALID

102

One of the following codes:

ARG 2 MISSING OR INVALID

ARG 2 NOT STEM VARIABLE

120

NOT UNDER VM

121

RESPONSE TOO LONG

122

PASSWORD REQUIRED

123

NO RESPONSE FROM VM

124

INSUFFICIENT STORAGE

Example

cp('MSG RBROWNE testing') == 0    /* RBROWNE would get a message  */
cp('Q MVSB1') == 0                /* 'MVSB1 - DSC' might be put in queue */