• Aucun résultat trouvé

User's Guide

N/A
N/A
Protected

Academic year: 2022

Partager "User's Guide"

Copied!
306
0
0

Texte intégral

(1)

REPORT PROGRAM GENERATOR II RPGPLUS (VERSION 1)

RPGII (VERSION 4)

User's Guide

April, 1978

Model Code No. 50325

~TAPOINT CORPORATION

The leader in dispersed data processing

1M

COPVRIGHT' 1978 BY DATAPOINT CORPORATION. PRINTED IN U.S.A.

(2)
(3)

REPORT PROGRAM GENERATOR II RPGPLUS (VERSION 1) RPGII (VERSION 4)

User's Guide Version 4 April, 1978

Model Code No. 50021

(4)
(5)

PREFACE

This manual applies to the following versions of Datapoint's RPG II systems: RPGPLUS version 1, and RPGII version 4.*

This manual is to be used as a source language reference and operation guide for all Datapoint RPG II systems. The RPG II

systems are specifically RPGII and RPGPLUS. RPGII will operate on 1100 and 2200 systems as well 5500 and 6600 systems. RPGPLUS

processes an enhanced version of the Datapoint RPG II source language to produce relocatable object code for 5500 and 6600 systems.

*

RPGII version 4 contains all features and capabilities of RPG5500 version and RPGII version 3.

i

(6)

TABLE OF CONTENTS

1. INTRODUCTION

1.1 Installing The RPG II Compiler 1.2 Required Utility Programs

1.3 Definition of Terms

1.4 General Datapoint RPG II Program Logic 1 .4.1 Operations at Total Time

1.4.2 Operations at Detail Time 1.4.3 General Program Cycle

1.5 Source File Order and Program Specifications 2. COMMON FIELDS ON SOURCE

2.1 Columns 1-2 (Page) 2.2 Columns 3-5 (Line) 2.3 Column 6 (Form Type) 2.4 Column 7 (Comments)

2.5 Columns 75-80 (Program Identification) 3. HEADER SPECIFICATION

3.1 Columns 1-2 (Page) and 3-5 (Line) 3.2 Column 6 (Form Type)

3.3 Columns '7-9

3.4 Column 10 (Object Output) 3.5 Column 11 (Listing Options)

3.6 Columns 12-14 (Core Size to Execute) 3.6.1 Column 12

3.6.2 Columns 13-14 3.7 Column 15 (Debug) 3.8 Columns 16-25

3.9 Column 26 (Alternate Collating Sequence) 3.10 Columns 27-74

3.11 Columns 75-80 (Program Identification) 4. FILE DESCRIPTION SPECIFICATIONS

4.1 Columns 1-2 (Page) and 3-5 (Line) 4.2 Column 6 (Form Type)

4.3 Columns 7-14 (File Name) 4.4 Column 15 (File Type)

4.4.1 Input File 4.4.2 Output Files 4.4.3 Update Files 4.4.4 Display Files

4.5 Column 16 (File Designation) 4.5.1 Primary Files

ii

page 1-1 1-1

1-1

1-2 1-3 1-3 1-3 1- 3

1_1~

2-1 2-1 2-2 2-2 2-2 2-3 3-1 3-1 3-1 3-1 3-1 3-1 3-2 3-2 3-3 3-3 3-3 3-3 3-4 3-4 4-1 4-1 4-1 4-1 4-2 4-2 4-2 4-2 4-3 4-3 4-3

~

(7)

4.5.2 Secondary Files 4~4

4.5.3 Chained Files 4-4

4.5.4 Record Address Files 4-4

4.5.5 Table or Array Files 4-4

4.5.6 Demand Files 4-5

4.6 Column 11 (End of File) 4-5

4 . 7 Col u in n 1 8 ( Seq u en c e ) 4 - 6

4.8 Column 19 (File Format) 4-7

4.8.1 Fixed Format Files 4-7

4.8.2 Variable Form~t Files 4-7

4.9 Columns 20-23 (Block Length) 4-7

. 4.9.1 Disk Files 4-8

4.9.2 Tape Files 4~8

4.9.3 Other Files 4-8

4.10 Columns 24-27 (Record Length) 4-8

4.11 Column 28 (Mode of Processing) 4-9

4.11.1 Consecutive Method 4-9

4.11.2 By ADDROUT File 4-10

4.11.3 Sequential By Key 4-10

4.11.4 Sequential Within Limits 4-10

4.11.5 Random Method 4-11

4.12 Columns 29-30 (Length of Key) 4~11

4.13 Column 31 (Record Address Type) 4-12

4.14 Column 32 (File Organization) 4~12

4.15 Columns 33-34 (Overflow Indicator) 4-13

4.15.1 Overflow Indicator 4-13

4.16 Columns 35-38 (Key Field Starting Location) 4-14

4.17 Column 39 (Extension Code) 4-14

4.18 Column 40-46 (Device) 4-14

4.18.1 Use of the LOADER Device for Program Chaining 4-17

4.18.2 SPECIAL Device Support 4-17

4.19 Columns 47-52- 4-18

4.20 Columns 53-65 (Continuation Lines) 4-18 4.20.1 Column 53 (Continuation Code) 4-18 4.20.2 Columns 54-59 (Continuation Option) 4-19 4.20.2.1 Columns 54-59 (Name of Label Exit) 4-19

4.20.2.2 Columns 60-62 (Extension) 4-20

4.20.2.3 Columns 63-65 (Drive) 4-20

4.20.2.4 Columns 60-65 (Number of Sectots) 4-20 4.20.2.5 LOCAL/SERVO Continuation Option 4-20

4.20.2.6 ASCII Continuation Option 4-20

4.20.2.7 Tape Density Continuation Option 4-21

4.21 Column 66 (File Addition) 4-21

4.22 Columns 67-70 4-21

4.23 Columns 71-72 (File Conditioning Indicator) 4-22

4.23.1 U1-U8 (External Indicators) 4-22

4.24 Columns 73-74 4-23

4.25 Columns 75-80 (Program Identification) 4-23

iii

(8)

5. EXTENSION SPECIFICATIONS 5-1 5.1 Columns 1-2 (page) and 3-5 (Line) 5-1

5.2 Column 6 (Form Type) 5-1

5.3 Columns 7-10 5-1

5.4 Columns 11-18 (From Filename) 5-1

5.5 Columns 19-26 (To Filename) 5-2

5.6 Columns 27-32 (Table or Array Name) 5-3

5.6.1 Table Name 5-3

5.6.2 Array Name 5-4

5.7 Columns 33-35 (Number of Entries per Record) 5-5 5.8 Columns 36-39 (Number of Entries/Table) 5-5

5.9 Columns 40-42 (Length of Entry) 5-6

5.10 Column 43 (Packed or Binary Field) 5-6

5.11 Column 44 (Decimal Positions) 5-7

5.12 Column 45 (Sequence) 5-7

5.13 Columns 46-57 (Alternate Table/Array Specification) 5-8

5.14 Columns 58-74 (Comments) 5-8

5.15 Columns 75-80 (Program Identification) 5-8

6. LINE COUNTER SPECIFICATIONS 6-1

6.1 Columns 1-2 (Page) and Columns 3-5 (Line) 6-1

6.2 Column ~ (Form Type) 6-1

6.3 Columns 7-14 (Filename) 6-1

6.4 Columns 15-17 (Lines per Page) 6-1

.6.5 Columns 18-19 (Form Length) 6-2

6.6 Columns 20-22 (Line Number of Overflow Line) 6-2

6.7 Columns 23-24 (Overflow Line) 6-2

6.8 Columns 25-74 6-3

6.9 Columns 75-80 (Program Identification) 6-3

7. INPUT SPECIFICATIONS 7-1

7.1 Columns 1-2 (Page) and 3-5 (Line) 7-1

7.2 Column 6 (Form Type) 7-1

7.3 Columns 7-14 (Filename) 7-1

7.4 Columns 15-16 (Sequence) 7-2

7.5 Column 17 (Number) 7-3

7.6 Column 18 (Option) 7-3

7.7 Columns 19-20 (Record Identifying Indicator) 7-4

7.7.1 Record Identifying Indicator 7-4

7.7.2 Look Ahead Fields 7-5

7.8 Columns 21-41 (Record Identification Codes) 7-7

7.8.1 Position 7-7

7 . 8 . 2 N ot 7 - 8

7.8.3 C/Z/D 7-8

7.8.4 Character 7-8

7.8.5 AND Relationship 7-9

7.8.6 OR Relationship 7-9

iv

(9)

7.9 Column 42 7-10 7.10 Column 43 (Packed or Binary Field) 7-10

7.10.1 IBM Compatible Format 7-10

7.10.2 Datapoint Compatible Format 7~10

7.11 Columns 44-51 (Field Location) 7-11

7.12 Column 52 (Decimal Positions) 7-12

7.13 Columns 53-58 (Field Name) 7-12

7.13.1 Field Names 7-12

7.13.2 Field Names in OR Relationship 7-13

7.13.3 Special Word PAGE 7~13

7.14 Columns 59-60 (Control Level) 7-14

7.14.1 L1-L9 (Control Level Indicators) 7-14

7.15 Columns 61-62 (Matching Fields) 7-15

7.15.1 Matching Fields 7-15

7.16 Columns 63-64 (Field Record Relations) 7-15 7.16.1 Record Identifying Indicators (01-99) 7-16 7.16.2 Control Level (L1-L9) and Matching Record (MR)

Indicators 7-17

7.16.3 External Indicators (U1-U8) 7-17

7.16.4 Halt Indicators (H1-H9) 7-17

7.17 Cdlumns 65-70 (Field Indicators) 7-18

7.1'7.1 Halt Indicators 7-18

7.18 Columns 71-74 7-19

7.19 Columns 75-80 (Program Identification) 7-19 8. CALCULATION SPECIFICATIONS

8.1 Columns 1-2 (Page) and 3-5 (Line) 8.2 Column 6 (Form Type)

8.3 Columns 7-8 (Control Level) 8.4 Columns 9-17 (Indicators)

8.5 Columns 18-27 and Columns 33-42 (Factor 1 & 2) 8.6 Literals

8.7 Columns 28-32 (Operation) 8.8 Columns 43-48 (Result Field) 8.9 Columns 49-51 (Field Length) 8.10 Column 52 (Decimal Positions) 8.11 Column 53 (Half Adjust)

8.12 Columns 54-59 (Resulting Indicators) 8.12.1 Columns 54-55 (Plus or High) 8.12.2 Columns 56-57 (Minus or Low):

8.12.3 Columns 58-59 (Zero or Equal) 8.13 Columns 60-74 (Comments)

8.14 Columns 75-80 (Program Identification) 8.15 Operation Codes

8.16 Arithmetic Operations 8 . 16 . 1 Add ( ADD)

8.16.2 Zero and Add (Z-ADD) 8.16.3 Subtract (SUB)

v

8-1 8-1 8-1 8-1 8-2 8-3 8-4 8-5 8-5 8-6 8-7 8-7 8-8 8-9 8-9 8-9

8-10

8-10 8-10 8-10 8-11 8-11 8-11

(10)

8.16.4 Zero and Subtr~~t (Z~SUe)

8.16.5 Multip~y (MULl)

8.16~6 Divide (DIV)

8.16.7 Move R~mainder (MVE) 8.16.8 Square Root (SQRT) 8.16.9 Cro~~foot (XFOOT) 8.17 Move Operations

8.17.1 Hove (MOVE)

8.17.2 Move Left (MOVEL) 8.17.3 Move Array (MOVEA) 8.18 Move Zone Operations

8.18.1 Move High to High Zone (MHH20) 8.18.2 Move High to Low Zone (MHLZO) 8.18.3 Move Lo~ to Low Zone (ML~ZO)

8.18.4 Move Low to High Zone (MLHZQ) 8.19 Compare and T~sting Operations

8.19.1 Compare (COMP) 8.19.2 Test Zone (TESTZ) 8.20 Binary Field Operation~

8.20.1 Set Bit On (BITON) 8.20.2 Set Bit Off (BITOF) 8.20.3 Test Bit (TESTB) 8.21 Setting Indicators

8.21.1 Set On (SETON) 8.21.2 Set Off (SETOF) 8.22 Branching Operations

8.22.1 Go To (GOTO) 8.22.2 Tag (TAG) 8.23 Lookup Operations

8.23.1 ~ookup (LOKUP)

8.23.2 Using LOKUP with One Table 8.23.3 Using LOKUP with Two Tabl~$

8.23.4 Referencing the Table Item Found 8.23.5 Using LOKUP with an Array

8.24 Subroutine Operations

8.24.1 Begin Subroutine (BEGSR) 8.24.2 End Subroutine (ENDSR) 8.24.3 Execute Subroutin~ (EXSR)

8.25 Programmed Control of Input gnd Output 8.25.1 Exception (EXCPT)

8.25.2 Force (FORCE) 8.25.3 Display (DSPLY) 8.25.4 Read (READ) 8.25.5 Chain (CHAIN)

8.25.6 Set Lower Limits Operation (SETLL) 8.26 Audio Output Operations

8.26.1 Beep (BEEP) 8.26.2 Click (CLICK)

v~

8-11 8-11 8-12 8-12 8-12 8-13 8-15 8-15 8-17 8-19 8-19 8-19 8-20 8-20 8-20 8-21 8-21 8-22 8-22 8-23 8-23 8-23 8-24 8-25 8-25 8-25 8-26 8-26 8-26 8-27 8-28 8-28 8-29 8-29 8-30 8-30 8-30 8-30 8-30 8-31 8-31 8-32 8-33 8-34 8-37 8-37 8-37 8-38

(11)

8.27 Debug Operations 8.27.1 Debug (DEBUG)

8.27.2 Debug Specifications 8.28 EXIT and RLABL Operations

8.28.1 EXIT Operation

8.28.2 RLABL Specification 8.28.3 Referencing Fields

8.28.4 Referencing Tables and Arrays 8.28.5 Referencing Indicators

9.

OUTPUT FORMAT SPECIFICATION

9.1 Columns 1-2 (Page) and Columns 3-5 (Line) 9.2 Column 6 (Form Type)

9.3 Columns 7-14 (Filename) 9.4 Column 15 (Type)

9.5 Columns 16-18 (Add a Record) 9.6 Column 16 (Fetch Overflow) 9 . 7 Col u in n s 1 7 - 22 (S pac e / Ski p ) 9.7.1 Columns 17-18 (Space) 9.7.2 Columns 19-22 (Skip)

9.8 Columns 23-31 (Output Indicators) 9.8.1 AND and OR Lines

9.8.2 External Indicators

9.8.3 Control Level Indicators 9.8.4 Overflow Indicators

9.8.5 First Page Indicator 9.9 Columns 32-37 (Field Name)

9.9 . 1 PAGE

9.9.2 Date Field

9.10 Column 38 (Edit Codes) 9.11 Column 39 (Blank After)

9.12 Columns 40-43 (End Position in Output Record) 9.13 Column 44 (Packed or Binary Field)

9.14 Columns 45-70 (Constant or Edit Word) 9.14.1 Constant

9.14.2 Edit Word

9.14.3 Editing Considerations 9.15 Columns 71-74

9.16 Columns 75-80 (Program Identification)

Appendix A. GENERATION AND USE OF RELOCATABLE RPGPLUS A.1 Compiling an RPGPLUS Program

A.2 Linking a Compiled RPGPLUS Program A.3 Running a Linked RPGPLUS Program

A.3.1 DATE Field

A.3.2 External Indicators A.3.3 Opening Files

A.3.4 Indexing ISAM (Indexed) Files

vii

8-38 8-38 8-38 8-39 8-39 8-39 8-40 8-40 8-40 9-1 9-1 9-1 9-1 9-1 9-2 9-2 9-3 9-3 9-4 9-4 9-6 9-6 9-6 '9-7 9-7 9-8 9-8 9-9 9-9 9-11 9-12 9-12 9-13 9-13 9-13 9-14 9-17 9-17 A-1 A-1 A-3 A-3 A-4 A-4 A-5 A-5

(12)

A.3.5 Console Input Files

Appendix B. RPGPLUS REFERENCE TABLES

Appendix C. RPGPLUS COMPILE TIME MESSAGES

Appendix D. RPGPLUS OBJECT (EXECUTION) TIME MESSAGES Appendix E. RPGPLUS USER ASSEMBLY LANGUAGE FACILITIES

E.1 The RPGPLUS Library Facility

E.2 RPGPLUS Calling Sequences to User Subroutines E.3 SPECIAL Device Drivers

E.4 Non-standard Tape Labels

Appendix F. GENERATION AND USE OF RPGII F.1 RPGII Generation For Cartridge Disks F.2 Selective Generation of RPGII

F.3 RPGI! Generation For Diskette Systems F.4 Compiling an RPG II Program

F.5 Running a Compiled RPG II Program F.S.1 DATE Field

F.S.2 External Indicators F.S.3 Opening Files

F.S.4 Indexing ISAM (Indexed) Files F.S.S Console Input Files

Appendix G. RPGII REFERENCE TABLES

Appendix H. RPGII COMPILE TIME MESSAGES

Appendix I. RPGII OBJECT (EXECUTION) TIME MESSAGES Appendix J. RPGII USER ASSEMBLY LANGUAGE FACILITIES

J.1 The RPG II Library Facility J.2 The RPG II Pre-processor

J.3 RPG II Calling Sequences to User Subroutines J.3.1 SPECIAL Device Drivers

J.3.2 Non-standard Tape Labels

Appendix K. DETAILED RPG OBJECT FLOW (COMMON) K.1 Initialization

K.2 Program Cycle K.3 Termination

Appendix L. COMMON REFERENCE TABLES

Appendix M. COMMON INPUT/OUTPUT DEVICE INTERFACES

viii

A-S B-1 C-1 D-1 E-1 E-1 E-2 E-2 E-4 F-1 F-1 F-1 F-3 F-4 F-5 F-S F-S F-6 F-6 F-7 G-1 H-1

1-1

J-1 J-1 J-2 J-4 J-4 J-S K-1 K-1 K-1 K-4 L-1 M-1

(13)

Appendix N. CODING SHEET SUMMARY (COMMON) N.1 Common Fields

N.2 Header Specification

N.3 File Description Specifications N.4 Extension Specifications

N.5 Line Counter Specifications N.6 Input Record Descriptions

N.6.1 Record Type Definition N.6.2 And/Or Line

N.6.3 Field Definitions N.7 Calculation Specifications N.B Output Format Specifications

N.8.1 Record Type Definition N.8.2 And/Or Line

N.8.3 Record Formats and Field Editing

ix

N-1 N-1 N-2 N-4 N-9 N-12 N-13 N-13 N-14 N-15 N-17 N-25 N-25 N-27 N-27

(14)
(15)

CHAPTER 1. INTRODUCTION

RPG II is a language oriented for business data processing.

This document specifies RPG II for Datapoint systems. Source programs and data can be prepared using RPGPREP, CRPGPREP, or DAT AFORM II.

After preparing the source program, one of the RPG II compilers must be run to produce the object program. RPGII object program output is directly executable under DOS, whereas the object

program produced by RPGPLUS must be subsequently link edited

(using the LINK utility) to produce a self-contained program which executes under DOS.

RPG source programs are rigidly formatted. In the subsequent

text, source records will be referred to as if they were 80-column card images.

1.1 Installing The RPG II Compiler

Complete instructions for installating RPGPLUS are given in Appendix A; installation instructions for RPGII are given in Appendix F. The appendix also contains detailed instructions for compiling programs and indexing ISAM (Indexed Sequential Access Method) files.

1.2 Required Utility Programs

The following utilities at the indicated version/revision levels (or higher) are required for full utilization of RPG II:

RPGPREP CRPGPREP INDEX REFORMAT SORT LINK

RPG Program Preparation Utility (DOS).

RPG Program Preparation Utility (Cassette).

DOS Index Utility.

DOS Reformat Utility.

Disk Operating System Sort.

DOS Linking Editor for Relocatable Modules (required for RPGPLUS only)

CHAPTER 1 . INTRODUCTIOU 1-1

(16)

Note: Records output using the DOS SORT utility will be in ASCII sequence, unless specified otherwise.

1.3 Definition of Terms

EBCDIC (Extended Binary-Code-Decimal Interchange Code) Notation:

The 256-character machine code used inside the Datapoint RPG II system. Files are automatically translated to EBCDIC when read, and from EBCDIC to ASCII (if necessary) when written.

Alphabetic Characters: The 26 alphabetic EBCDIC characters and the three EBCDIC characters ' . ' , '$', and

'H'.

Numeric Characters: The EBCDIC characters 0-9.

Special Characters: The 217 EBCDIC characters not defined as alphabetic or numeric.

Alphanumeric Characters: Any of the 256 EBCDIC characters.

Alphanumeric Fields: All fields for which a decimal-positions speCification has not been made in the appropriate column of the specifications forms. Alphanumeric fields can contain

alphabetic, numeric, or special characters.

Numeric Fields: All fields having a decimal-positions

specification in the appropriate columns of the specifications forms.

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

RPG II filenames can be from 1-8 characters long; RPG II field names can be from 1-6 characters long.

The first character of either a filename or a field name must be alphabetic (see preceding definitions of alphabetic

characters). The remaining characters can be any combination of alphabetic and numeric characters (special characters are not allowed).

Blanks cannot appear between characters in the name.

1-2 REPORT PROGRAM GENERATOR II

(17)

1.4 General Datapoint RPG II Program Logic

Every Datapoint RPG II object program has the same general program logic. This logic is based on the processing cycle performed for each input record read. Every program cycle involves three basic steps.

1. Reading information (input).

2~ Performing calculations (processing).

3. Recording results (output).

In the RPG II cycle, calculation and output can occur at two different times in the cycle: total time and detail time.

1.4.1 Operations at Total Time

Total calculation and output are normally performed on data accumulated for a group of related records which form a control group. When the fields of a record whioh determine the control group change, a control break occurs indicating a new control group is starting. When a break occurs (shown by control level indicators being turned on), calculation and output operations are performed using information accumulated from all records in the previous control group.

1.4.2 Operations at Detail Time

Detail calculations and detail output are normally performed for individual data records. Total operations are performed

before detail operations. Thus a record which causes a control break is processed after the total operations for the previous control group.

1.4.3 General Program Cycle

An RPG object program proceeds through three major steps:

1. Initialization 2. Processing Cycle 3. Termination

CHAPTER 1 . INTRODUCTION 1-3

(18)

Initialization consists of:

clearing all working areas, processing cycle.

loading all necessary tables, and opening all files for the

The processing cycle consists of: writing all heading and detail records, reading the next input record and identifying it,

performing total operations if a control break occurs, and then calculating all results from the record previously read. This cycle repeats until the last record is processed.

The first and last cycles are somewhat different from the normal cycle. Before the first record is read, detail output conditioned by the 1P indicator and unconditioned detail output is performed.

Total processing is bypassed until the cycle after the first control break.

After the last record has been read, the last record indicator (LR) is turned on, as well as all control levels. After total processing has been performed, the normal cycle is aborted and the termination routines are processed.

Termination consists of: writing all necessary tables and closing all files.

A detailed description of the object program logic is found in Appendix K.

1.5 Source File Order and Program Specifications

The RPG source file consists of a source program, optionally followed by compile-time tables and arrays. The source file

contains up to seven sections which can be coded on seven standard RPG specification sheets and entered using the RPGPREP utility program. The seven forms are:

1. Header Specification. This specification contains control information for the compiler.

2. File Description Specification. This specification contains file description information about each file used in the program.

3. Extension Specification. This specification contains extension information about each table or array used in the program.

4. Line Counter Specification. This specification contains information about the number of lines to be printed on each

1-4 REPORT PROGRAM GENERATOR II

(19)

form.

5. Input Specification. This specification contains information describing the records read by the program.

HOTE: In all versions of RPGII, the order of references to files in the Input Specifications must correspond to the order of occurrence of file declarations in the File Specifications.

This is not a restriction in RPGPLUS.

6. Calculation Specification. This specification describes all calculations performed by the program.

7. Output Format Specification. This specification describes the format of all records written by the program.

The first part of the source program may end wi th: a normal EDIT end-of-file, a record containing '/*b' in columns 1-3, or a record containing '**b' in columns 1-3 (where b indicates a

blank). The"first two cases signify the end of the source program; the last case signifies that a user library inclusion and/or compile-time tables follow the source program.

If code from a user library is required, (see Appendices E and I for details), a library inclusion record must immediately follow the '**b' record. A user library is required for SPECIAL

input-output devices and non-standard tape labels. The EXIT operation (see Chapter 8) also requires a user library. The format of a library inclusion is: '*LIBRARY' in columns 1-8,

followed by one or more blanks, followed by a DOS file name. If no extension is supplied, the extension 'REL' is assumed by RPGPLUS;

RPGII uses 'RPG' as the default. If compile-time tables are also used, a '**b' record should follow the library inclusion.

Compile-time tables follow the first '**b' record if no library is included, or the second '**b' record if one is used. Each

compile-time table must appear in the order specified on the extension sheets, and must be separated by '**b' records. See Chapter 5 for a description of tables and arrays.

After any of the preceding optional sections have appeared, the source file should terminate with either an EDIT end-of-file or a record containing '/*b' in columns 1-3.

CHAPTER 1 . INTRODUCTION 1-5

(20)
(21)

CHAPTER 2. COMMON FIELDS ON SOURCE

This chapter defines entries common to all RPG coding sheets.

Each coding sheet contains the following entries:

1. Columns 1-2 (PAGE).

2. Columns 3-5 (LINE).

3. Column 6 (FORM TYPE).

4. Column 7 (COMMENTS).

5. Columns 75-80 (PROGRAM IDENTIFICATION).

2.1 Columns 1-2 (Page) Entry Explanation 01-99 Page number.

Columns 1-2 are for numbering the specification sheets used in a job. You can use more than one of each sheet, but all sheets of the same type must be kept together. When all the specifications sheets are filled out, arrange them in the following order and number them in ascending sequence:

1 • Header Card.

2. File Description.

3. Extension.

4 • Line Counter.

5. Input.

6. Calculation.

7. Output Format.

CHAPTER 2. COMMON FIELDS ON SOURCE 2-1

(22)

2.2 Columns 3-5 (Line) Entry

Any numbers

Explanation Line numbers.

Columns 3-5 are used to number the lines on each sheet. Columns 3-4 contain preprinted line numbers, so in most cases line

numbering is already done. The unnumbered lines below the

preprinted numbers can be used for additional lines or to insert a line between two other completed lines. Any other lines on the sheets can be skipped. The line numbers used need not be

consecutive, but should be in ascending order. Line numbers are optional. Note: RPGPREP automatically supplies line numbers.

Column 5 is always set to zero to allow later insertion of up to nine new lines.

2.3 Column 6 (Form Type) Entry

H F E L I C

o

Explanation Header.

File Description Specifications.

Extension Specifications.

Line Counter Specifications.

Input Specifications.

Calculation Specifications.

Output Format Specifications.

Column 6 contains a code for each type of source statement.

2.4 Column 7 (Comments) Entry Explanation

*

Comment line.

You may want to write comments to help you understand or remember what is being done in a certain section of coding. Datapoint RPG

2-2 REPORT PROGRAM GENERATOR II

(23)

II allows an entire line to be used for these comments. The comment line is identified by placing an asterisk in column 7.

Any characters in the character set may be used in a comment line.

Comments are not instructions to the RPG II program. They serve only as a means of documenting the program. A comment line cannot be written in the header card specifications line.

2.5 Columns 75-80 (Program Identification)

Columns 75-80 on all source program cards may contain any characters. These columns may use the program name, or the columns may contain any other characters to identify a certain portion of the program. These entries are ignored by the compiler, but will appear in the source program listing.

Note: Any entry made in these columns on the header specification will be automatically placed into these columns of each source statement by RPGPREP.

CHAPTER 2. COMMON FIELDS ON SOURCE 2-3

(24)
(25)

CHAPTER 3. HEADER SPECIFICATION

One header line is required for every program. It provides information about your program and your system to the RPG II

compiler. Without this information your source program cannot be translated into an RPG II object program.

3.1 Columns 1-2 (Page) and 3-5 (Line)

The he a d e r 1 i n emu s t a l way s be 1 i n e " 0 1 0" ( col u m n s 3 - 5 ) . Refer to Chapter 2 for additional details.

3.2 Column 6 (Form Type)

An H must appear in column 6. A header line with an H in column 6 must be entered for every program even if all other columns are left blank.

3.3 Columns 7-9

Columns 7-9 are not used. The program is compiled in the available core storage.

3.4 Column 10 (Object Output)

Column 10 is checked and if it contains neither C, D, or blank, a warning is produced. The program identification is ignored. No object program is produced when severe (terminal) errors are present in the source statements.

3.5 Column 11 (Listing Options) Entry

Blank

B

Explanation

1. The object program is produced (if no severe errors are found).

2. The program listing is printed.

1. The object program is produced (if no severe errors are found).

CHAPTER 3. HEADER SPECIFICATION 3-1

(26)

2. The program listing is not printed.

Column 11 provides for listing options at the time your source program is compiled. If any severe errors are found during compilation, the system halts after completing the listing

(provided a listing is to be printed).

The blank entry is the usual case, producing an object program (if no severe errors are found) and a source program listing. The program listing consists of the source program, error messages, and a core map. The core map lists such information as relative addresses of fields, constants, and 1/0 areas. The core map is printed only if the program is successfully compiled. The B entry means that no program listing is printed; however, an object

program is produced.

3.6 Columns 12-14 (Core Size to Execute)

Core Size to Execute is documentary only in Datapoint RPG and does not affect program execution in any way!

3.6.1 Column 12 Entry

Blank, Q

H T

Explanation

No additional 256-byte increments are needed.

One additional 256-byte increment is needed.

Two additional 256-byte increments are needed (512 bytes).

Three additional 256-byte increments are needed (768 bytes).

Column 12 may be used to specify additional 256-byte increments of storage. These increments document an extra 1/4K, 1/2K or 3/4K of storage to be required in addition to the storage specified in columns 13-14.

3-2 REPORT PROGRAM GENERATOR II

(27)

3.6.2 Columns 13-14

Entry Explanation

Blank The core storage required for object program

execution is the same as that used to compile the program.

01-13 The core storage required for program execution (if different from core storage available for object program generation).

Use columns 13-14 to specify some multiple of 1K bytes of storage (K=1024). Columns 13-14 document the core storage required for program execution. The entry must end in column 14.

3.7 Column 15 (Debug) Entry Explanation

Blank DEBUG operation is not performed.

DEBUG operation is performed.

In order to perform a DEBUG operation:

1. A 1 must appear in column 15 when the source program is compiled.

2. The DEBUG operation code must appear in calculation specifications.

3.8 Columns 16-25

Columns 16-25 are not used. Leave them blank.

3.9 Column 26 (Alternate Collating Sequence) Entry Explanation

Blank Normal (EBCDIC) collating sequence is used.

A ASCII collating sequence is used.

CHAPTER 3. HEADER SPECIFICATION 3-3

(28)

Use column 26 if job collating sequence is in ASCII. Sequence checking, comparisons and indexed disk files will be processed in ASCII sequence.

Using the ASCII collating sequence is recommended since it is the normal sequence used by other Datapoint software. The collating sequence used in an RPG program must agree with the collating sequence used to INDEX or SORT files.

3.10 Columns 27-74

Columns 27-74 are not used. Leave them blank.

3.11 Columns 15-80 (Program Identification) See Chapter 2.

CONTROL CARD SPECIFICATION

""OGRAM _ _ _ _ _ PROGRAMMER . _ _ DAIE _ _ _ _ _ PAGE_DF_PAGES

Figure 3-1. Example of a Header Specification.

3-4 REPORT PROGRAM GENERATOR II

(29)

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS

File description specifications are required for every file used by a program. Write these specifications on the File

Description Sheet. At least one line is needed to describe a file. Datapoint RPG will allow a maximum of 24 file description entries.

4.1 Columns 1-2 (Page) and 3-5 (Line) Refer to Chapter 2.

4.2 Column 6 (Form Type)

An F must appear in column 6.

4.3 Columns 1-14 (File Name)

Use columns 7-14 to assign.a unique filename to every file used in your program except compile-time table and array files, which must not be named on the File Description Sheet. (Compile time tablesarld arrays are described on the Extension Sheet). The filename can be from 1-8 characters long, must begin in column 7, and must be a valid RPG II name. The filename can be the same as a field name.

Pre-execution time table and array files are described on the File Description Sheet.

The entry in this field may be the same as the DOS file name used when executing this program or it may be completely internal to the program. See Column 53 (Continuation Code) for details.

When assigning file names for processing existing indexed files, the file name should refer to the index to be used. The associated data file will be selected whenever the index is referenced.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-1

(30)

4.4 Column 15 (File Type) Entry Explanation I Input file

0 Output file

U Update file

D Display file

Use column 15 to identify the way in which your program uses the file. All input file descriptions must preceed other file

descriptions.

4.4.1 Input File

Input files are records that a program uses as a source of data. When input files are described in a program it indicates that records are to be read from the file. All input files except table and array files must be further described on the Input

Sheet. Table and array files must be further described on the Extension Sheet.

4.4.2 Output Files

Output files are records that are written or printed by a program. All output files, except table and array output files, must be further described on the Output Format Sheet.

4.4.3 Update Files

Update files are disk files from which a program reads a record, updates fields in the record, and writes the record back in the location from which it was read. Update files- must be

further described on both the Input Sheet and Output-Format Sheet.

A chained file or a demand file may be updated at detail time, at total time or exception time. All other disk files can be updated only at detail time during the same program cycle that reads the record.

4-2 REPORT PROGRAM GENERATOR II

(31)

4.4.4 Display Files

A display file is a collection of information from fields used by a program. The DSPLY operation code must be used on the Calculation Sheet in order to display a field or record directly from storage and/or key data into a field or record in storage.

Display files need only be described on the File Description Sheet. The device associated with a display file must be a

keyboard-display (CONSOLE). See Operation Codes, DSPLY in Chapter 8 for more information.

4.5 Column 16 (File Designation) Entry Explanation

P Primary file S Secondary file C Chained file

R Record address file

T Table or array file (pre-execution time ta bles or arrays)

D Demand file

Use col u m n 1 6 tofu r the rid en t i f Y the use 0 f in put, up d ate, an d chained files. Leave the column blank for display files and all output files except chained and table output files.

4.5.1 Primary Files

A primary file .is the main file from which a program reads records. In multifile processing the primary file is used to control the order in which records are selected for processing.

It can be an input or update file. In programs that read records from only one file, that file is the primary file. Every program must have one and only one primary file. The primary file

description must be the first file description entry.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-3

(32)

4.5.2 Secondary Files

Secondary files apply to programs that do multifile

processing. All of the files involved in multifile processing, except the primary file, are secondary files. A secondary file c an be an inpu t, or upda te fi Ie. Second ary f i I es are proc ess ed in the order in which they are written in the file description

specifications, except when matching records (MR) or when the FORCE operation is used. Note that table, chained, and demand files are not involved in record selection in multifile

processing.

ij.5.3 Chained Files

A chained file is a disk file that is read or written

randomly via the CHAIN operation code. A chained file can be an input, output, or update file. If it is output and indexed, the A option must be specified in column 66. This is because a chained, indexed file must have an index built using the INDEX Utility

program. If this has been done, the file already exists and any r e cor d s wr itt e n are a p pen de d to the ex i s tin g f i Ie, an din s e r ted into the index.

4.5.4 Record Address Files

A record address file is an input file that indicates which records are to be read from a disk file and the order in which the records are to be read from the disk file. You cannot use more than one record address file per disk file. All record address files must be further defined in extension specifications.

Record address files contain binary relative record addresses and are called ADDROUT (address output) files. They are disk files produced by the DOS SORT program and can be used with any type of disk file. See Column 28 (Mode of Processing), By ADDROUT File, in this chapter for more information. .

4.5.5 Table or Array Files

A table or array file is an input or output file that

contains table or array entries. The entries can be read into the

pfogr~~ from a table input file immediately before execution of the program. Only pre-execution time tables or arrays are

described on the File Description Sheet. However, both

pre-execution and compile time tables and arrays must be described

4-4 REPORT PROGRAM GEIJERATOR II

(33)

in the Extension Sheet.

A table or array output file (written after LR output) can be defined and used as a normal output file and does not require an entry in column 16. If the only output to the file is tables and arrays, the file should be designated as a table output file.

Table and array files are not involved in record selection and processing. They are only a means of supplying entries for tables or arrays used by the program. When table or array files are read during the execution of the program, the program reads all the entries from the table or array files before it begins record processing. See Chapter 5 for additional information.

4.5.6 Demand Files

Demand files can be input or update files. The READ

operation code must be used on the Calculation Sheet in order to read consecutively from a demand file. Demand files can only be processed consecutively. See Operation Codes, READ in Chapter 8 for a discussion of processing demand files.

4.6 Column 17 (End of File) Entry

E

Blank

Explanation

All records from the file must be processed before the program can end.

1. The program can end whether or not all of the records from the file have been processed.

2. If column 17 is blank for all of the files, all records from every file must be processed before the program can end.

Column 17 applies to programs that perform multifile processing.

Use it to indicate whether or not the program can end before all of the records from the file are processed. It applies only to input and update files that are used as primary or secondary files.

If the records from all the files must be processed, column 17 must be blank for all files, or contain E's for all files.

A program that performs multifile processing could reach the end

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-5

(34)

of one file before reaching the end of the others. It therefore needs some indication of whether it is to continue reading records from the other files or end the program. An entry in column 17 in the descriptions of the files provides that indication.

4.7 Column 18 (Sequence) Entry

A

D Blank

Explanation

Sequence checking is to be done. Records in the file are in ascending order.

Sequence checking is to be done. Records in the file are in descending order.

No sequen6e checking is to be done.

Column 18 applies to update files, and all input files except table, array, chained, and demand files. Leave column 18 blank for output, display, table or array files, and chained files. Use it to indicate whether or not the program is to check the sequence of the records. Use columns 61-62 on the Input Sheet to identify the matching fields containing the sequence information. The

proper collating sequence for sequence checking (EBCDIC or ASCII) is determined by column 26 in the Control Card Specification.

Sequence checking is required when matching fields are used in the records from the file. When a record from a matching input file is out of sequence, the program halts, and the operator has three options:

1. Bypass the record out of sequence and read the next record from the same file (BYPASS option).

2. Bypass the record out of sequence, turn on the LR indicator and perform all end-of-job and final total procedures (CANCEL option).

3. Immediately discontinue program execution (ABORT option).

See Appendix A (RPGPLUS) or F (RPGII) for a detailed description of operating procedures.

4-6 REPORT PROGRAM GENERATOR II

(35)

4.8 Column 19 (File Format) Entry Explanation

F Fixed-length records.

v

Variable-length records.

In Datapoint RPG II there are two types of file organizations, fixed and variable. Disk and cassette files may be either; files on other devices must be fixed. For cassette input either 'F' or

'V' may be used, with no effect on program execution.

4.8.1 Fixed Format Files

These files have definite record length and are not subject to special processing. Disk files to be updated or processed

randomly must be fixed format. See Appendix M for further details about fixed-format disk files. Cassette output file records will be written without space compression if an 'F' is used in column 19.

4.8.2 Variable Format Files

These files have a maximum record length ~nd are compatible with Datapoint software using the sequential record format such as the general purpose editor program EDIT. On input, blanks are expanded; on output, blanks are compressed. See Appendix M for further details about variable-format disk files. Cassette output files will be written with space compression if a 'V' is used in column 19.

4.9 Columns 20-23 (Block Length) Entry Explanation

Number Length of block.

Blank Default block length.

These columns have differing interpretations depending on the device assigned for the file (see Columns 40-46). If an entry is s p e c i fie d, it m u s ten din col urn n 23. Lea din g z e r 0 s rna y be

omitted.

CHAPTER 4.· FILE DESCRIPTION SPECIFICATIONS 4-7

(36)

4.9.1 Disk Files

The block length for fixed-format disk files may be a multiple of the record length. This is allowed for language

compatibility, however, Datapoint RPG will always assign the most efficient block length. For variable-format disk files these columns must either be blank or equal to the record length.

4.9.2 Tape Files

These columns may either be blank or contain a multiple of the record.length. In order to properly process tape input files, the block length entry used must be the same as the block length used when the tape file was written.

4.9.3 Other Files

These columns must either be blank or contain the record length.

4.10 Columns 24-27 (Record Length) Entry

Number

Explanation

The number of characters used in each record (limited by the device used).

Use columns 24-27 to indicate the length of the records in the file. For variable-format files the record length defines the maximum size of a record. The actual size is determined by the data read or written. For fixed-format files, information is

transferred in units of the record length. All of the records in one file must be the same length. (For update files, the length of a record after it is updated must be the same as before it was updated). The maximum record length allowed and the size of the IIO area assigned depend upon the device assigned to the file.

The record length specified may be shorter than the maximum length for the device. The entry placed in these columns must end in column 27. Leading zeros can be omitted.

4-3 REPORT PROGRAM GENERATOR II

(37)

4.11 Column 28 (Mode of Processing) Entry Explanation

L Sequential within limits.

R 1 • Random by relative record number.

2. Random by key.

3. By ADDROUT file.

4 • Direct file load (random load) . Blank 1 • Sequential by key.

2. Consecutive.

Use column 28 to indicate the method by which records are to be processed. Only indexed disk files can be processed sequentially by key or within limits. Disk files that are indexed, chained or controlled-by an ADDROUT file can be processed randomly. All other files must be processed consecutively.

Column 31 is used to further identify the processing method. See column 31 (Record Address Type) in this chapter.

4.11.1 Consecutive Method

The consecutive method applies to all files. During

consecutive processing records are read in the order in which they physically appear in the file. The contents of spaces left for missing records in direct (fixed-format) files are read as though the records were there. (Such spaces are filled with blanks).

The program reads records from the file until either the end of that file is reached or the program ends due to the end-of-file condition of another file. See column 17, End of File, in this chapter for more information about the second condition.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-9

(38)

4.11.2 By ADDROUT File

An ADDROUT (address output) file is a record address file produced by the DOS SORT Program. It is a file of 3-byte disk records containing binary relative record addresses of records in a disk file. RPG II locates and reads the record at the specified address in the original disk file. Records are read in this

manner until either the end of the ADDROUT file is reached or the program ends due to the end-of-file condition of another file.

See Column 17, End of File in this chapter for more information about the second condition.

4.11.3 Sequential By Key

Processing sequentially by key applies only to indexed disk files that are used as primary, secondary or demand files.

Records are read in ascending key sequence established when the file was INDEXed by the INDEX utility program (See Appendices A/F). The alternate collating sequence option (Column 26 in the Header Specification) must agree with the option used when

INDEXing the file (EBCDIC or ASCII). The program reads records from the file until either the end of that file is reached or the program ends due to the end-of-file condition of another file. See column 17, End of File, in this chapter for more information about the second condition.

4.11.4 Sequential Within Limits

Sequential within limits processing is accomplished using the SETLL operation code during calculations. The SETLL operation code is used to establish a lower limit for sequentially processing primary, secondary, or demand files. The upper limit (if not end-of-file) must be checked using the COMP operation code.

When using SETLL with primary and secondary files, care should be exercised to discard the first record read (as part of the normal input cycle) prior to entering calculations and executing the first SETLL. (See Operation Codes, SETLL in Chapter 8).

4-10 REPORT PROGRAM GENERATOR II

(39)

4.11.5 Random Method

Two methods, random by relative record number and random by key, apply to chained files only. They require the use of the CHAIN operation code. The records of a file to be read or written must be processed by the CHAIN operation code. The records are read or written only when the CHAIN statements that identify them are executed.

When processing fixed blocked disk files "directly" (without using an ISAM index), relative record numbers are used to identify the records. Relative record numbers identify the positions of the records relative to the beginning of the file. For example, the relative record numbers of the first, fifth, and seventh records

in a file are 1, 5, and 7 respectively. (See Operation Codes, CHAIN in Chapter 8).

For indexed files, record keys must be used to locate the records.

A record key is the information used to match unique data in a field in each record that is used to identify that record. Record key fields are defined when a fixed blocked disk file is indexed with the INDEX utility program (See Appendices A/F).

Records are read during the calculation phase of the program.

Therefore, fields from these records can be used during detail or total calculations. Note then, that fields of records read from chained update files can be read and altered during calculations and the records can be updated (written back on the file with alterations) during output.

4.12 Columns 29-30 (Length of Key) Entry Explanation

Number Length of record key or ADDROUT file record

Columns 29-30 apply only to indexed disk files and record address files. Enter:

1. The length of the record keys in indexed files.

2. The length of the records in ADDROUT files.

All of the key fields in the records in an indexed file must be the same length. The maximum is 99 bytes. All of the records in an ADDROUT file have a length of three. A leading zero is not

required.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-11

(40)

4.13 Column 31 (Record Address Type) Entry

A

I

Blank

Explanation

Record keys in unpacked format are used in processing indexed files.

The file is being processed by means of an ADDROUT file or the file is an ADDROUT file.

1. Relative record numbers are used in processing sequential and direct files.

2. A sequential or direct file is being loaded.

3. Records are read consecutively.

Column 31 indicates the way in which records in a disk file are identified.

4.14 Column 32 (File Organization) Entry Explanation

I Indexed file.

T ADDROUT file.

Blank Sequential file or direct file.

1-9 Additional 1/0 areas (ignored).

Use column 32 to identify indexed and ADDROUT files. See Column 28, Mode of Processing for further details. A digit is allowed in this column for compatibility with other RPG systems, but has no effect on the execution of the program.

4-12 REPORT PROGRAM GENERATOR II

(41)

4.15 Columns 33-34 (Overflow Indicator) Entry Explanation

An overflow indicator is used to condition OA-OG,

OV records in the file. The indicator specified is the one used.

Blank No overflow indicator is used.

Columns 33-34 apply to the output file assigned to the printer.

Use "these columns to indicate that you are using an overflow indicator to condition records being printed in the file. Any overflow indicators used in a program must be unique for the output file assigned to the printer. Note that only one overflow indicator can be assigned to a file. Do not assign overflow indicators to a console file.

4.15.1 Overflow Indicator

Overflow indicators are used only with printer files, primarily to condition the printing of heading lines. If you intend to use an overflow indicator to condition output lines on the printer, you must assign an overflow indicator to the printer file on the File Description Sheet (columns 33-34). The same indicator must be used to condition all lines that are to be written only when overflow occurs.

If the destination of a space/skip or print operation is a line beyond the overflow line, the overflow indicator is turned on and remains on until all overflow lines are printed. However, if a skip or space is specified that advances the form past the

overflow line to the first line or past the first line on a new page, the overflow indicator does not turn on.

If an overflow indicator is used as a conditioning indicator, it indicates that output is to be performed at overflow time. This applies whether or not the line conditioned by the indicator is in an AND or OR relationship with other indicators.

The overflow indicator may be set by the SETON or SETOF operation code. After all total records have been written, however, the

indicator is set as it normally is in accord with the overflow line.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-13

(42)

4.16 Columns 35-38 (Key Field Starting Location) Entry Explanation

1-255 Record position in which the key field begins.

Columns 35-38 apply to indexed files only. An entry must be made in these columns for an indexed disk file. Enter the location in which the key field begins in indexed file records.

The number entered must end in column 38. Leading zeros can be omitted.

4.17 Column 39 (Extension Code) E

L

Extension specifications further describe the file.

Line counter specifications further describe the file.

Column 39 applies to (1) table and array files that are to be read during program execution, (2) record address files, and (3) the output file assigned to the printer. Output files that are

assigned to the printer can be described on the Line Counter

Sheet. Ta bles, ar r ay, an d recor d addr es s files mus t be desc r i bed on the Extension Sheet. If tables are output to the printer 'E' should not be used.

4.18 Column 40-46 (Device) Entry Explanation PRINTER Printer.

CONSOLE Keyboard Display.

DISK Disk.

READER Card Reader.

TAPE Industry-compatible 9 track tape unit.

CASSET1 Rear tape cassette.

CASSET2 Front tape cassette.

4-14 REPORT PROGRAM GENERATOR II

(43)

LOADER SPECIAL

Pseudo-device for use with the. DOS CHAIN command Special input/output device not supported by Datapoint RPG II. (See Appendix F).

These columns are used to specify the input/output device to be used for the file. All entries begin in column 40. The devices that can be used depend upon the type of file access specified.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-15

(44)

FILE

Primary or Secondary Input

Chained Input Files

Update Files (Primary, Secondary, or Chained) Output Files

Display File DOS Chaining Special Files

AVAILABLE DEVICES MEDIA

Disk Cards

Tape(800 BPI) Tape(1600 BPI) Cassette

Keyed In Disk Di sk

Di sk

Tape(SOO BPI) Tape(1600 BPI) Cassette

Printed CRT CRT none unknown

DEVICES

DISK (fixed or variable format) READER

TAPE TAPE

CASSET1 or CASSET2 CONSOLE

MAXIMUM BLOCK LENGTH 9999 SO 1057 2048 249 78 DISK (fixed format) 9999 DISK (fixed format) 9999

DISK, (fixed or 9999 variable format)

TAPE 1057

TAPE 2048

CASSET1 or CASSET2 249

PRINTER 132

CONSOLE SO

CONSOLE 80

LOADER SO

SPECIAL 9999

4-16 REPORT PROGRAM GENERATOR II

(45)

4.18.1 Use of the LOADER Device for Program Chaining

This device may be used to construct a command line to be executed by the DOS command processor after the normal end of an RPG II object program. The LOADER must be used as an output file, and the command line can typically be written during the last total cycle (LR-time). The simplest use of the LOADER is to invoke some other program, for example, the DOS SORT. By

constructing a sequence of DOS commands on some disk file and then wri ting "CHAIN file" on the LOADER, where "file" is the DOS name of the command file, more complex sequences may be realized.

Only one record may be written on the LOADER during the execution of the object program. If the object program aborts, rather than concluding normally, the command line is ignored.

4.18.2 SPECIAL Device Support

You can process files using devices not supported by

Datapoint RPG II. To do this, you must indicate that the file will be handled by a SPECIAL device (SPECIAL in columns 40-46 of the File Description Sheet). You must also supply a subroutine to perform the 1/0 operations required to transfer data between the SPECIAL device and core storage (subroutine name in columns 54-59 of the File Description Sheet).

The following can be used with SPECIAL files:

FORCE operation code.

READ operation code.

The following cannot be used with SPECIAL files:

CHAIN operation code.

Spacing and skipping.

SPECIAL files can only be processed consecutively. See Appendix E for the conventions used by RPGPLUS to call the input-output

subroutine; Appendix I gives the RPGII conventions.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-17

(46)

4.19 Columns 47-52

These columns are not used and should be left blank.

4.20 Columns 53-65 (Continuation Lines)

4.20.1 Column 53 (Continuation Code) Entry Explanation

A Assign disk file name at run-time.

D Disk file name defined at compile-time.

S Standard labels are used.

N Non-standard labels are used.

U No labels are used.

K Continuation Record.

If the file being defined is a disk file, column 53 may contain 'A' or 'D'. (If it is left blank, 'A' is assumed.) When the 'A' entry is used, the object program will ask for the DOS external file name to assign to the current internal file. When the 'D' entry is used, the external file name is assumed to be the same as the internal file name. See Appendix A and the 'EXTDRV' entry in columns 54-59 for additional information.

Column 53 must contain'S', 'N', or 'U' if the file is a tape file. If non-standard labels are being used, columns 54-59 must contain the name of the user-supplied subroutine for processing the labels. (See Appendices Ell for calling conventions.)

If the preceding File Description line describes an ASCII tape file, column 53 must contain 'K' and columns 54-59 must contain

'ASCII'.

If the preceding File Description line describes a disk or printer file, column 53 may contain a 'K', in which case columns 54-65 contain additional file specifications. See the following

discussion.

4-18 REPORT PROGRAM GENERATOR II

(47)

4.20.2 Columns 54-59 (Continuation Option) Entry

EXTDRV

MAXSEC LOCAL SERVO

ASCII _ 800 or

1600

Explanation

Extension and/or drive for disk file (Used to specify the extension and/or disk drive assigned for defined DISK files (see Column 53 above).

Maximum number of sectors for new disk files.

The Local printer is used at object (execution) time.

The Servo printer is used at object (execution) time. (The DEVICE in the preceding File

Description line must be PRINTER).

TAPE file written in ASCII.

Tape density(if not given for a tape file 800bpi is assumed).

4.20.2.1 Columns 54-59 (Name of Label Exit) Entry

RPG name

Blank

Explanation

Name of the user-written subroutine which will perform the I/O operation for a SPECIAL device, or which will process non-standard tape labels.

No SPECIAL device or non-standard labels are being used.

Columns 54-59 must contain an entry for each data file assigned to a SPECIAL device or to a TAPE file with non-standard labels.

These columns are used to specify the subroutine which will perform the input/output operations for a file assigned to a SPECIAL device or for non-standard tape label processing. The subroutine name entered in columns 54-59 can be from one to six characters long, and must be a valid RPG II name.

CHAPTER 4. FILE DESCRIPTION SPECIFICATIONS 4-19

(48)

4.20.2.2 Columns 60-62 (Extension)

Use these columns on a continuation card with the 'EXTDRV' entry in columns 54-59 to specify the extension to be used for a

(compile-time) defined disk file. Datapoint RPG assumes an

extension of 'TXT' for all disk files except ISAM files. For ISAM files, an extension of 'lSI' is assumed.

4.20.2.3 Columns 63-65 (Drive)

Use these columns to specify the drive for a compile-time defined disk file. Single-digit drive numbers are specified by

'DRO' through 'DR9' or by 'DOO' through 'DOg'. Double-digit drive

number~ are specified by 'DOO' through 'D15'.

Either entry (EXT or DRV) can be specified, or left blank. If an entry is left blank, 'ITXT' is assumed for the extension, and any drive, starting with ':DRO', is assumed for the drive. Do not specify the initial 'I' on the extension, or the ,., on the drive.

See the DOS manuals for further details.

4.20.2.4 Columns 60-65 (Number of Sectors)

These columns may be specified on a continuation card with the 'MAXSEC' entry in columns 54-59 to specify the LRN limit to be used for any disk file which may be created by the object program.

This entry no longer has any effect in Datapoint RPG.

4.20.2.5 LOCAL/SERVO Continuation Option

For files assigned to the printer, you may specify whether a local or servo printer will be used at execution time by means of a continuation card. If no specification is given local printer is assumed.

4.20.2.6 ASCII Continuation Option

The ASCII continuation option is used for a tape file written in ASCII. If the tape file is in ASCII format this option must be used.

4-20 REPORT PROGRAM GENERATOR II

Références

Documents relatifs

The FILE ALREADY EXISTS message will be displayed when a user or program is trying to create or rename a specific file which already exists on disk. The

The controller connected to port B can read and write the attention summary register (RMAS), but it can- not write any other register in the drive, and it will read all

An error occurred while reading from an input device during a LOAD command. Do not press CONT, because that will cause further

The specified data file may be read from and/or written to in units of fixed-length records. The record to be accessed next is specified in the data transfer

in which the disks are copied is you sequence of the following instructions, undesirable Log onto a disk drive which contains the TurboDOS occur.. COPY.CMD or .COM program in

The specified number of records are read from the file address specified by the Random' Record field into the disk transfer address.. If end-of-file is reached

Disk Trace - Data that is read from, or written on, the disk during execution of the object program is traced and printed with the control field of the read or

Cause: Operating or programming error. Operator: If you are running a procedure, this message indicates a programming error. If you are enteril')g OCL statements from the keyboard,