Jump to content

Operational Control Language

From Alfawiki
Operational Control Language (OCL)
Company typeCommand language
IndustryComputer programming, Operating systems
ProductsCommand language for IBM System/3, System/32, System/34, System/36

Operational Control Language (OCL) serves as the command language for IBM's minicomputers, specifically the System/3, System/32, System/34, and System/36 models. It continues to be supported within the System/36 Environment on IBM i systems to maintain legacy compatibility. Although OCL shares similarities with the older Job Control Language (JCL) used on the System/370, it is distinct and unrelated to the subsequent Control Language found on System/38 and AS/400 platforms, as well as to REXX.

Overview

OCL commands are responsible for loading both user and system programs into memory, assigning necessary system resources, and initiating execution control. Programs residing on disk require explicit activation through OCL; they do not run automatically.

While it is possible to input OCL commands interactively, they are most commonly saved as procedure members—source files stored within a library that can be edited. On systems such as the S/32, S/34, and S/36, these procedures are interpreted during runtime rather than being compiled.

Example

Typically, OCL statements begin with a double slash followed by a space. Below is an illustration of a procedure named PROC1 saved on a System/36: <syntaxhighlight lang="text">

    • Procedure PROC1 Optional documentation
    • Written by Joe User 2006-05-29

// * 'PROC1 procedure is running' // IFF ACTIVE-'PROC2,PROC3' GOTO OKAY // PAUSE 'Cannot continue because other Payroll is running' // CANCEL // TAG OKAY // IFF DATAF1-PFILE1 IFF DATAF1-PFILE2 GOTO NODELT // * 'Caution, Pay Data Exists' // * 'Press 1 to continue and DELETE existing files' // IFF '1'=?1R? CANCEL // LOAD $DELET // RUN // IF DATAF1-PFILE1 SCRATCH UNIT-F1,LABEL-PFILE1 // IF DATAF1-PFILE2 SCRATCH UNIT-F1,LABEL-PFILE2 // END // // TAG NODELT // LOAD PR101 // FILE NAME-PAYMAST,DISP-SHR // FILE NAME-PFILE1,DISP-NEW,RECORDS-100,EXTEND-100 // RUN // SWITCH 1XX0XXXX // // LOCAL OFFSET-1,DATA-'PROC1' // LOCAL OFFSET-101,DATA-'?USER?' // LOAD PR102 // FILE NAME-PAYMAST,DISP-SHR // FILE NAME-PFILE,LABEL-PFILE1 // RUN // RETURN </syntaxhighlight> This sample highlights how OCL handles resource allocation—primarily file management—executes multiple programs sequentially, and governs process flow using procedure control expressions (PCE). Comments are indicated by an asterisk placed in the first column or following statements without a continuation marker.

The procedure demonstrates management of shared versus exclusive file access, conditional branching based on active processes or data availability, user input handling through parameters, and placement of local data accessible to later programs in the sequence.

External links

IBM offers downloadable manuals at no cost for the System/36 environment that include comprehensive information about OCL 36: