Tuesday, October 10, 2006

Review topic: CICS file types; the RIDFLD option

CICS transactions reference data either through a commercial database package (DB2, IMS, Adadbas, IDMS, Datacom DB) or through VSAM itself. Some commercial packages, like Vantage for life insurance and annuities (or the older and much less successful VLN) access VSAM through their own proprietary I/O modules, with which application programmers in a shop using these packages must become very proficient.

Nevertheless, recruiters for mainframe jobs always expect proficiency in VSAM.

A good reference book for VSAM programming is a red paperback, Practical VSAM for Roday’s Programmers, by James G. Janossy and Richard E. Guzik, published by Wiley in 1988, ISBN 0-471-85107-8. The book gives a lot of historical background and “philosophy” behind VSAM in connection with both the old DOS and MVS as it developed throughout the 1970s and 1980s.

Technical interviewers are likely to expect a body of technical knowledge on how to access various VSAM formats from CICS transactions. In many shops, however, programmers often use only a portion of the technical knowledge that recruiters and certification tests may expect the applicant to demonstrate. This is particularly true of maintenance programmers.

For example, consider VSAM formats. By far the most common is the Key Sequenced dataset, the KSDS. But older formats include the Entry Sequenced Data Set, essentially a sequential file, and the Relative Record Data Set, RRDS, related to the old BDAM. With an ESDS, the Delete command cannot be used, and neither can the START, since an ESDS can only be accessed sequentially from the beginning of the file. These are available for the RRDS.

An important concept will be the RIDFLD, the “record ID field.” Applicants may need to be familiar with the RRN (relative record number) or RBS (relative byte address) options, that may occur on some CICS commands, in connection with the RIDFLD.

When RRN is specified, the RIDFLD specifies a relative record number, and the file must be a RRDS.

When RBA is specified, the file is an ESDS, and the RIDFLD is a relative-byte address.

With the KSDS, however (again, by far the most common), the RIDFLD must give the name of the field that contains the key value for the record (it could be an alternate index).

When you want to read a KSDS sequentially, you must use a STARTBR command (like the COBOL START, which is optional in batch COBOL if you want to start at the “beginning” of the file.)

No comments: