You associate a serial record (a record definition that carries a SerialRecord stereotype) with a particular file by using a ResourceAssociation part during generation. This process determines whether EGL uses the record for VSAM, GSAM, or IMS message queue access. For more information, see the EGL Generation Guide.
EGL programs that run in the IMS BMP or z/OS batch environments can implement serial files as GSAM (generalized sequential access method) files. This provides a very basic sort of database capability on these systems. You can use the add, get next, and close I/O statements for serial files that you implement as GSAM files.
Programs that run in IMS/VS implement serial files as IMS message queues. Programs that run as IMS BMP programs can also implement serial files as message queues. You can use the add and get next I/O statements as well as close for output files. If you select IMS/VS or IMS BMP as the target runtime environment, you can define serial or print files as being associated with a message queue. You must associate all serial files and print files with message queues for IMS/VS. You can associate only a single input file with the message queue.
When you associate a serial record with a message queue, define the program data only. The generated COBOL program adds the IMS message header (length, ZZ, and transaction code) for an add statement and removes it for a get next statement.
After a DL/I call that involves either the message queue or GSAM, the dliVar fields are not updated. These fields are updated only for functions that access DL/I segment records. This allows a program that is written for a CICS® transient data queue or an OS/VS serial file to run consistently when the file is changed to a message queue or GSAM database in an IMS environment. Check the I/O error values to determine if endOfFile, noRecordFound, or other error occurred on the serial file. If you need more detailed information from the PCB, use the field names in the IO_PCBRecord or the ALT_PCBRecord.
Consider a situation in which your PSB variable (named myPSB) declares an ALT_PCBRecord named myAltPCB, and you used myAltPCB as the PCB name in your resource association. To reference the DL/I status code after an add statement, use myPSB.myAltPCB.statusCode.
| EGL I/O error code | IMS Messsage Queue status code | Severity |
|---|---|---|
| endOfFile | QC | Soft |
| noRecordFound | QD | Soft |
| ioError | any non-blank status code | Hard or soft |
| hardIOError | non-blank other than QC, QD, CE, CF, CG, CI, CJ, CK, CL | Hard |
| EGL I/O error code | GSAM status code | Severity |
| endOfFile | GB | Soft |
| ioError | any non-blank status code | Hard or soft |
| hardIOError | non-blank other than GB | Hard |