28.11.2012 Views

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

IBM Tivoli NetView for z/OS Programming: Pipes - IBM notice

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

REXX Access to VSAM Files<br />

Accessing VSAM Files Using Alternate Keys<br />

The following example code fragments are written in REXX:<br />

v To access the VSAM in<strong>for</strong>mation using alternate keys, per<strong>for</strong>m the VSAM I/O<br />

requests using the PATH cluster. For example:<br />

– VSAMC320.BASE is the base cluster.<br />

– VSAMC320.AIX is the Alternate Index cluster.<br />

– VSAMC320.PATH is the PATH.<br />

v To access the VSAM in<strong>for</strong>mation using the primary keys, ALLOC the BASE<br />

cluster, then attempt VSAM I/O requests using DSIVSMX.<br />

’ALLOC FILE(BASE) DSN(VSAMC320.BASE)’<br />

’DSIVSMX vsmx_func BASE ’<br />

v To access the VSAM in<strong>for</strong>mation using the alternate keys, ALLOC the PATH,<br />

then attempt VSAM I/O requests using DSIVSMX.<br />

’ALLOC FILE(PATH) DSN(VSAMC320.PATH)’<br />

’DSIVSMX vsmx_func PATH <br />

Where vsmx_func is one of the following DSIVSMX functions:<br />

OPEN or CL<strong>OS</strong>E<br />

GET or GETREV<br />

PUT<br />

DEL<br />

INQUIRE<br />

Deleting an Alternate Index File<br />

To delete the base and Alternate Index clusters, delete the base using DSIVSMX<br />

IDCAMS with the DELETE CLUSTER parameters. If you delete the base, the<br />

alternate index and the path will also be deleted.<br />

Using the AUTOTOKE Value Provided by DSIVSMX<br />

An AUTOTOKE value is set by DSIVSMX whenever the VSAM file is opened or<br />

closed. This value is provided in all messages issued by DSIVSMX, and can be<br />

retrieved using the AUTOTOKE() REXX function, or in the output of the DSIVSMX<br />

INQUIRE command. To determine that the VSAM file has not been opened or<br />

closed since the last I/O, do the following:<br />

1. Save the AUTOTOKE value when the data set is opened. The DSI633I message<br />

has the AUTOTOKE() value. Alternately, use DSIVSMX INQUIRE after the<br />

DSIVSMX OPEN to retrieve and save the value from the INQUIRE message<br />

text.<br />

2. Check the AUTOTOKE value after you issue the DSIVSMX commands. If the<br />

value is the same as the saved value, the data set was neither opened nor<br />

closed since the last access.<br />

DSIVSAM: Access to Keyed VSAM Files Defined by <strong>NetView</strong> DSTs<br />

342 <strong>Programming</strong>: <strong>Pipes</strong><br />

The DSIVSAM command processor can access VSAM keyed files that are defined<br />

by <strong>NetView</strong> data services tasks such as DSILOG. This allows <strong>for</strong> implementation of<br />

all kinds of VSAM applications, including end-use application development in<br />

REXX (in conjunction with the pipeline facility) and intensive VSAM diagnostics.<br />

For more in<strong>for</strong>mation about DSIVSAM, see the <strong>NetView</strong> online help.<br />

The DSIVSAM command provides REXX access to any keyed VSAM file on any<br />

data services task.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!