Browse Prior Art Database

Local Include: A Facility for Segmenting Programs

IP.com Disclosure Number: IPCOM000083956D
Original Publication Date: 1975-Aug-01
Included in the Prior Art Database: 2005-Mar-01
Document File: 2 page(s) / 13K

Publishing Venue

IBM

Related People

Peterson, JL: AUTHOR

Abstract

The technique of segmenting a program, in order to delineate its structure, requires the definition of many small segments of code. Usually the segments are defined as separable units of code, and they are brought into the mainline code through a copy mechanism, such as the INCLUDE statement in PL/1 or the COPY assembler instruction. When each of these segments is kept as an individual data set, the extra space required for program development and control presents a serious problem to the programming data base.

This text was extracted from a PDF file.
This is the abbreviated version, containing approximately 71% of the total text.

Page 1 of 2

Local Include: A Facility for Segmenting Programs

The technique of segmenting a program, in order to delineate its structure, requires the definition of many small segments of code. Usually the segments are defined as separable units of code, and they are brought into the mainline code through a copy mechanism, such as the INCLUDE statement in PL/1 or the COPY assembler instruction. When each of these segments is kept as an individual data set, the extra space required for program development and control presents a serious problem to the programming data base.

The following paragraphs describe a mechanism which allows all segments local to a program to be kept in a single data set, thus minimizing the space problem. The mechanism is called a LOCAL INCLUDE.

LOCAL INCLUDES can be implemented by providing control statements to define and delineate segments within a program. These statements have no meaning in terms of the flow or execution of the code, they are merely structuring statements. The sequencing or flow of the segments is indicated by identifying the top segment. Other segments are brought in via the standard INCLUDE statement.

The following example shows the definition statements for a program containing four segments. Two control statements are used: @CREATE name Indicates the beginning of a segment.

@ENDCREATE name Indicates the end of a segment.

@CREATE A;

IF X=OTHEN

INPUT (1) = 'S';

ELSE

INPUT (1) = 'P';

INCLUDE B;

@ENDCREATE A;

@CREATE B;

:DO 1 = 1 TO 10;

.

.

.

END;

@ENDCREATE B;

@CREATE C;

DCL X FIXED BINARY (31);

DCL INPUT CHAR (80);

.

.

.

.

Q-ENDCREATE C;

Q-CREATE T;

T:PROCEDURE (X);

INCLUDE C;

INCLUDE A;

1

Page 2 of 2

.

.

.

END T;

@ENDCREATE T.

Notice that the control statements give no indication of the ordering of the code. The only indication needed is a statement denoting the "top" or first segment of code. The language processor will road this segment first, and other segments will be read only as they are included. If a language processor were presented with T as the top segment, and it proc...