Lenguaje de control operativo - Operational Control Language
Operational Control Language (OCL) es el lenguaje de control de la familia de miniordenadores IBM System / 32 , System / 34 y System / 36 . Es compatible con el entorno System / 36 de IBM i por motivos de compatibilidad con versiones anteriores. Es similar a los lenguajes de control más antiguos JCL ( System / 370 ) y System / 3 , y no está relacionado con el lenguaje de control posterior ( System / 38 e IBM AS / 400 ) y REXX (AS / 400).
Visión general
En IBM S / 32, S / 34 y S / 36, las sentencias OCL se utilizan para cargar directamente programas de usuario o del sistema en la memoria, asignarles recursos del sistema y transferirles el control del sistema en un proceso llamado ejecución. El hecho de que un programa esté almacenado en la unidad de disco de una computadora no hace que la computadora procese o ejecute el programa en sí mismo.
Las declaraciones OCL se pueden ingresar manualmente desde el teclado, pero generalmente se almacenan como un miembro de procedimiento S / 32, S / 34 o S / 36. Un miembro de procedimiento es un miembro libremente editable dentro de una biblioteca, es un archivo fuente. En las S / 32, S / 34 y S / 36, los procedimientos no se compilan, se interpretan .
Ejemplo
Las declaraciones OCL suelen comenzar con dos barras y al menos un carácter de espacio. Aquí hay un ejemplo de un procedimiento almacenado en un System / 36 como miembro PROC1:
** Procedure PROC1 Optional documentation
**
** Written by Joe User 2006-05-29
**
**
// * 'PROC1 procedure is running'
// * ' '
// IFF ACTIVE-'PROC2,PROC3' GOTO OKAY
** IFF means 'if false'
** ACTIVE-'name1,name2' means true
** if at least one of the listed programs is currently running
** GOTO xxx means skip to the statement
** that has a TAG xxx and resume processing
// PAUSE 'Cannot continue because other Payroll is running'
** Halts execution with a message
// CANCEL Stops execution of this procedure
// TAG OKAY
// IFF DATAF1-PFILE1 IFF DATAF1-PFILE2 GOTO NODELT
// * 'Caution, Pay Data Exists' Displays information on terminal
// * ' '
// * '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
** This program requires and processes, consumes,
** succeeding statements as data up until an END statement
// IF DATAF1-PFILE1 SCRATCH UNIT-F1,LABEL-PFILE1
** Conditionally deletes an existing disk file
// IF DATAF1-PFILE2 SCRATCH UNIT-F1,LABEL-PFILE2
// END
**
// TAG NODELT
// LOAD PR101 PR101 could be an RPG or COBOL 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 and allocated
** 100 records are assigned to PFILE1
** when all are used, the system tries to extend it by another 100
** each time it fills.
// RUN
** END statement is only necessary
** for those programs enabled
** to process any following statements as data
** Such data does not need to be formatted like OCL
// SWITCH 1XX0XXXX Causes flags U1 through U8 to be SETON (1), OFF (0), or left as previously set (X)
**
// LOCAL OFFSET-1,DATA-'PROC1' Places PROC1 in the Local Data Area (LDA)
// LOCAL OFFSET-101,DATA-'?USER?' Substitutes the operator's User ID
** LDA is accessed via a data structure, UDS within an RPG program
** LDA and User switches (flags) remain available to succeeding programs
** until set otherwise
** Called sub-procedure members and loaded program's source code needs to be examined
** as to whether or not the LDA and User switches are actually read or altered
// LOAD PR102
// FILE NAME-PAYMAST,DISP-SHR DISP-SHR means the file is shared, versus exclusive access
** Other programs can use PAYMAST at the same time
// FILE NAME-PFILE,LABEL-PFILE1 NAME/LABEL is used when the RPG file name reference
** and the actual disk file label are different
// RUN
// RETURN Return to the calling procedure, otherwise end-of-job
Este miembro de procedimiento incorpora una variedad de declaraciones de OCL, también expresiones de control de procedimiento (PCE), recursos, que en su mayoría se asignan archivos, y varios pasos de trabajo, es decir, se ejecutan programas.
Los comentarios se representan con un asterisco en la columna 1 y, de lo contrario, en formato libre. O puede colocarse después del final lógico de una declaración, si no hay un indicador de continuación de la declaración en la siguiente línea, como una coma al final.
enlaces externos
IBM mantiene manuales de forma gratuita en línea y descargables, incluido OCL 36.
- "System / 36 Environment Programming" (1995) v6r1
- "System / 36 Environment Reference" (1995) v6r1