Using IMS functions from EGL programs

You can use IMS™ functions in EGL programs.
The following table lists the IMS functions that you can use in EGL programs. The table also summarizes how to use these functions.
Table 1. IMS functions and how to represent them in EGL
IMS Function EGL Function Comments
Type of program
IMS conversational
  • Main Text UI program using converse statement
  • Program property: segmented = YES
  • Build descriptor option: spaSize > 0
workDBType build descriptor option specifies whether to use DL/I or DB2® to save data across the converse statement
IMS nonconversational or message-driven fast path (option 1)
  • Main Text UI program using converse statement
  • Program property: segmented = YES
  • Build descriptor option: spaSize = 0
  • workDBType build descriptor option specifies whether to use DL/I or DB2 to save data across the converse statement
  • imsFastPath build descriptor option set to YES restricts statements and EGL error processing to what is permitted in an IMS Fast Path program
IMS nonconversational or message-driven fast path (option 2)
  • Main textUI program using show statement
  • Program property: inputForm is set
  • Build descriptor option: spaSize > 0
  • workDBType build descriptor option specifies whether to use DL/I or DB2 to pass the record on the show statement
  • imsFastPath build descriptor option set to YES restricts statements and EGL error processing to what is permitted in an IMS Fast Path program
IMS nonconversational or message-driven fast path (option 3, no text forms) Main basic program that loops to do get next for a serial record that is associated with the I/O PCB and generated for IMS/VS imsFastPath build descriptor option set to YES restricts statements and EGL error processing to what is permitted in an IMS Fast Path program
Transaction-oriented BMP Main basic program that loops to do get next for a serial record that is associated with the I/O PCB and generated for IMS BMP  
Batch-oriented BMP Main basic program that is associated with the I/O PCB and generated for IMS BMP, but does not use a serial record  
DL/I Batch Main basic program that uses DL/I and is generated for z/OS® Batch  
Normal z/OS Batch Main basic program that uses DL/I and is generated for z/OS Batch  
Terminal and printer support
MFS Source FormGroup with text and print forms EGL generates MFS source for the FormGroup
Communication with the terminal
  • converse statement for input/output
  • show statement with inputForm property in next program
 
Print output to terminal printer
  • print statement
  • Resource association for printer set to smsgq and pcbName specified
 
Dynamic printer support set converseVar.printerAssociation to change printer association dynamically at runtime  
/FORMAT modname formName
  • The modname is the 6-character FormGroup or alias concatenated with the letter O
  • The formName is the 8-character text form name or alias
  • The program must set the inputForm property to the formName that is used in the /FORMAT command
 
Physical and logical paging Not supported EGL forms do not support the definition of physical or logical pages
SDF II to produce the MFS source Not supported EGL generation requires knowledge of the edit order and special control fields
SQL database support
DB2 database definition and access SQLRecord definition and SQL I/O statements EGL creates default SQL statements. Modify the default using the #sql directive.
DL/I database support
PSB to use psb property of the @dli complex property identifies the program variable name for the EGL PSBRecord EGL PSB is a subset of information in the IMS PSB
DL/I database definition and access PSBRecord definition, DLISegment definition, and DL/I I/O statements. The usingPCB keyword on I/O statement identifies which PCB to use EGL creates default SSAs. Modify the default using the #dli directive
DL/I fast path database definition and access
  • Same as for DL/I database definition and access
  • Use dliLib.AIBTDLI(), dliLib.EGLTDLI(), or vgLib.VGTDLI() for FLD and POS calls
  • dliLib.AIBTDLI() is preferred for new programs
EGL permits the 2-character command codes if you are using the #dli directive
IMS message queue
  • SerialRecord definition
  • Use add and close statements to write record associated with alternate TP PCB. Alternatively, use vgLib.startTransaction() .
  • Use get next statement to read record associated with I/O PCB.
  • Set recordName.resourceAssociation to dynamically alter the output queue name
Use a get next statement in an EGL basic program for a serial record that is associated with the I/O PCB. The record might have been inserted by an add statement or vgLib.startTransaction() function in a previous program. Not supported for z/OS Batch.
GSAM file
  • SerialRecord definition
  • Use add, get next, and close statements to access records associated with a GSAM file.
Supported only for IMS BMP or z/OS Batch
File Support
Sequential file support Serial record with resource association for the fileName set to seq or seqrs
  • Use seq if EGL uses COBOL file I/O
  • Use seqrs if EGL uses Rational® COBOL Runtime for file I/O
  • Supported only for IMS BMP or z/OS Batch
VSAM file support Serial, indexed, or relative records with resource association for the fileName set to vsam or vsamrs
  • Use vsam if EGL uses COBOL file I/O
  • Use vsamrs if EGL uses Rational COBOL Runtime for file I/O
  • Supported only for IMS BMP or z/OS Batch
Dynamically change file name at runtime recordName.resourceAssociation Requires the use of seqrs or vsamrs
COBOL DISPLAY statement
  • sysLib.writeStdOut()
  • sysLib.writeStdErr()
The output destination is the DDNAME that you specify in the COBOL compiler option OUTDD. By default, the output is written to the DDNAME SYSOUT in the job that starts the message region for IMS/VS or the JCL that runs the IMS BMP or z/OS Batch job.
IMS message switch
Immediate program-to-program message switch
  • A transfer to transaction passing a record to another EGL program or a non-EGL program
  • If the spaSize build descriptor option is set to 0, it is a nonconversational message switch and the record is passed in the work database
  • If the spaSize build descriptor option is > 0, it is a conversational message switch and the record is passed in the SPA
  • Requires the transaction name and the PSB name to change because there is a new load module and the PSB must match the load module name.
  • The FormGroup can be the same or different for the two programs.
Deferred program-to-program message switch (Method 1)
  • The first program ends with a show statement. The next program must set the inputForm to the same text form that was specified on the show statement.
  • If the spaSize build descriptor option is set to 0, it is a nonconversational message switch and the record is passed in the work database.
  • If the spaSize build descriptor option is > 0, it is a conversational message switch and the record is passed in the SPA.
  • Requires the transaction name and the PSB name to change because there is a new load module and the PSB must match the load module name.
  • The FormGroup must be the same for the two programs.
Deferred program-to-program message switch (Method 2) The program uses a converse statement and sets sysVar.transactionID to a new transaction code before the converse statement Permits the transaction name change within the same EGL program. The same PSB and FormGroup must be used by both transactions, because the program does not change.
Miscellaneous
Basic checkpoint sysLib.commit() system function  
Symbolic checkpoint dliLib.AIBTDLI(), dliLib.EGLTDLI(), or vgLib.VGTDLI() See:
Restart (XRST call) dliLib.AIBTDLI(), dliLib.EGLTDLI(), or vgLib.VGTDLI() See:
Rollback sysLib.rollback() system function  
Log call sysLib.audit() system function See audit()
PURG call for an alternate TP PCB Use close statement for the serial record or print form that is associated with an output IMS message queue  
Asynchronous processing vgLib.startTransaction() See startTransaction()

Feedback