IEFBR14
Encyclopedia
IEFBR14 is an IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 mainframe
Mainframe
Mainframe may refer to either of the following:* Mainframe computer, large and powerful data processing systems* Mainframe Entertainment, a Canadian computer animation and design company* Mainframe , a 1980s Electropop band...

 utility program
IBM mainframe utility programs
IBM mainframe utility programs are supplied with IBM mainframe operating systems such as MVS to carry out various tasks associated with datasets, etc.-History/Common JCL:...

. It runs in all IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 mainframe
Mainframe computer
Mainframes are powerful computers used primarily by corporate and governmental organizations for critical applications, bulk data processing such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing.The term originally referred to the...

 environments derived from OS/360, including z/OS
Z/OS
z/OS is a 64-bit operating system for mainframe computers, produced by IBM. It derives from and is the successor to OS/390, which in turn followed a string of MVS versions.Starting with earliest:*OS/VS2 Release 2 through Release 3.8...

. It is a placeholder whose purpose is to do nothing
NOP
In computer science, NOP or NOOP is an assembly language instruction, sequence of programming language statements, or computer protocol command that effectively does nothing at all....

. As it turned out, over the years, its attempt to do nothing was too concise and would cause problems with related tools, leading to the slight expansion of the program.

Allocation

On OS/360 and derived mainframe systems, most programs never specify files (usually called dataset
Data set (IBM mainframe)
data set , dataset , is a computer file having a record organization. The term pertains to the IBM mainframe operating system line, starting with OS/360, and is still used by its successors, including the current z/OS. Those systems historically preferred this term over a file...

s) directly, but instead reference them indirectly through the Job Control Language
Job Control Language
Job Control Language is a scripting language used on IBM mainframe operating systems to instruct the system on how to run a batch job or start a subsystem....

 (JCL) statements that invoke the programs. These data definition (or "DD") statements can include a "disposition" (DISP=...) parameter that indicates how the file is to be managed — whether a new file is to be created or an old one re-used; whether the file should be deleted upon completion or retained; etc.

IEFBR14 was created because while DD statements can create or delete files easily, they cannot do so without a program to run. The program used in the JCL does not actually need to use the files to cause their creation or deletion — the DD DISP=... specification does all the work. Thus a very simple do-nothing program was needed to fill that role.

IEFBR14 is used to create or delete a PDS (partitioned dataset) or PS (Physical Sequential) from JCL.

Deallocation

A secondary reason to run IEFBR14 was to unmount tapes which had been left mounted from a previous job, perhaps because of an error in that job's JCL or because the job ended in error. In either event, the system operators would often need to demount the tapes, and a started task – DEALLOC – was provided for this purpose.

Simply entering the command
S DEALLOC
at the system console would run the started task, which consisted of just one step
//STEP01 EXEC PGM=IEFBR14

Naming

The "IEF" derives from a convention on mainframe computer
Mainframe computer
Mainframes are powerful computers used primarily by corporate and governmental organizations for critical applications, bulk data processing such as census, industry and consumer statistics, enterprise resource planning, and financial transaction processing.The term originally referred to the...

s that programs supplied by IBM were grouped together by function or creator and that each group shared a three-letter prefix. In OS/360, the first letter was almost always "I", and the programs produced by the job management group (including IEFBR14) all used the prefix "IEF". Other common prefixes included "IEB" for dataset utility programs, "IEH" for system utility programs, and "IEW" for program-linkage and -loading.

As explained below, "BR14" was the essential function of the program, to simply return back to the operating system. This portion of a program name was often mnemonic — for example, IEBUPDTE was the dataset utility (IEB) that applied updates (UPDTE) to source code files, and IEHINITT was the system utility (IEH) that initialized (INIT) magnetic tape labels (T).

As explained further in "Usage," below, the name, "BR14," comes from the IBM assembler-language instruction which by-convention is used to "return from a subroutine
Subroutine
In computer science, a subroutine is a portion of code within a larger program that performs a specific task and is relatively independent of the remaining code....

." Many early users of OS/360 were familiar with IBM Assembler Language and would have understood this "inside joke" at once.

Usage

Example JCL
Job Control Language
Job Control Language is a scripting language used on IBM mainframe operating systems to instruct the system on how to run a batch job or start a subsystem....

 would be :

//IEFBR14 JOB ACCT,'DELETE DATASET',MSGCLASS=J,CLASS=A
//STEP0001 EXEC PGM=IEFBR14
//DELDD DD DSN=xxxxx.yyyyy.zzzzz,
// DISP=(MOD,DELETE,DELETE),UNIT=DASD

To create a Partitioned Data Set:

//TZZZ84R JOB NOTIFY=&SYSUID,MSGCLASS=X
//STEP01 EXEC PGM=IEFBR14
//DD1 DD DSN=TKOL084.DEMO,DISP=(NEW,CATLG,DELETE),
// DCB=(RECFM=FB,LRECL=80,BLKSIZE=80,DSORG=PO),
// SPACE=(TRK,(1,1),RLSE),
// UNIT=SYSDA

Implementation

IEFBR14 consisted initially of a single instruction a "Branch to Register" 14. The mnemonic used in the IBM
IBM
International Business Machines Corporation or IBM is an American multinational technology and consulting corporation headquartered in Armonk, New York, United States. IBM manufactures and sells computer hardware and software, and it offers infrastructure, hosting and consulting services in areas...

 Assembler was BR and hence the name: IEF BR 14.

The linkage convention for OS/360 and its descendants requires that a program be invoked with register 14 containing the address to return control to when complete, and register 15 containing the address at which the called program is loaded into memory; at completion, the program loads a return code in register 15, and then branches to the address contained in register 14.

The original version of the program didn't alter register 15 at all. Since the program was not loaded at address zero (as that address range is reserved for hardware use), the return code was not zero. Hence, a second instruction had to be added to clear the return code so that it would exit with the correct status.

The machine code for the modified program is:

SR R15,R15 put zero into register 15 (return code)
BR R14 branch to the address in register 14 (return to scheduler)

History from the RISKS Digest

Here is an article contributed by John Pershing to the RISKS Digest
RISKS Digest
The RISKS Digest or Forum On Risks to the Public in Computers and Related Systems is an online periodical published since 1985 by the Committee on Computers and Public Policy of the Association for Computing Machinery. The editor is Peter G. Neumann....

 that explains some of the history of IEFBR14. Note that there is an error in the final version of the code as posted—it contains the instruction BR GO, however GO is an instruction label, not a register. The correct code would be B GO. , the code is once again the very brief second version.

From: John Pershing
Date: 25 Jan 88 11:41:42 EST

You can't even necessarily write the null program without encountering
problems...

There is an apocryphal story about the large number of attempts that were
required in order to produce a "correct" version of MVS's null program,
IEFBR14 (this was done back in the days when MVS was still called OS).
As with all MVS programs, IEFBR14 is called using the standard system
calling conventions, and all it has to do is return successfully.

The first version was something like this:

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

First bug: A program indicates its successful completion by zeroing
register 15 before returning; this version of the null program "failed"
every time. Try it again:

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

Much better. However, this caused some-or-other problems with the linkage
editor, since the END statement didn't specify the primary entry point
of the routine. Version three:

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

At least now, the null program was functionally correct. However, dump
analysis was impeded because the program didn't include its own name in
the source code, as an "eyecatcher" (this is a time-honored convention).
Null program, mark four:

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

The next change had something esoteric to do with save-area chaining
conventions -- again, for the sake of conventions and to keep the dump
analysis tools happy.

Note that the "null program" has tripled in size: both in terms of the
number of source statements and in terms of the number of instructions
executed!

See also

  • "This page is intentionally left blank"
    Intentionally blank page
    An intentionally blank page is a page that is devoid of content, and may be unexpected. Such pages may serve purposes ranging from place-holding to space-filling and content separation...

  • /dev/null
    /dev/null
    In Unix-like operating systems, /dev/null or the null device is a special file that discards all data written to it and provides no data to any process that reads from it ....

  • /bin/true

External links

The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK