Previous Topic: ALTER TABLE Statement—Add a Table ColumnNext Topic: CREATE TABLE Statement—Define Relational Table


CLOSE Statement—End Cursor Operation

The CLOSE statement ends a cursor operation.

Consider the following information when you use the CLOSE statement:

Note: To release resources, include the CLOSE statement when a cursor operation has ended.

Use this syntax in an AOF rule or an OPS/REXX program:

ADDRESS SQL "CLOSE keywords" {cursorname}
[SYSTEM(ALL|EXT|sysnames)]
[SYSWAIT(seconds)]
[OUTPUT|NOOUTPUT]
[SYSPLEX]
[SUBSYS(subsystem)]

To invoke the statement from a TSO/E REXX program or a TSO CLIST, use this syntax:

OPSQL CLOSE {cursorname}
cursorname

Defines the name of the cursor operation you are ending.

SYSTEM

Performs cross-system SQL operations. Specify one of these values:

ALL

Routes the SQL command to all active MSF-defined systems, including the local system.

EXT

Routes the SQL command to all remote, active MSF-defined systems.

sysnames

Routes the SQL command to the specified systems. You may specify from one to eight system names as the value of sysnames.

Note: For more information about the SYSTEM operand, see the User Guide.

SYSWAIT

Defines the number of seconds the SQL processor waits for output from a remote system.

Limits: 1-300 seconds.

Note: Do not specify a value for SYSWAIT if you specify the SYSTEM(ALL), SYSTEM(EXT), or NOOUTPUT keywords.

OUTPUT or NOOUTPUT

Indicates whether the command returns output to the external data queue. To return output, specify OUTPUT; otherwise, specify NOOUTPUT.

NOOUTPUT is implied when:

SYSPLEX

(Optional) Reduces the scope of the SYSTEM(ALL|EXT) operand to MSF connected systems that belong to the same z/OS sysplex as the command issuer. The keyword has no effect on a list of explicit system names.

SUBSYS

(Optional) Performs SQL operations on other CA OPS/MVS subsystems that are in communication with the current one. Specify the following value:

subsystem

Routes the SQL command to the specified subsystem. You can use only one four-character name of the subsystem as follows: OPSx.

Example: CLOSE CURSTAT Command

To end the cursor operation named CURSTAT, you can issue this command from an OPS/REXX program:

ADDRESS SQL
  "CLOSE CURSTAT"