Continuation
In the context of IBM mainframe systems, **continuation** refers to the mechanism by which a single logical statement or data element, such as a JCL statement, COBOL literal, or assembler instruction, is extended across multiple physical lines of source code or input. This allows for longer, more complex statements to be written without exceeding line length limits, thereby improving readability and maintainability.
Key Characteristics
-
- JCL Continuation: For Job Control Language (JCL), a comma (
,) placed in column 71 of a statement indicates that the statement continues on the next line. The continuation line must begin with//in columns 1-2 and the continued operand typically starts in column 16. - COBOL Continuation: In COBOL, string literals can be continued by placing a hyphen (
-) in column 7 of the continuation line and enclosing the continued part of the literal in quotes. Non-numeric literals can also be continued without a hyphen if the previous line ends with a quote and the new line starts with a quote, effectively concatenating them. - Assembler Continuation: Assembler language uses a non-blank character in column 72 of a statement to signify continuation to the next line, which typically starts in column 16.
- Fixed-Format Dependency: Continuation rules are intrinsically linked to the fixed-format nature of many mainframe languages, where specific columns have predefined meanings and line length limits are enforced.
- Compiler/Interpreter Handling: The respective compilers, assemblers, or JCL interpreters are designed to recognize these continuation markers and logically reassemble the fragmented statement into a single entity for processing.
- JCL Continuation: For Job Control Language (JCL), a comma (
Use Cases
-
- Long JCL Parameters: Extending
PARMparameters onEXECstatements orDSN(Dataset Name) specifications onDDstatements that exceed the standard 71-column limit.
jcl //STEP1 EXEC PGM=MYPROG,PARM='INPUTFILE.DATASET.NAME.IS.VERY.LONG.AND.NEEDS.TO.BE', // 'CONTINUED.ACROSS.MULTIPLE.LINES.FOR.CLARITY.AND.READABILITY'- Complex COBOL Literals: Defining lengthy string constants or messages within
MOVEorDISPLAYstatements in COBOL programs.
cobol 01 MY-LONG-MESSAGE PIC X(100). ... MOVE 'This is a very long message that needs to be ' -'continued across multiple lines in COBOL source ' -'code for better readability and maintenance.' TO MY-LONG-MESSAGE.- Detailed Assembler Instructions: Writing complex macro calls or instructions with numerous operands in Assembler language that would otherwise exceed a single line.
- SQL Statements in Host Programs: Embedding multi-line SQL statements within COBOL or PL/I programs, where the host language's continuation rules or specific SQL precompiler directives might apply.
- Long JCL Parameters: Extending
Related Concepts
Continuation is a fundamental aspect of fixed-format languages like JCL, COBOL, and Assembler, which originated in an era of punch cards and strict column constraints. It directly relates to source code formatting and compiler/interpreter parsing, as the system must correctly identify and reassemble the logical statement from its physical parts. It is a mechanism to overcome the physical limitations of line