Operational Control Language
Encyclopedia
Operational Control Language (OCL) is the control language of 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...

 System/34
System/34
The IBM System/34 was a minicomputer marketed by IBM beginning in 1978. It was a multi-user, multi-tasking successor to the single-user System/32. Most notably, it included two very different processors, one based on System/32 and the second based on older System/3. Like the System/32 and the...

 and System/36
System/36
The IBM System/36 was a minicomputer marketed by IBM from 1983 to 2000. It was a multi-user, multi-tasking successor to the System/34. Like the System/34 and the older System/32, the System/36 was primarily programmed in the RPG II language...

 minicomputer
Minicomputer
A minicomputer is a class of multi-user computers that lies in the middle range of the computing spectrum, in between the largest multi-user systems and the smallest single-user systems...

 family. Other control languages include CL (System/38
System/38
The System/38 was a midrange computer server platform manufactured and sold by the IBM Corporation. The system offered a number of innovative features, and was the brainchild of IBM engineer Dr. Frank Soltis...

 and AS/400), JCL (System/370
System/370
The IBM System/370 was a model range of IBM mainframes announced on June 30, 1970 as the successors to the System/360 family. The series maintained backward compatibility with the S/360, allowing an easy migration path for customers; this, plus improved performance, were the dominant themes of the...

), and REXX (AS/400). The facility of DOS to use batch files is also control language.

On the IBM S/34 and S/36, OCL statements are used to directly load user or system programs into memory, assign system resources to them, and transfer system control to them in a process called execution. The fact that a program is on a computer's disk drive does not in itself cause the computer to begin working on the program.

OCL statements can be entered from the keyboard, but are generally stored in a S/34-S/36 procedure member. A procedure member is a freely editable member within a library, not dissimilar from a source member. On the S/34-S/36, procedures are not compiled.

OCL statements begin with two slashes and a space. Here's an example of a short procedure stored on a System/36 as PROC1:

** Procedure PROC1
**
** Written by Joe User 2006-05-29
**
**
// * 'PROC1 procedure is running'
// * ' '
// IFF ACTIVE-'PROC2,PROC3' GOTO OKAY
** IFF means 'if false'
** ACTIVE-'nnn,nnn2' means at least one of the listed programs is currently running
** GOTO xxx means skip to the statement that says TAG xxx and resume processing
// PAUSE ' Cannot continue because other Payroll is running'
// CANCEL stops execution of this procedure
// TAG OKAY
// IFF DATAF1-PFILE1 IFF DATAF1-PFILE2 GOTO NODELT
// * ' Caution, Pay Data Exists' displays info on CRT
// * ' '
// * ' Press 1 to continue and DELETE existing files'
// IFF '1'=?1R? CANCEL A parameter is indicated by question marks surrounding a number
** Using 1R between question marks indicates that the parameter is required and processing
** waits for user input. CANCEL means immediately go to end of job.
// LOAD $DELET $DELET is used to delete files
// RUN
// IF DATAF1-PFILE1 SCRATCH UNIT-F1,LABEL-PFILE1 deletes a disk file
// IF DATAF1-PFILE2 SCRATCH UNIT-F1,LABEL-PFILE2
// END END returns control from a system program
// LOAD PR101 PR101 is the sample RPG program
// FILE NAME-PAYMAST,DISP-SHR PAYMAST is the payroll master file
// FILE NAME-PFILE1,DISP-NEW,RECORDS-100,EXTEND-100 A new file PFILE1 is created
** 100 records are assigned to PFILE1 - if full, the system tries to extend it by another 100
** each time it fills.
// RUN
** It's not necessary or valid to put an END statement after most user programs
// SWITCH 1XXXXXXX Causes U1 to be SETON in the RPG program
// LOCAL OFFSET-1,DATA-'PROC1' Places PROC1 in the Local Data Area
// LOCAL OFFSET-101,DATA-'?USER?' Substitutes the operator's User ID
** LDA becomes the external data structure (UDS) in an RPG program
// LOAD PR102
// FILE NAME-PAYMAST,DISP-SHR DISP-SHR means the file is shared
** Other programs can use PAYMAST at the same time
// FILE NAME-PFILE,LABEL-PFILE1
** NAME/LABEL is used when the RPG disk file and the actual disk file names are different.
// RUN
// RETURN Return means go to end-of-job

In this short procedure, a number of OCL statements and procedure control expressions (PCE) are used. Comments are represented by an asterisk in column 1, or can be placed after the end of a statement.
The source of this article is wikipedia, the free encyclopedia.  The text of this article is licensed under the GFDL.
 
x
OK