Programming Languages

COBOL


Common Business-Oriented Language (COBOL) is a programming language similar to English that is widely used to develop business-oriented applications in the area of commercial data processing. COBOL is a high-level language. COBOL code must be converted into machine code using a compiler. Run the program source through a compiler. The compiler first checks for any syntax errors and then converts it into machine language. The compiler creates a output file which is known as load module. This output file contains executable code in the form of 0s and 1s. COBOL can handle huge data processing.

COBOL program consists of four divisions:

  1. Identification Division: It is the first and only mandatory division of every COBOL program. The programmer and the compiler use this division to identify the program.
  2. Environment Division: Environment division is used to specify input and output files to the program. It has two sections, configuration and Input-Output sections. Configuration section provides information about the system on which the program is written and executed. Input-Output section provides information about the files to be used in the program.
  3. Data Division: Data division is used to define the variables used in the program. It has 4 sections, File section, Working-Storage section, Local-Storage section and Linkage section.
  4. Procedure Division: Procedure division is used to include the logic of the program. It consists of executable statements using variables defined in the data division. In this division, paragraph and section names are user-defined.

JCL


Job Control Language (JCL) is the command language of Multiple Virtual Storage (MVS), which is the commonly used Operating System in the IBM Mainframe computers. JCL identifies the program to be executed, the inputs that are required and location of the input/output and informs the Operating System through Job control Statements. JCL is used for submitting a program for execution in batch mode. JCL is used in a mainframe environment to act as a communication between a program (Example: COBOL, Assembler or PL/I) and the operating system.

A job is a unit of work which can be made up of many job steps. Each job step is specified in a Job Control Language (JCL) through a set of Job Control Statements. The Operating System uses Job Entry System (JES) to receive jobs into the Operating System, to schedule them for processing and to control the output. Job processing goes through following series of steps:

  1. Job Submission: Submitting the JCL to JES
  2. Job Conversion: The JCL along with the PROC is converted into an interpreted text to be understood by JES and stored into a dataset, which we call as SPOOL.
  3. Job Queuing: JES decides the priority of the job based on CLASS and PRTY parameters in the JOB statement. The JCL errors are checked and the job is scheduled into the job queue if there are no errors.
  4. Job Execution: When the job reaches its highest priority, it is taken up for execution from the job queue. The JCL is read from the SPOOL, the program is executed and the output is redirected to the corresponding output destination as specified in the JCL.
  5. Purging: When the job is complete, the allocated resources and the JES SPOOL space is released. In order to store the job log, we need to copy the job log to another dataset before it is released from the SPOOL.

A JCL has below types of statements:

  • JOB Statement: Specifies the information required for SPOOLing of the job such as job id, priority of execution, user-id to be notified upon completion of the job.
  • Command Statement: Any statement starting with //* is considered as a comment statement and is not executed by JES.
  • EXEC Statement: Specifies the PROC/Program to be executed e.g. SORT program.
  • Input DD Statement: Specifies the type of input to be passed to the program.
  • Input DD Statement: Specifies the type of input to be passed to the program.
  • /*: This statement marks the end of in stream data.

REXX


REXX (Restructured Extended Executor) is designed to be a scripting language. Its goal is to make scripting as easy, fast, reliable, and error-free as possible.

REXX as a programming language has the following key features:

  • The ability to route commands to multiple environments
  • The ability to support functions, procedures and commands associated with a specific invoking environment.
  • A built-in stack, with the ability to interoperate with the host stack if there is one.
  • Small instruction set containing just two dozen instructions.
  • Freeform syntax
  • Case-insensitive tokens, including variable names.
  • Character string basis.
  • Dynamic data typing, no declarations.
  • No reserved keywords, except in local context.
  • No include file facilities.
  • Arbitrary numerical precision.
  • Decimal arithmetic, floating-point.
  • A rich selection of built-in functions, especially string and word processing.
  • Automatic storage management.
  • Crash protection.
  • Content addressable data structures.
  • Associative arrays.
  • Simple error-handling and built-in tracing and debugger.
  • Simplified I/O facilities.