MODAL Command - IBM Mainframe

Every AMS command issues a condition code. If multiple commands are being executed successively, there might be a requirement to execute or bypass certain commands based on the success or failure of a previous command. This is accomplished by testing a condition code through the modal commands of AMS. he normal condition codes returned by AMS commands are:

  • 0 - The function was executed successfully
  • 4 - A problem was encountered while executing the function. For example, the system was unable to locate an entry in a LISTCAT command
  • 8 - The requested function was executed, but major specifics were unavoidably bypassed. For example, the object of DELETE command could not be found
  • 12 - The requested command could not be performed because of a logical error. For example, certain required parameters were missing
  • 16 - A severe error occurred causing the remainder of the command stream to be bypassed. For example, a SYSPRINT DD statement was missing

LASTCC contains the condition code of the last command executed, while MAXCC is used to test the highest condition code from any of the previous command executions within the same job step.

The relational operators for comparing LASTCC and MAXCC using IF-THEN-ELSE statements are EQ, NE, GT, LT, GE, LE etc. For example you could say,


The SET command is used to reset a previously set value of LASTCC or MAXCC. By setting LASTCC or MAXCC to 16, processing can be terminated. For example,






Additional Features of VSAM

There are a few features of VSAM that are not available in batch COBOL worth knowing like

  • Alternate Indexed for ESDS - CICS will allow you to process AIX on an ESDS
  • Alternate Index as a data set - This cannot be done in batch COBOL
  • Read previous processing - Only CICS supports this feature
  • Skip sequential processing - This processing is when you sequentially browse through a data set by skipping records in between. This processing is sometimes much faster and useful but only CICS supports it.
  • Accessing a record by RBA - Accessing an ESDS or KSDS record by its Relative Byte Address is available in CICS only. Also, there are a few JCL restrictions imposed on VSAM files.
  • DCB not applicable to VSAM - DCB only describes non-VSAM data sets
  • DISP parameter restrictions - Coding DELETE on DISP parameter does not delete a VSAM file. This can be accomplished through the AMS command DELETE. Similarly for CATLG and UNCATLG parameters because VSAM data sets are cataloged and uncataloged through AMS commands. Always code DISP as OLD or SHR for VSAM data sets
  • SPACE parameter has no effect on VSAM allocation - SPACE has to be specified in the AMS command.

All rights reserved © 2020 Wisdom IT Services India Pvt. Ltd Protection Status

IBM Mainframe Topics