• Rajesh A R

F1 for Mainframe

F1 for Mainframe

Monthly Archives: April 2009

Conditional processing

15 Wednesday Apr 2009

Posted by rajeshar in JCL

≈ Leave a comment

Tags

COND, conditional processing, JCL, mainframe

OS expects programs to set a return code which specifies how successful the program thought it was. The most common conventional values are:

  • 0 = all OK
  • 4 = minor errors or problems
  • 8 = significant errors or problems
  • 12 = major errors or problems, the results (e.g. files or reports produced) should not be trusted.
  • 16 = very serious problems, do not use the results!

OS JCL refers to the return code as COND (“condition code”), and can use it to decide whether to run subsequent steps. However, unlike most modern programming languages, conditional steps in OS JCL are not executed if the specified condition is true—thus giving rise to the mnemonic, “If it’s true, pass on through [without running the code].” To complicate matters further, the condition can only be specified after the step to which it refers. For example:

//MYJOB JOB ………..

//STEP01 EXEC PGM=PROG01

….

//STEP02 EXEC PGM=PROG02,COND=(4,GT,STEP01)

….

//STEP03 EXEC PGM=PROG03,COND=(8,LE)

….

//STEP04 EXEC PGM=PROG04,COND=(ONLY,STEP01)

….

//STEP05 EXEC PGM=PROG05,COND=(EVEN,STEP03)

….

means:

  1. Run STEP01, and collect its return code.
  2. Run STEP02 unless the number 4 is greater than STEP01’s return code.
  3. Run STEP03 unless the number 8 is less than or equal to any previous return code.
  4. Run STEP04 only if STEP01 abnormally ended.
  5. Run STEP05, even if STEP03 abnormally ended.

This translates to the following pseudocode:

run STEP01

 

if STEP01’s return code is greater than 4 then

    run STEP02

end if

 

if any previous return code is less than or equal to 8 then

    run STEP03

end if

 

if STEP01 abnormally ended then

    run STEP04

end if

 

if STEP03 abnormally ended then

    run STEP05

else

    run STEP05

end if

If you would like to Earn Free Stocks, Credit card Points and Bank account Bonuses, Please visit My Finance Blog

You may also like to look at:

Important SQL CODES and ABEND CODES
SORT JOIN – TO JOIN TWO FILES BASED ON A KEY
KNOW YOUR MAINFRAME
REXX – INITIAL SETUP
CA7 – LJOB, LQ, LRLOG
CA7 – ASSIGN PF KEYS TO PERFORM YOUR COMMANDS
CA7 – LEAD TIME CONCEPT (LOOK BACK ISSUE)
CA7 Commonly used Commands
Mainframe Manuals/References/Guides/Documents Download Links
HEX Value 41 – Confused as SPACE (Hex value of 40)
EVER WONDERED WHAT DOES Z MEAN IN Z/OS
Search for a string that is in mixed case inside a PDS
S0C7 ISSUE – FIND THE INVALID (FAULT) DATA
HRECALL – MASS RECALL IN BATCH MODE
Nice Article to answer the myths on Mainframes
MAINFRAME – PS DATASET GETTING NUMBER AT END AUTOMATICALLY
MAINFRAME – GRANT and REVOKE Dataset Access
File Status Key Overview
TSO/E COMMANDS
SDSF; Status panel (ST) Columns
ABEND CODES
Glossary of z/OS terms and abbreviations
AMODE and RMODE
IMS INTERVIEW QUESTIONS
SDSF TIPS
NDM – FASTER MODE
FILEMAXX
BATCH PIPES
What is a Catalog
Conditional processing
Advertisement

Rate this:

← Older posts

Subscribe

  • Entries (RSS)
  • Comments (RSS)

Archives

  • November 2020
  • July 2020
  • February 2020
  • January 2020
  • September 2019
  • August 2019
  • October 2018
  • April 2018
  • March 2018
  • December 2017
  • October 2017
  • August 2017
  • July 2017
  • June 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • May 2016
  • March 2016
  • February 2016
  • January 2016
  • May 2015
  • September 2013
  • August 2013
  • July 2013
  • June 2013
  • May 2013
  • January 2013
  • December 2012
  • November 2012
  • April 2012
  • March 2012
  • February 2012
  • January 2012
  • April 2011
  • March 2011
  • August 2009
  • June 2009
  • April 2009

Categories

  • Azure
  • CA7
  • CICS
  • COBOL
    • Keywords
  • DB2
  • EASYTRIEVE
  • FILEAID
  • FILEMAXX
  • IMS
  • ISPF
  • JCL
  • KNOW YOUR MAINFRAME
  • Mainframe Migration
  • MAINFRAMES
  • Others
  • REXX
  • SDSF
  • SORT
  • Training
  • TSQL
  • VSAM

Meta

  • Register
  • Log in

Blog at WordPress.com.

  • Follow Following
    • F1 for Mainframe
    • Join 88 other followers
    • Already have a WordPress.com account? Log in now.
    • F1 for Mainframe
    • Customize
    • Follow Following
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar