IEFBR14

from Wikipedia, the free encyclopedia

IEFBR14 is a utility which in IBM - mainframe operating systems, since OS / 360 is used when using JCL should be made to file operations. It is a program that immediately returns control to the caller (RETURN, in assembly language BR 14 for Branch Register ) without taking any action.

The purpose of IEFBR14 is to meet the syntactic requirements of JCL. Each job must consist of at least one step and each step must contain at least one EXEC statement.

A popular application is to delete or create files via JCL:

//LOESCH EXEC PGM=IEFBR14
//DUMMY1   DD DSN=FILE.TO.DELETE,
//            DISP=(MOD,DELETE),
//            SPACE=(TRK,(1,1))
//DUMMY2   DD DSN=EINE.NEUE.DATEI,DISP=(NEW,CATLG),
//            AVGREC=M,SPACE=(100,(10,10))

In the first DD statement, JES is instructed to create a data set FILE.TO.DELETE , if it does not yet exist, and to delete it again immediately after calling IEFBR14. A new file is created permanently in the second DD.

The program consists of two machine instructions (1. set ReturnCode 0; 2. jump back).

implementation

IEFBR14 is a prime example of the fact that even seemingly trivial programs can contain errors. The first deliveries of the program did not set the return value to 0, which prevented querying the condition code in subsequent steps:

IEFBR14 START
        BR 14 ;Return addr in R14 -- branch at it
        END

This error was eliminated by incorporating instruction SR 15.15 ( SR stands for Subtract Registers ):

IEFBR14 START
        SR 15,15 ;Zero out register 15
        BR 14    ;Return addr in R14 -- branch at it
        END

However, this version still had a problem because the END statement did not refer to the entry point . This has been fixed with the third version of the program:

IEFBR14 START
        SR 15,15    ;Zero out register 15
        BR 14       ;Return addr in R14 -- branch at it
        END IEFBR14

Further modifications have been made to simplify the analysis of dumps :

 IEFBR14 START
         USING IEFBR14,15 ;Establish addressability
         B  GO            ;Skip over our name
         DC AL1(L'ID)     ;Length of name
 ID      DC C'IEFBR14'    ;Name itself
         DS 0H            ;Force alignment
 GO      SR 15,15         ;Zero out register 15
         BR 14            ;Return addr in R14 -- branch at it
         END IEFBR14

See also

Individual evidence

  1. ^ The IEFBR14 utility: Do (almost) nothing. In: Data and storage management on z / OS. IBM Corporation , 1990, accessed August 3, 2018 .
  2. ^ John Pershing: Safe programming languages. In: The Risks Digest, Volume 6, Issue January 14-25, 1988, accessed August 3, 2018 .