Search This Blog

Wednesday, 5 November 2014

Job control language

In the early days of computing, data processing generally had to be done in batches. By modern standards the memory capacity of the computer was very limited (see mainframe). Typically, programs had to be loaded one at a time from punch cards or tape. The data to be processed by each pro-gram also had to be made available by being mounted on a tape drive or inserted as a stack of cards into the card reader (see punched cards and paper tape). After the program ran, its output would consist of more data cards or tape, which might in turn be used as input for the next program.

For example, a series of programs might be used to read employee time cards and calculate the payments due after various items of withholding. That data might in turn be input into a program to print the payroll checks and another program to print a summary report.

In order for all this to work, the computer’s operating system must be told which files (on which devices) are to be used by the program, the memory partition in which the program is to be run, the device to which output will be written or saved, and so on. This is done by giving the computer instructions in job control language (JCL). (In the punch card days, the JCL cards were put at the top of the deck before the cards with the instructions for the pro-gram itself.)

For a simple example, we will use some elements of IBM MVS JCL. In this version of job control language the general form for all statements is

//name operation operands comment

where name is a label that can be used to reference the statement from elsewhere, operation indicates one of a set of defined JCL language commands, operand is a series of values to be passed to the system, and comment is optional explanatory text.

The three basic types of statement found in most job control languages are JOB, EXEC, and DD. The JOB state-ment identifies the job and the user running it and sets up some parameters to specify the handling of the job.

//JOB,CLASSPROJ1,GROUP=J999996,USER=P999995,

//PASSWORD=?

This statement passes information to the system that identifies the job name, group as assigned by the facility, and user ID. The PASSWORD parameter is given a question mark to indicate that it will be prompted for at the terminal. Other parameters can be used to specify such matters as the amount of computer time to be allocated to the job and the way in which any error messages will be displayed.

The EXEC statement identifies the program to be run. Some systems can also have a library of stored JCL proce-dures that can also be specified in the EXEC statement. This means that frequently run jobs can be run without having to specify all the details each time. An example EXEC statement is:

//Datasort EXEC BINSORT,BUFFER=256K

Here the statement is labeled Datasort so it can be refer-enced from another part of the program. The procedure to be executed is named BINSORT, and it is passed a parameter called BUFFER with a value of 256K (presumably this is the amount of memory to be used to hold data to be sorted).

One or more DD (Data Definition) statements are used to specify sets (sources) of data to be used by the program. This includes a specification of the type (such as disk or tape) and format of the data. It also includes instructions specifying what is to happen to the data set. For example, the data set might be old (existing) or newly created by the program. It may also be temporary (possibly to be passed on to the next program) or permanent (“cataloged”).

Since interactive, multitasking operating systems such as Windows and UNIX are now the norm in most comput-ing, JCL is used less frequently today. However, it is still needed in large computer installations running operating systems such as IBM MVS (see mainframe) and for some batch processing of scientific or statistical programs (such as in FORTRAN or SAS).

No comments:

Post a Comment