• Aucun résultat trouvé

RPG II

N/A
N/A
Protected

Academic year: 2022

Partager "RPG II "

Copied!
234
0
0

Texte intégral

(1)

r:;J c:\ CONTI\.OL DATA

\::I r::J COI\POR<\TION

RPG II

VERSION 2

REFERENCE MANUAL

CDC@ OPERATING SYSTEM:

INTERACTIVE TERMINAL-ORIENTED SYSTEM (ITOS)

96768710

(2)

REVISION RECORD

REVISION DESCRIPTION

A :Y1anual released.

(4/77)

B Manual revised; TRACER utility added.

1-. .

(6/77)

c

Revised to reflect ITOS 1.1 changes

f-. (10/77)

f

L~

Publication No.

96768710

REVISION LETTERS I, 0, Q AND X ARE NOT USED

© 1977

by Control Data Corporation

Printed in the United States of America

-

Address comments concerning this manual to:

Control Data Corporation Publications and Graphics Division 4455 Easlgate Y1all

La Jolla, California 92037

or use Comment Sheet in the back of this manual.

(3)

LIST OF EFFECTIVE PAGES

New features, as well as changes, deletions, and additions to information in this manual, are indicated by bars in the margins or by a dot near the page number if the entire page is affected. A bar by the page number indicates pagination rather than content has changed.

PAGE REV PAGE REV PAGE REV PAGE REV PAGE REV

i:over

--

1-1-2 A

Title pl:lge -- H-3 thru H-6 C

ii r' '-' H-7 A

iiiiiv ,~ 1-1 C

v/vi B 1-2 C

vii C 1-3 A

viii ( ' \-4 A

ix C 1-5 C

1-1 thru 1-3 A 1-6 C

2-1 thru 2-7 A J-l C

~-1 A J-2 C

:3-2 A J-3 A

4-1 A Index-l B

4-2 '\ Index-2 B

4-3 C Index-3 A

5-1 thru 5-3 A Index-4 B

5-4 ro ,- Index-5 A

5-5 thru 5-8 A Index-6 B

5-9 ro v Comment sheet C

5-10 A Cover

--

5-11 A

6-1 thl'u 6-6 A

7-1 A

8-1 thru 8-14 A 9-1 thru 9-8 A

9-9 C

9-10 thru 9-18 A

9-19 C

9-20 A

10-1 thru 10-10 A 10-11 thru 10-15 C

11-1thru11-3 A

12-1 A

12-2 A

12-3 C

12-4 C

12-5 tlJru 12-12 A

13-1 A

13-2 thru 13-9 B

13-10 C

A-I thru A-4 A

8-1 A

C-l thru C-9 A

0-1 thru D-ll A

0-12 C

0-13 thru 0-17 A

£-1 C

£-2 thru E-6 A

£-7 C

£-8 thru E-12 A

;';-13 C

E-14 thru E-28 A E-29 thru E-32 8

£-33 thru E-36 A F-1 thru F-6 A

G-l A

G-2 A

H-l A

96768710 C iii/iv

"

(4)
(5)

PREFACE

'l,&@WA41+i6iii@".'P'*+"N·4§WQl 't,l • .,,?tfflNk.AwiP;~\ A:8MJMN}W EMAW

This is

a

reference manual for the CDC® Small Computer Report Program Generator (RPG II) programming language.

It is intended for programmers having at least one year's programming experience and having some knowledge of file organizations.

The RPG II compiler operates directly under the Mass Storage Operating System (MSOS 5) which operates through the Interactive Terminal Oriented System (ITOS).

This RPG II compiler system is completely byte-oriented, meaning that word boundaries in computer memory are

Publication

Mass-Storage Operating System (MSOS) Version 5 Reference Manual

(MSOS) Version 5 Diagnostic Handbook Interactive Terminal-Oriented System (ITOS) Version 1 Reference Manual

Real-Time Operating System (RTOS) Version 3 Reference Manual

Sort/Merge Version 1 Reference Manual Magnetic Tape Utility Prnessor Reference Manual

ignored during compilation and execution of an RPG II program. References to- computer memory in this manual involve bytes, characters, and bits rather than words.

For users familiar with IBM's System/3 RPG U. appendix B lists the important differences between this version of RPG (I and System/3 implementations.

The following publications are related to RPG U:

Publication Number 96769400 96769450 96768.290 96769560 96769260 96768400

This product is intended for use only as described in this document. Control Data.

cannot be responsible for the proper functioning of undescribed features or undefined parameters.

(6)
(7)

CONTENTS

1. INTRODUCTION 1-1 Record Length 5-4

Mode of Processing 5-4

Input/Output 1-1 Consecutive Processing 5-6

RPG II Cycle 1-1 Sequential Processing by Key 5-6

Single Input File Processing 1-1 Sequential Processing Within Limits 5':"61

Multiple Input File Processing 1-2 Processing by ADDROUT File 5-7

Cycle Summary 1-2 Random Processing 5-7

Valid RPG II Names 1-2 Length of Key Field or Record Address Field 5-7

Record Address Type 5-7

File Organization or Additional I/O Area 5-8

2. RPG II SPECIFICATIONS FORMS 2-1 Overflow Indicator 5-8

Key Field Starting Location 5-8

Extension Code 5-8

3. COMMON ENTRIES 3-1 Device 5-9

Symbolic Device 5-9 I

Page 3-1 Continuation Line 5-9

Line 3-1 Continuation Lines Option 5-9

Form Type 3-1 Buffer Offset Length 5-9

Comments 3-1 Name of Label Exit 5-9

Program Identification 3-2 File Addition/Unordered Output 5-9

Number of Extents 5-10

Tape Rewind 5-10

4. CONTROL CARD SPECIFICATIONS- File Condition 5-11

FORM H 4-1

Debug 4-2 6. EXTENSION SPECIFICATIONS - FORM E 6-1

Inverted Print 4-2

Al terna te Collating Sequence 4-2 From Filename 6-2

IP Forms Positioning 4-3 To Filename 6-2

'-..

File Translation 4-3 Table or Array Name 6-2

Shared 1/0 4-3 Number of Entries per Record 6-2

Intemal Code Specification 4-3 Number of Entries per Table or Array 6-3

Execution in ITOS Environment 4-3 Length of Entry 6-4

Packed or Binary Field 6-4

Unpacked Decimal Format 6-4

5. FILE DESCRIPTION SPECIFICATIONS- Packed Decimal Format 6-4

FORM F 5-1 Decimal Positions 6-5

Sequence 6-5

Filename 5-1 Alternate Table or Array 6-5

File Type 5~1 Comments 6-6

Input Files 5-1

Output Files 5-1

Update Files 5-1 7. LINE COUNTER SPECIFICATIONS -

Combined Files 5-1 FORM L 7-1

Display Files 5-2

File Designation 5-2 Filename 7-1

Primary Files 5-2 Line Number - Number of Lines per Page 7-1

Secondary Files 5-2 Form Length 7-1

Chained Files 5-2 Line Number - Overflow 7-1

Record Address Files 5-2 Overflow Line 7-1

Table or Array Files 5-2

Demand Files 5~3

End-of-File 5-3 8. INPUT SPECIFICATIONS - FORM I 8-1

Sequence 5-3

File Format 5-4 Filename 8-2

Block Length 5-4 Sequence 8-2

Disk Files 5-4 Number 8-2

Tape Files 5-4 Option 8-3

(8)

Record Identifying Indicator, Look-Ahead Fields, Stacker Sleect/Fetch Overflow 10-2

or Spread Cards 8-3 Stacker Select 10-3

Record Identifying Indicators 8-3 Fetch Overflow 10-3

Look-Ahead Fields 8-4 Overflow Printing with EXCPT

Spread Cards 8-4 Operation Code 10-3

Record Identification Codes 8-6 Forms Control-Space/Skip 10-3

Position 8-6 Space Forms Control 10-;)

NOT(N) 8-6 Skip Forms Control 10-5

C/Z/D 8-6 Output Indicators 10-5

Record Identification Character 8-7 Field Name 10-6

Additional Record Identifications 8-7 Field Names 10-f)

Stacker Select 8-7 PAGE, PAGEl, PAGE2 10-6

Packed or Binary Field 8-7 *PLACE to-7

Field Location 8-8 Date Field 10-8

Decimal Positions 8-8 Edit Codes 10-8

Field Name 8-8 Blank After 10-10

Field Names 8-8 End Position in Output Record 10-10

Special Words (PAGE, PAGEl, PAGE2) 8-8 Packed or Binary Field 10-10

Control Level 8-9 Constant or Edit Word 10-10

:v1atching Fields 8-10 Constants 10-10

Field Record Relation 8-13 Edit Code Modifiers 10-11

Field Indicators 8-14 Eelit Words 10-11

Output Specifications Examples 10-1t

Lines 010 through 190 10-11

9. CALCULATION SPECIFICATIONS- Lines 200 and 210 10-12

FORM C 9-1

Control Level 9-2 11. OTHER RPG II INPUT FORMS 11-1

Indicators 9-2

AN/OR Lines 9-3 Fi Ie Translation Tables 11-1

Factor 1 and Factor 2 9-3 Positions 1-8 11-1

Literals 9-3 Positions 9-10 11-1

N ames and Elements 9-4 Positions 11-12 11·-1

Date Field Names 9-4 Positions 13-16, 17-20, 21-24 11-2

Special Names 9-4 Alternate Collating Sequences 11-2

Labels 9-4 Positions 1-8 11-2

Filenames 9-4 Positions 9-10 11-2

Operl1tion 9-4 Positions 11-12 11-2

Arithmetic Operations 9-4 Positions 13-16, 17-20, 21-24, . . . 11-2

Move Operations 9-6

Move Zone Operations 9-8

Compare and Testing Operations 9-8 12. USE OF TABLES AND ARRAYS IN

Bit Operations 9-9 RPG II PROGRA:v1!'.1ING 12-1

Setting Indicators 9-10

Branching Operations 9-10 Forming Tables and Arrays 12-2

Lookup Operations 9-10 Compilation Time 12-2

Subroutine Operations 9-13 Pre-Execution Time 12-4

Programmed I/O Control 9-14 Execution Time 12-4

Debug Operation 9-16 Using Tables and Arrays 12-5

Result Field 9-17 Searching Tables and Arrays 12-8

Field Length 9-18 Modifying Table and Array Elements 12-8

Decimal Positions 9-18 Using Arrays 12-9

Half Adjust 9-18 Table and Array Output 12-10

Resulting Indicators 9-18 Example of Using an Array 12-10

Comments 9-19

Calculation Specifications Examples 9-19

13. RPG II FILE PROCESSING 13-1

10. OUTPUT SPECIFICATIONS - FORM 0 10-1 Sequential File Processing 13-1

Matching Records 13-1

Filename 10-1 Look-Ahead Fields 13-2

AND/OR Relationships 10-2 Indexed Fi Ie Processing 13-10

Type 10-2 Direct Fi Ie Processing 13-10

I

Add a Record 10-2

(9)

APPENDIXES

A Glossary A-I F RPG II Object Program Logic (Detailed) F-1

B Deviations From IB:YI System/3 RPG II B-1 G Use of External Subroutines G-l C Summary of RPG II Specifications C-1 H Coding of Sample RPG II Programs H-l

D RPG II ReferenceTables D-l I RPG II Utility I-I

I

E RPG II Error :vJessages E-l J TRACER Utility J-1

INDEX FIGURES

1--1 General Program Cycle 1-3 10-1 Output Specifications Sheet 10-1

2-1 Arrangement of the RPG 11 Source Program 2-2 10-2 Specifications of Fetch Overflow Feature 10-5 2-2 RPG Control Card and File Description 10-3 Example of Coding with the *PLAC E

Specifications Sheet 2-3 Feature 10-7

2-3 RPG Extension and Line Counter 10-4 Example of *PLAC E Output 10-8

Specific8tions Sheet 2-4 10-5 Output Specifications Examples 10-12

2-4 RPG Input Specifications Sheet 2-5 12-1 A Use for Related Tables 12-2

2-5 npc Calculation Specifications Sheet 2-6 12-2 Two Methods for Defining Related Tables 12-3 2-6 RPG Output Specifications Sheet 2-7 12-3 Placement of Compilation Time Tables

4-1 Control Card and File Description and Arrays 12-4

Specifications Sheet 4-1 12-4 Input Specifications for Contiguous

5-1 End-of-Fi Ie Processing (Letter E Array Elements 12-5

Designated for Primary File Only) 5-3 12-5 Input Specifications for Scat tered Array

6-1 Extension and Line Counter Specifications Elements 12-6

Sheet 6-1 12-6 Input Specific8tions for Array Elements

6-2 Nonrelated Tables 6-3 and Indexes 12-6

6-3 Related Tables 6-3 12-7 Building an Execution Time Array through

6-4 Number 1,492 in Unpacked and Packed Calculations 12-7

Decimal Formats 6-5 12-8 Adding Elements to Short Related Tables 12-9

8-1 Input Specifications Sheet 8-1 12-9 :vIodifying a Table During Calculation 12-9 8-2 Record Type Sequence Checking 8-4 12-10 Accumulating Totals Without Arrays 12-11

8-3 Example of Spread Cards 8-5 12-11 Accumulating Totals With Arrays 12-12

8-4 Input Specifications for Spread Card 13-1 Record Selection Based on Matching Fields 13-3

Example 8-6 13-2 Read and Process Areas for Records in

8-5 Specifying Around Unwanted Control Figure 13-1 13-4

Breaks 8-11 13-3 Look-Ahead With Update Files 13-6

9-1 Calculation Specifications Sheet 9-1 13-4 An Application for Look-Ahead Fields 13-8 9-2 Examples of :vIOVEL Operations 9-7

I

9-3 Examples of LOKUP Operations 9-12 9-4 Example of DEBUG Operations 9-17 9-5 CalCUlation Specifications Examples 9-20

TABLES

4-1 Inverted Print Specifications 4-2 9-3 Move Zone Operations 9-8

5-1 Specifications Identifying Methods for 10-1 Overflow Indicator Usage 10-4

Retrieving Records 5-5 10-2 Edit Codes 10-8

5-2 File Addition/Unordered Output for Indexed 10-3 Edit Code Usage 10-9

Files 5-10 10-4 Edit Word Example 10-12 I

6-1 Alternate Table and Array Specification 11-1 PLAYGROUND Equivalents 11-1

Codes 6-6 13-1 Records Available for Look-Ahead 13-6

9-1 Operations for Calculation Specifications 9-5 13-2 Records Available for Look-Ahead with

9-2 Arithmetic Operation Codes and Factors 9-5 Update File 13-8

(10)
(11)

INTRODUCTION 1

Report Program Generator (RPG II) consists of a symbolic programming language and a compiler program. Through the symbolic programming language the programmer describes his program requirements on RPG II specification sheets.

These specifications serve as input to the compiler program.

The compiler also accepts additional data arranged in tables and arrays. This type of table and array data is fixed information that is unlikely to change for the life of the program. Compiler output includes an executable object program (stored by the compiler on disk) and/or a listing of the specifications plus any error messages and a core map.

The programmer can leave the object program on disk to be processed later, or he can proceed directly to executing the object program.

INPUT/OUTPUT

The object program plus data stored in files make up the input to the execution phase. The execution phase can occur repeatedly with different data. The output of that phase is determined by the application. It may include reports, modifications to the input data files, completely new data files, or combinations of these functions.

Input· to the compilation and execution phases may come from any input device listed in appendix D. During the execution phase, the object program can perform sequential access with files on any device. In addition, a disk file allows the following:

• Indexed and random access by key or record number

• Access according to a separate file called a record address file

Record address files list the locations of records to be processed and the order in which those records are to be processed.

The programmer has considerable flexibility in the processing of indexed files. An indexed file may be developed through an RPG II program or the RPG II disk utilities (appendix J).

RPGIICYCLE

RPG II operates on the premise that most business applica- tions involving the processing of data files adhere to a fixed sequence of processing steps: namely, read a record, process it, and output some data. These three steps make up the basic RPG II cycle and are repeated for each record in the input files.

SINGLE INPUT FI LE PROCESSING

In the simplest RPG II program, a single input file is processed. When an employee payroll report is to be produced, the input file may consist of a single card for each employee. This card might contain the employee's name, the hours worked, and the amount of pay per hour. As part of the desired output, the name and hours worked may be transferred from the card to the report. In addition, the employee's hours would be multiplied by the hourly pay rate to produce the gross pay; this figure would also be shown in the output report. RPG II specifications for this application would contain the following:

• A description of input and output files and records

• A single calculation statement in which the multipli- cation is performed

Records in the input file would be processed one at a time within the basic RPG II cycle.

With a single input file, at least three areas of complication may be added to the basic cycle:

• Different record types within the file

• Look-ahead fields

• Different report levels

In addition to the input record described above, the input file might contain records listing the home address of each employee as well as records containing any overtime hours worked by each employee. For an input file containing more than one record type, programmers may assign internal switches to be used as indicators to condition alternate calculation and/or output steps. The home address record could trigger a switch saying "bypass the calculation phase for this record" while the overtime record could set another indicator requesting a time-and-a-half calculation, the result of which would be added to the straight-time product.

With multiple input record types the basic cycle remains the same, but different activities may be programmed to Qccur within the steps of the cycle. For each employee in the input file a record type group is speCified. In addition, the program can indicate that the home address record is required with each straight-time record, while the overtime

~ecord may be omitted if no overtime was worked this week.

(In some applications, any number of a specified record type may be accepted by a program; for example, multiple sales records for a single salesman.)

Look-ahead fields permit the examination of specified fields in the next record during processing of the current record.

This is useful in the determination of proper processing of the current record. For example, if employee records are grouped according to company department and if the last record belonging to a department is to be processed uniquely, the look-ahead feature can be used to trigger this unique processing.

(12)

The output report may show, in addition to each employee's gross pay, payroll totals for each department within each plant within the company. The breakdowns by department, plant, and company are termed control levels, department being the lowest level and company the highest. A change in control level can require differe'nt activities: when depart- ment number changes, the department total must be reset to zero while payroll accumulation continues at the plant level until the plant identification changes. RPG II allows an indicator to be set automatically when a change in control level (called a control break) occurs. The programmer specifies the control level indicator to be set on when a programmer-specified control field changes.

A change in plant identification implies a change in department. Thus,. when a control break occurs at the plant level, that control level indicator, as well as all lower control level indicators (in this example, the department control level indicator), is turned on. This function is performed automatically by RPG II, provided control level indicators are properly specified in the program. When a change in plant identification does occur, the current plant and department totals in the output report should be shown before accumulating fresh totals for the new plant. Thus, when control break processing is specified in the program, the RPG II cycle is expanded to the following sequence:

1. Input a record.

2. Determine if a control break has occurred; if not, go to step 5.

3. Perform total calculations.

4. Perform total output.

5. Perform detail calculations.

6. Perform detail output.

MULTIPLE INPUT FILE PROCESSING

With multiple input files, RPG II processing can become quite complicated. Each file may contain the complexity of a single input file, and the input files may be. interrelated as well. The programmer has complete control over the order in which files and each record within each file are processed. When a particular processing order is not specified in the program, the files are processed in the order in which they are specified on the File Description Specifi- cation sheets, as if they were strung end-ta-end as· a series of single input files.

When the files are interrelated, the program probably should not process the files on the end-to-end basis. Rather, the files should be processed on the basis of matching records ..

Record matching is accomplished through the comparison of fields from records in two or more files. When a match

occurs, a matching record indicator is automatically set on, and a record is selected for processing based upon the order in . which the files were specified in the File Description Specification sheets. With no match, a record is selected according to the program's collating sequence for the matching record fields. As with record type and control level indicators, the matching record indicator can be used to condition calculations and output in the program.

Returning to the example, record matching can be used to incorporate this week's payroll information into an annual payroll file.

CYCLE SUMMARY

As described above, RPG II distinguishes between functions performed each cycle (detail operations) and functions performed when a control break occurs (total operations).

Because the processing of a control group should be completed before starting the processing of a new control group, total operations are performed before detail opera- tions in the RPG II cycle. All input records processed between one control break and the next comprise a control group.

In addition to detail and total operations, there are IP (first page) and LR (last record) operations. IP processing is unique to the first cycle. The IP indicator can be used to condition report headings and is very useful in the proper positioning of preprinted report forms. RPG II auto- matically turns the LR indicator on when the last input record from the last input file has been reached. This indicator is commonly used to condition summary lines in a report.

The general operations involved in a single cycle are shown in figure 1-1. Appendix F contains detailed information about internal RPG II operation.

VALID RPG II NAMES

The following rules apply to names used in RPG II programs:

• RPG II filenames are from one to eight characters long;

RPG II field names are from one to six characters long.

• Field names and filenames are left-justified in the specification fields in which they appear.

• The first character of either a filename or a field name must be alphabetic (see appendix A, Glossary, for a definition of alphabetic characters). The remaining characters are any combination of alphabetic and numeric characters (special characters are not allowed).

• Blanks cannot appear between characters in the name.

(13)

0299

TURNOFF INDICATORS

TURN ON THE

~~--.... PROPER CONTROL

MAKE DATA FROM RECoRD JUST READ AVAILABLE FOR

"PROCESSING

DO- ALL DETAIL CALCULATIONS

LEVEL INDICA TORS

DO TOTAL CALCULATIONS

PERFORM TOTAL OUTPUT

Figure 1-1. General Program Cycle

(14)
(15)

RPG II SPECIFICATIONS FORMS 2

After the programmer has determined his report requirements (input and output formats and calculations), he codes the information on RPG II specifications forms. Seven types of preprinted forms are available to tHe programmer.

There is a control card for the whole job, and there are six form types for the input, calculation, and output logical specification areas:

• Control Card Specifications (form H) provide informa- tion pertaining to the compilation as a whole.

• File Description Specifications (form F) and Extension Specifications (form E) describe files, tables, and arrays to be used by the program.

• Line Counter Specifications (form L) provide informa- tion about line printer files produced by the program.

• Input Specifications (form I) and Output Specifications (form 0) describe records in the files named in forms F and E.

• Calculation Specifications (form C) describe operations to be performed on the input data.

In addition, the programmer may specify:

Compilation time tables and arrays (tables and arrays that do not change for the life of the program)

• Translation tables (according to which characters in the input and output files are changed)

• Alternate collating sequence tables (used to modify the collating sequence of the standard character set) These three specification types do not have preprinted forms. Table and array formats are defined by the programmer within his program. Each record in the table or array must adhere to the format so defined. Translation and alternate collating sequence tables have fixed formats (see section 11), but they are not entered on preprinted forms

because the number of table entries varies from program to program.

Each RPG II program has one optional control card specifications line. The numbers and types of other specifications vary with the application, but RPG II requires that the specifications be presented to the compiler in the order shown in figure 2-1. The

**

and 1* delimiting records illustrated in the figure are also required in the source program, as appropriate. For convenience, records are illustrated as punched cards. As the figure indicates, the minimum. requirement for an RPG II source program is one file description specification record, one input specifications record, and the trailing 1* record.

In the logical specification area of input, the programmer describes files, records, fields, and file devices.

In the calculation area, operations to be performed on the input data are described. These operations may be condi- tioned (for example, by MR, the matching record indicator or by a zero result in the last calculation operation).

Calculation operation codes provide arithmetic functions, field movement, the definition of internal subroutines, usage of internal and external subroutines, setting and testing of flags, table lookup, and special input and output.

In the logical specification area of output, the user describes files, records, fields, and file devices. When a file is being updated, specifications in this area augment the input specifications for the file. When a new file is being created, the user also describes. record organization and field positions. In addition, when the output file is a listing file, the user specifies any editing to be performed by RPG II.

Figures 2-2 through 2-6 contain copies of the preprinted specifications forms. To the experienced RPG II program- mer these pages and the summary of features in appendix'C should be a sufficient introduction to this version of RPG II.

Sections 3 through 13 contain a detailed description of RPG II functions and usage.

(16)

CONTROL CARD SPECIFICATIONS

NOTE: REQUIRED SPEC!FICATIONS ARE SHADED.

Figure 2-1. Arrangement of the RPG II Source Program

(17)

CoNTRoL DATA

CORrQ'"R(\nON' RPG CONTROL CARD AND FILE DESCRIPTION SPECIFICATIONS I'Iin .... In U.s.A.

I ~ I

Punching

~

... --_--_ ..

--._---TI-Da-~-·--~---~ I~i~

I ::c I I I I I I I I ~rdEIKtroNwnoo I

12 7671177181980

PIoo[Dof _

~donl

I I I I I I

~ i I

Sizato i

~

1ID1D

i

i t:1&

~=

Une ! Compile c3

8

e - 5 !:! jf I ~ PaIltipni

~

Ii

r! e~l@

!

!:5 lit

00_.

II 4 II • 7 8 II 10 " '2 I' 14 15 " 17 18 III 20 21122 n:M 25

01 H

f - - -

F

File DesiQNtlon

Filename U ..

~ It

l:l 4 II •

!

1 8 II 10 11 12 13 14 l ' I' U 18 j f 20 21 22 2:11. 2S 28

o 2 F

o 3 F

o 4 F

o & F

o II F

o 7 F

08 F

o II F 1 0 F F F

Control Card Specifications

Model 20

= ~II

Refer to !he specific SysI8m Rem-Ubnry IftIIIUIi for _ I I entr ....

21 28 211 30 I" niD 3t I . 311121 311 .. 40 41 42 la 44 144 41 47 48 44 50 .'1 52 53 54 66 58 57 58 MI 10 II 12 13 14 IIIi IIIi .7 . . . . 70 71 72 72 74

I

File Description Specification

Mode of "'-Ing File AddItionIUlWdencI

, I' :!:

u " OL . . . . LI . . . £I ZI III 011 . . . . tI III III . . £I n II 01 D • Lt • It .... £t tt it Ot • • U 11£ 11£ IC a: a: 1I: CIt II: II: LE lit lit K a: U it ot I i Il U Il I i ti I:i ti U Oi 8 • L II • t I: I: i

Figure 2-2. RPG Control Card and' File ,Description Specifications Sheet

(18)

il8 ~=

RPG EXTENSION AND LINE COUNTER SPECIFICATIONS Printed in U.S.A.

...

I I=~ II I I I I I I

Card llectro Humblr

I

1 2 7571777878.

F'IIncIIing

... [1]01_ =-~I I I I I I I

~

10-

1 .. 1nICtion

Extension Specificationt

E

fI-.I . . . o1 the 0IIInkIt File

NumIIw

1 - ... 0IIIMIe ... of Numblr I!- Tillie 01

J-

To'i...,.". Table or IMriII of LIfIIIII .II~ An-vName lIngIh

i~

Commtntl

line

!

Array Name

..

!ntrle of j- of

" - I I "-Table Entry

ill

IAIWNIInI Entry

~iJ

1

frOm 'ilenlme or Array ~

3 4 I e 7 • • 10 112131411111711 11202122232421211 12721129303132 333431 31 37 31 39 «14142 4344 1411 41 47 41 • 10 ., 125314 II !III ~1I.IO~aGMIIIIVII.~HnnM

o 1

o 2

o 3

o •

o II

o II

o 7

o 8

E

Line Counter Specifications

L

1 2 3

5 II 7 8 8 10 11 12

-

Line

! 1

filename

~J h ~J I~

0 2 ... "

~J II ~J -I Jj ~J II ~J 11 ~J Ii ~J 11 ~J II ~I 11 ~J JI ~J II

3 4 I . 7 • • 10 11 12 13 14 111117

,. I.

202122 23 24 2121127 2829 303132 3334 313137 3139 «14142 4344 414147 4149 101112 5314 II.~ I I . . eolIa G&t • • 17 II .. ~n72 n74

1 1 L 1 2 L L

FilW'e 2-3. BPG Extension and Line Counter Specifications Sheet

(19)

Programmer

CONTRPL DATA

CORPO~T10N

0.,.

Filename

8 ".

ta - ~·o

1.

~ § ~

r-f-r-o R

t

Z

t

0

"a:~

fp:~'D

Position

RPG INPUT SPECIFICATIONS

Record Identification Codes

Field Location

Position Position From To

I 2

pageITJo,_

Field Name

75 76 77 78 79 BO

::~:~':"ion I I I I I I I

Field.

Indicators

Z .. o Plus Minus or

Blank

9 10 1\ 12 13 14 1& 18 17 18 19 20 21 22 23 24 25 26 21 28 29 30 31 32 13 34 35 36 31 38 J9 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 51 58 59 60 61 62 63 64 65 66 61 88 69 10 11 12 13 14

---+-~~_+-r;-+_r-r;-+_+_r;_+4

H-+-+-++++++-H-+-H-++++-H--H-+-H-+-+-++-++-H-HI-+-H--H--++-H-+-t·-+--'I-+--I-+++-+-·-f-t-+-+-l-+-+--+-+-f-+~-~-+-~

~~~4-+-+-~~-+-l-4-+-~~~-+-l-+-+-~~~-l-+-+-~~-+-l-4-+-~~-+-l-4-+-~~-4-+-r~~-+-~-~T t-t--+---r1-+-~~_+-r~-+-~-+-+~

Figure 2-4. RPG Input Specifications Sheet

(20)

RPG CALCULATION SPECIFICATIONS P"nled in US .•.

7!'> 76 17 78 79 80 P'09'.m

"09''''''''''

1 2

,.HJCOJO'_ ~:~':'Mnl I I I I I I

c

Comments

R'·'i.ultlr~1

~ Indicators Result Field ,,,.he •• Inn

_ 0

I I

A,.Ihmo-I.e

=-om And And F 1 o · F~to' 2 _3_ ; Pt.-I'M,·nus·IZ-,o

& t z actor. peratto" - ~; ... ~:\fnp

..

:~

'.

L."~ ;! ~ ~ Name length ~

f

1 211 < 211 2

e ~ en : _ LuukupIF.IC.:'Of 2h~

~ J 5 j i i d i H"~l Low E'lual

J .. 5 G 7 a 9 10 11 12 13 14 lS 1\; H '8 19 20 21 ".l'J 23 24 ~ '6 " ~ 1!t 30 31 X' 33 34 3S 36 31 18 39 ... 41 47 43 .. 4 45 4(j 41 4& ,.g 50 51 !,:, ~ :04 t.!: 56 f')7 ":-!!J9 ;0 li1 62 6:! t)4 h~' hI) t.I ~WoC f,'J m l' 1.' 1: '4

~::~: I~+~_~::~~~ i~ -~:;:::t!!;: :~~~=~::~:~±~~,l,.,~~4_:":.~~!I~~f'-~i'

o! 61 C : : '

-~

-

"_~.'.~._. ~._':.

- -

t:. ~.

.

: :'

,--t-+~~t--t-.-.... -

i I ;

.• --.-r--r- - -

"--r-+- .. _-

.--,,-~,-,,----.---"";~~-r-'-'--I

o 1 ._. ___ ~_ 1

i

l' j I __ .__ I i i

-f--I-+-II-+-:...-t-H-+-+--r-H-+-,-+ ...

-.-.-l-~!. +-+-1~'+~+--+---." '-~-H'-++-H-+-+--+I-:...' -'---.;~~! ~'-r-...;...-+-i'-J,.i~

i I ! !

HH-~-t-""""-';"-i--t---_·-...-;---I----.... ++--f---~+-~-+_+_-+-;...;.-'-_+_I

i :

i i ii

:!: -,

i i ;

! . '-r-t- -- --

"1

I i :

i

1 .. . • - f -~-t-i-r·+-+-,t--+--"- .---- - ---r- - r--' ~t- '-fH--+-~'''''''''1 ~'--i,-t-+--r-+-I:-'--+-I

! I I i I !"t ' I

1 3 ~.-.. ---·-+-ii·-!-!-·o...t;-'-... i~-+-·---·:...----r-r-- - .... t--t---t-... -'--+-+-l-II +-h-+I'~-~ii -t,-t

do

114

'--i-+-_I --j.-+--+--.-+-... -t--.. -"--_._-+-t-+-+--f-f-,-f-i_

I

i i i : ;

i : I

... 1+!'>-H_CI--+-HH--+4-4--J-+-HH--+--4H--+4-4-.f-+-+-l14 I .

I

I II

I

I I : ! ! 1 i I

I I

~-I~.I_ ~

r- -r-" -t-t-t-f·-t-t-t-t-+-+-t--t-i-t-t-t--I---t---t-ii-+-++--t-t-I-t-++-+-t-tJLl)-

t

f - -

I

I !

I

I

J

1 7' C

I

I , I ' ! . : i

I

I--l-+-e+--1I--C+-+--If-+·-t--t-hH ... +++-HH-+-++-H-+-+-+-H ... -+-+-+-HH--+++-r·~ ~- :-~--f-!~>--,... ~- -

-f-:

-i~

H-++--HI-+-++--Hf--f--!--~4-f--t--+-4-+--+--I-~-+1

4,-+ I!_

-t-+·~-t-+-H-'-·~I-

__ -

~I

-t -. --:. -- -: -

~

-- - r- ; f- - . ;

+-f--..-I ~'---I

1 9 C , . I , I i

c

+-tl .-

t-+~--+-~4--+i-Hf-I'-~· -. -'~f-rl-

-.: f--

- : + -I' -+-+[--1·-' -: .... 1-1

2 0

It It Ot ell 119 t9 99 S9 t9 t9 19 19 09 6S II'i tS go; SS ~ tS lS IS os 6t 8t tt 9t St n tt It It (It 61: 9t tt 9t st K tt It It 01: 6l 8l II 9l Sl tl £l II Il Ol &1 91 tI 91 SI tl £1 II "01 6 8 t 9 S t t l I

Figure 2-5. RPG ~alculation Specifications Sheet

(21)

CONTRPL DATA

CORPORt\TlON RPG OUTPUT SPECIFICATIONS

7578777879110

ul_Pt....:, .. _InI _ _ _ _ _ _ _ r -_ _ _ _ ---I1 l'Imching I Graphic I I

I

Pt,,"mmer Dill I Instruction I Punch I I

I

I I

I

Clrd Electro Number 1 2

PI9l[OO'_

= - : " t i " ' O

IIIII

~--~---~~--~----.r---,---~--_r---

.. ----

~

o

line

l-!

e of

3 4 5 6 7 8

o , 0

Filename

~ ~pace Skip Output Indicators

~ ~I--I--~-+-....,~--r---i

~ ~

!x';:C

1 : 1

:4nd And

J

I- olS

1-;:'0'0

i

I; g

Iii ~ z:

~~~ AND

1) Z

I ~;z::::::::::::::::::==i"~» Commas Zero Bal.nces No Sign CR _ X· Remove

~1eId Heme ~'I

..

~=Y=es=~,,;;to;;,;YPr;,;~;;;,nt~4===l=A=I==J~ Y • 61~tSe Sign

Ib1 Yes No 8 K Field Edit

ILl End No Yes C l Z · Zero

Positon No No D M Suppress

in a:

Output ::J

Record ~ Constant or Edit Word

"AUTO

9 10 11 12 13 14 15 16 17 18 I ' 20 21 22 23 24 25 26 27 28 211 30 31 32 33 34 35 38 31 38 b9 40 41 42 43 44 45 ~ 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

1-1--4-+++-+-1-1- +-+-+-++-1-- -. ,... f- +-+-+-'''-If--f~- ~-f---- .. +-I-+-~H_t_f_ I-++.J-H-+++++-+ .~-- -~-.. .f--- -f---I- o 2 0

~~-+-4--+ .. -"-~- .. ~-1;-1--·-+·+-+_HH-++_++-l o 3 0

o .- 0

+--+~~_++-++-~f-+_+~_++--+_~~-+ +-r_++_~H_+-r+~'+-I_;_t~-_++_t-f---f---f----

o 5 0 o 6 0 o 7 0 o 8 0 o 9 0 1 0 0

11 0

1 2

1 3 0

~f- +-+-~~_4-++.-l-+-~-... _4-+.~f_-I +_++-'+-I-+'-++~ .J-+--+-++-+-I~-I-- 1-. ,.-~ 1 .- 0

t-H-+-+_++-HH-+-+-+-+-HI-~_+_4· - f- . . ~ -. -~ - --Hf--f-+-+--+--+-... f-+-+-of- - I 5 0

I 6 0 I 7 0 1 8 0 1 9 0 2 0 0 0 0 0 0 0

., U It III • • " • st ., £11 E9 .1 09 H II!; " \III f t til t!I tS &I 09 . , " n II' U ... r.. It I t 0' It It Lt lit it tC tt tE It DC til It Lt It II: ,I; t l U " at II II LL 9L ~I " t l tl II 01 • L • S • C t I

Figure 2-6. RPG Output Specifications Sheet

(22)
(23)

COMMON ENTRIES 3

This section defines entries that are common to all RPG II coding sheet formats except file translation table and alternate collating sequence records. which are described in section 11. The common entries are:

Columns 1-2 3-5 6

Entries pagel Line Form type

Page and line together form a five-digit sequence number.

7 Comments

75-80 Program identification

During processing of the specifications forms. the RPG II compiler checks for proper ordering of the sequence numbers. When proper order is violated. that fact is noted in the printout produced by the compiler but otherwise has no effect on the compilation. Blanks found in columns 1 through 5. are treated as zeros.

PAGE

Columns Values

1-2 01-99

Columns 1 and 2 in the upper right corner of the specifica- tions forms are used to number the pages of the RPG II program. Number the pages in ascending order. The forms are presented to the compiler in the following order:

1. Control Card Specifications 2. File Description Specifications 3. Extension Specifications 4. Line Counter Specifications 5. Input Specifications 6. Calculation Specifications 7. Output Specifications

A program may require more than one sheet or none of a particular specifications type, but in any case the above order must be maintained.

LINE

Columns Values 3-5 000-999

The single control card specifications line. if used. is always line 010 of a program. Any other sequence numbers used need not be consecutive. but they should be in ascending order.

FORM TYPE

Column Values

6 H

F E

L

C

o

Meanings

Control Card Specifications sheet (or header card) File Description Specifi- cations sheet

Extension sheet

Specifications Line Counter Specifications sheet

Input Specifications sheet Calculation Specifications sheet

Output Specifications sheet The form type is preprinted in column 6 of each line of each specifications sheet. The letter identifies the type of specification of each line of coding.

The H in column 6 of the Control Card Specifications form stands for header record. Each RPG II source program has only one header record. and. if used. that record must be the first line of the program.

COMMENTS

Column Value

7

*

Meaning Comment line

Any specifications line containing an asterisk in column 7 is entirely commentary. Columns following the asterisk may contain any members of the character set. The compiler performs sequence checking on the line and includes the line in the source program listing, but aside from that the line is ignored.

(24)

PROGRAM IDENTIFICATION

Columns Values Meanings

75-80 Blanks RPGOBJ

Valid RPG Program identification II name

Columns 75 through 80 of the Control Card Specifications sheet are used to name the object program. This name is used in a program directory to identify the location of a program on disk.

Any combination of alphabetic and numeric characters may be used in columns 75 through 80; however. the first character must be alphabetic. Blanks must not be used between characters in the name. The program name should be unique. If columns 75 through 80 are left blank. the compiler automatically assigns the name RPGOBJ to the object program.

Columns 75 through 80 of all source program specification sheets. except the Control Card Specifications sheet. may contain any characters or may be left blank. These entries are ignored by the compiler but are produced in the source program listing.

(25)

'--.

CONTROL CARD SPECI FICATION - FORM H 4

Only one control card may be submitted for each program.

It provides information about the program and the system to the RPG II compiler. If the control card is omitted, a blank control card is assumed. For coding the control card, one specifications line is provided on the Control Card and File

Description Specifications sheet (figure 4-1). The remainder of this section describes the columns of form H that are used. Any column that is not specifically described must be filled with a blank.

Progrlm Progrommer

H

- F

Une

!

E

.f

3 4 5 6 7

o 2

o 3

o 4

o 5

o 6 F o 7 08

o 9 1 0

CONTRPL DATA

CORrQRi\TlON RPG CONTROL CARD AND FILE DESCRIPTION SPECIFICATIONS Printed In U.S.A.

Filename

Dote

Fill Type Fill Designation

End of Fil.

Sequence File Format

810ck Length

Record Llngth

Control Card Specifications

File Description Specification

Mode of Processi ng Length of Key Field or of Record Address Field

Record Address Type Type of Fil.

Orglnization -' w or Addition.1 Ale. ~ Overflow Indicator U

~~ ~.~

~

a

Stlrting;

~ :::: location W Device

Symbolic Device

1 2

page[JJ0'_

75 76 77 78 79 SO

::~;~f~Cltion

I I I I I I I

Refer to the specific System Reference library manual for actual entries.

File Addition/Unordered

Extent Exit N u _ of TrKks

~ for DAM for Cylinder Overflow

Z Name of

Number of Extents

ca

~ Label Exit

T_

~ Storage Index Rewind

~ Condition Continuation lines

~ Ul.~

:::>

~

K Option Entry "<

8 9 10 11 12 13 14 t6 16 17 18 19 20 21 22 2 24 26 28 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 . . 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74

Figure 4-1. Control Card and File Description Specifications Sheet

(26)

DEBUG

Column 15

Values Blank 1

Meanings

Do not perform DEBUG operations.

Perform requested DEBUG operations.

This specification in column 15 indicates:

• Whether DEBUG operations are to be performed by the object program, and

• Whether lines containing the DEBUG operation code are diagnosed as errors in the program listing

As the name implies, the DEBUG operation code in the calculation specifications is a tool to be used in checkout of the object program. Intermediate debugging output is produced only when requested by this specification and a DEBUG operation code on form C.

When checkout of the object program has been completed, changing this entry to a blank eliminates· the then extrane- ous debugging output; i.e., changes need not be made to the Calculation Specifications· sheet.

INVERTED PRI NT

Column Values Meanings

21 Blank Domestic format

Foreign format

J Foreign format (leading zero remains for zero balances) D United Kingdom format

Column 21 is used to describe the format and punctuation used for numeric literals on the Calculation Specitications sheet, the order of the system date (referenced by UDATE) field, and edit codes used on output.

NOTE

The input for UDATE must be in the format expected as output. For example, if D (United Kingdom format) is specified in column 21, the input format must be dd/mm/yy (where dd=day; mm=month;

yy=year).

Inverted print specifications and resulting formats are shown in table 4-1.

ALTERNATE COLLATING·

S~QUENCE

Column Values Meanings

26 Blank Use normal

sequence. collating .S Use alternate collating

sequence.

Every alphabetic, numeric, or special character holds a special position in relation to all other characters. This special order is known as the collating sequence. The normal (default) collating sequence is based on the way characters are represented in the machine and is listed in appendix D.

If characters are to appear in a sequence other than the normal sequence or if two or more characters are to have the same position in the sequence (this means they are considered equal), an alternate collating sequence must pe described.

TABLE 4-1. INVERTED PRINT SPECIFICATIONS

Inverted Print Numeric Literal using Edit Codes using Zero Suppress to the UDATE Appears with Option a Decimal Point Period/Comma as a Decimal Point Period/Comma as Left/Right of the Decimal Point a Slash/Period

Blank 1234.56 1,234.56 .10 mrn/dd/yy

D 1234.56 1,234.56 .10 dd/mm/yy

I 1234.56 1.234,56 ,10 dd.mm.yy

J 1234.56 1.234,56 0,10 dd.mm.yy

mm=Month dd =Day yy =Year

(27)

An alternate collating sequence applies to matching fields, sequence checking of files, and alphanumeric compare operations (COMP operation code). The alternate sequence does not apply to numeric comparisons, lookup operations, and cont rol levels. (Refer to section 11 for additional details on alternate collating sequences.)

An alternate collating sequence table is printed out with the compiled program. The order of an RPG II source program including an alternate collating sequence table is shown in figure 2-1.

lP FORMS POSITIONING

Column Values

41 Blank

Meanings

First 1 P line is printed only once.

First 1 P line can be printed repeatedly.

This entry in column 41 j:.; used only when the first output line conditioned by the first page (IP) indicator is written to a printer' file. Ordinarily it is used when the output is going to preprinted forms, such as check blanks, where the proper alignment of forms is very important. When requested, forms positioning allows the operator to correctly position

I

the forms by first printing a test line.

FILE TRANSLATION

Column Values

43 Blank

F

Meanings

No file translation is needed.

Input, output, update, and/or combined files are to be translated.

An F character in column 43 indicates the information contained in an input, output, update, or combined file is in a form not usable by the object program. For example, this option is used when an input file was produced by a computer that has a different character set than the one defined in appendix D.

With an input file, translation occurs before the data is processed by the object program. For output files, transla- tion occurs as the output data is produced. When an update or combined file is translated, t he conversion is performed for both the input and output phases for the file.

Note that since an external medium is implied in file translation, the internal collating sequence of the object program is not affected by the translation.

Refer to section 11 for further information on file translation.

SHARED 1-0

Column Values 'Vleanings

48

Blank

All disk files share a single input/output area.

Each di"k file u"e-; a .-;ep- arate input/output area.

Column 48 applies to disk files only. Norma1\y H.n RPG II progr.am uses one input/output area for each file. An entry

In thiS column allows all disk files to use one input/output area. Specifying a shared input/output area reduces the amount of core storage needed by the object program. This is particularly important if a program is so large that it cannot run in the available core storage. However, t he use of a shared input/output area increases the time required to execute the object program. Therefore, it is a good idea to make sure that the program exceeds the capacity of the system before specifying shared input/output.

NOTE

A shared input/output area cannot be specified for multivolume file (entry greater than 01 in columns 58 and 69 of the File Description Specifications sheet).

Additional input/output areas (entry in column 32 of the File Description Speci- fications sheet) cannot be specified for disk files using a shared input/output area.

I NTERNAL CODE SPECI FICATION

Column Values Meanings

50 Blank Internal code is ESC DIC Non-blunk Internal code is ASCII

The normal internal RPG II code is EBCDIC. If the ASCII

I

option is selected, execution is not compatable with the IBM system 3.

EXECUTION IN ITOS ENVI RONMENT

Column Values

51 Blank

Non-blank

Meanings

RPG II object code i~ pro- vided in ITOS--compatible form.

Object code is provided for MSOS batch-type execution.

MSOS batch type code should be used only for systems that lack any

nos

capability; this type of code should not be used in an

nos

environment under the job processor.

(28)

Références

Documents relatifs

NortTlally the 1 K byte RAM buffer is set up to contain the rleader of the sector to be read and the disk state machine state compares this to the data stream corn ing off

The default is the system library (#LlBRARY). The name you want assigned to the load member created by $SFGR. Controls printing by $SFGR on the system list

SpaceHeader: TYPE = RECORD [ link: POINTER TO SpaceHeader, segment: DataSegmentHandle];. InitSpace:

[r]

Sperry Univac provides the customer an opportunity to have special hardware or software features custom-developed by a major vendor to their specification, and

MARKETING SPECIAL PRODUCTS

COBOL SUBSET KOBOl RPG II KOBOl RPG

Sperry Univac will supply one pack with each disk drive shipped but additional packs will be the customer's responsibility.. Your existing sites should be