• Aucun résultat trouvé

It System/360

N/A
N/A
Protected

Academic year: 2022

Partager "It System/360"

Copied!
519
0
0

Texte intégral

(1)

Systems Reference Library

IBM System/360 Operating System PLII (F)

Programmer's Guide

Program Number 360S-NL-Sll

File No. 5360-29

OS

Order No. GC28-6594-7

This publication is a companion volume to IBM System/360 Operating System: PL/I (F) Language Reference Manual, Form C28-8201. Together, the two books form a guide to the

writing and execution of PL/I programs under the control of an IBM System/360 Operating System that includes the PL/I

(F) Compiler. The Programmer's Guide is concerned with the relationship between a PL/I program and the operating system. It explains how to compile, link edit, and execute a PL/I program, and introduces job control language, the linkage e¢itor, and other essential features of the operating system.

(2)

Eighth Edition (January, 1971)

This is a major revision of, and obsoletes, C28-6594-6 and Technical Newsletter GN33-6016. In addition to incorporating information from the Technical Newsletter this new edition contains changes to the description of the PL/I sorting facilities and a number of minor changes throughout. Changes to the text, and small changes to illustrations, are

indicated by a vertical line to the left of the change;

changed or added illustrations are denoted by the symbol • to the left of the caption.

This edition applies to Release 20 of the IBM System/360 Operating System, and to all subsequent releases until other- wise indicated in new editions or Technical Newsletters.

Changes are continually made to the specifications herein;

before using this publication in connection with the

operation of IBM systems, consult the latest IBM System/360 Bibliography SRL Newsletter, Form N20-0360, for the editions that are applicable and current.

The information contained in this publication concerning Model 195 support is for planning purposes only.

Requests for copies of IBM publications should be made to your IBM representative or the IBM branch office serving your locality.

A form for reader's comments is provided at the back of this publication. If the form has been removed, comments may be addressed to IBM United Kingdom Laboratories Ltd.,

Programming Publications, Hursley Park, Winchester, Hampshire, England.

© Copyright International Business Machines Corporation

(3)

This publication and IBM Systeml360 Operating system: PL/I. (F) Language

Reference.Manual form a complementary pair Prograuuner's Guide is concerned with the relati<:>nship between a PL/I program and IBM

Syste~'360 Operating System; it explains how to compile, link edit, and execute a PL/I pJrogram. rhe Programmer' s Guide is concerned with the relationship between a PL/I pJrogram and IBM System/360 Operating

System;~ it explains how to compile, link edit, and execute a PL/I program.

Pari: 1 is intended primarily for the casual (non-specialist) programmer or for the ne'lI1comer to IBM System/360; the reader is assumed to have only an elementary grasp of PL/I and an awareness of the basic

concepts of electronic data processing~. 2 and 3 are designed for use either as

reference material or for reading as an introduction to the features they describe.

PREREQUISITE PUBLICATION

The reader is assumed to have a working knowled.ge of PL/I; he should therefore be familiar with the material contained in the following publication:

IBM SvstenV360 Operating system: PL/I·· (F) Language Reference Manual, Order No.

GC28-8201

RECOMM:I!:NDEDPUBLICATIONS

The text of the Programmer's Guide refers to the following publications for

information outside its scope:

IBM Sy:stem/360 Operating system:

PL/I (F) Compiler, Program Logic Manual, Order No. GY28-6800

PL/I Subroutine Library Program Logic Manual, Order No. GY28-6801

Advalllced Checkpoint/Restart Planning Guiae, Order No. GC28-6708

1For example, as described in Introduction to IBM Data processing Systems, Order No.

GC20-1684.

Preface

Concepts and Facilities, Order No.

GC28-6535

Linkage Editor and.Loader, Order No.

GC28-6538

Job. Control Language .. User' s Guide, Order No. GC28-6703

Job.Control Language Reference, Order No.

GC28-6704

System.Generation, Order No. GC28-6554 Utilities, Order No. GC28-6586

system :Control Blocks" Order No.

GC28-6628

Messages and Codes, Order No. GC28-6631 Job.Control Language Charts, Order No.

GC28-6632

supervisor and Data Manaqement services, Order No. GC28-6646

Supervisor.and Data Management Macro Instructions, Order No. GC28-6547 Programmer's Guide.to Debugging, Order

No. GC28-6670

Queued Telecommunications Access Method Message Processing ',Program Services, Order No. GC30-2003

Queued Telecommunications Access Method Message Control Program, Order No.

GC30-2005

Sort/Merge, Order No. GC28-6543

In addition to the publications listed above, the following contain information that may be helpful to the user:

IBM System/360 Operating System:

Operator's Reference, Order No.

GC28-6691

Operator '. s Procedures, Order No.

GC28-6692

system Programmer's Guide, Order No.

GC28-6550

Storage Estimates, Order No. GC28-6551 PL/I Subroutine Library, Computational

Subroutines, Order No. GC28-6590

3

(4)

IBM System/360:

Principles of ,Operation, order No.

A22='682I

(5)

PART 1:: BASIC ·PROGRAMMING WITH

THE PL/I (F) COMPILER • • • 11 CHAPTER 1: INTRODUCTION TO THE

OPERATING SYSTEM. • • •

IBM Sys·tem/360 Operating System. • Job Scheduler • • •

PL/I (F) Compiler •

Linkage Editor. • • • • • • Linkage Loader. •

Job Control Language •

Format of Job Control Statements. • JOB statement • •

EXEC Statement. • • • • • .•

DO Statement. • • • • Delimiter statement • Executing a PL/I Program •

CHAPTER 2: HOW TO RUN A SIMPLE PL/I PROGRAlM • • • • • •.•

Job Control statements Further Information •

CHAPTER 3: HOW TO CREATE AND ACCESS A SIMPLE DATA SET

Using a Data Set • •

How to Create a Simple Data Set. • Type of output Device (UNIT=) • Volume Serial Number (VOLUME=SER=).

Name of Data set (DSNAME=) • • • • • Format of the Records (DCB=) • • • • Auxiliary'Storage Required (SPACE=) Disposition of Data Set (DISP=) How to ,~ccess an Existing Data Set

Type of Input Device. • Volume Serial Number.

Name of Data Set. • • • Format of the Records • Auxiliary Storage Required.

Disposition of Data Set • .•

special-PUrpose Parameters.

syst,em Output (SYSOUT=) •.•

Data in the Input Stream •.•

Standard Files • Examples

PART 2: USING ALL THE FACILITIES

• 13

• 13

• 13

• 14

• 14

• 14

• 14

• 14

• 16

• 16

• 16

• 17

• 17

• 20

• 20

• 21

• 22

• 22

• 22

• 23

• 23

• 24

• 24

• 24

• 24

• 25

• 25

• 25

• 25

• 25

• 25

• 26

• 26

• 26

• 26

• 26

• 26 OF THE PL/I (F) COMPILER • 29 CHAPTER 4: JOB INITIALIZATION. • 31

Introduction • • 31

Contents

JOB Statement. • • ,.

Job Scheduling , . . • • • • Job scheduling and the Control

Program. • • • • • • •

Primary Control Program (PCP) MFT Control Program •

MVT Control Program CHAPTER 5: COMPILATION • Introduction •

Compilation

• • 31

• • 32

• • 32

• • 33 33 35

• • 37

• • 37

• • 37 Job Control Language for Compilation • • 39 EXEC Statement. • • • • 39 DD Statements • • • • • 40 Example • • • • • • • • • 43 Optional Facilities • •

Control Options • • • Preprocessor Options. • Input Options. ,.

Output Options .•

Listing Options Listing,. • • • • •

• • 43

• • 44 46 47

• • 48 48 49

• • 49

• • 50 Options used for the Compilation.

Preprocessor Input. .• • • • • Source Program. • • • • • • • Attribute and Cross-Reference storage Requirements. • • •

• • 50 Table • 50 51 Table of Offsets. • • • • •

External Symbol Dictionary. • statistics. • • • • '.

Object Module • • • Diagnostic Messages •

Return Code • • • • • • • • Batched Compilation.

The PROCESS Statement •

Job Control Language for Batched processing • • • • • • • • Compile-Time Processing.. • • • Invoking the Preprocessor • The %INCLUDE Statement. •

• • 52

• • 52 54

• • 54

• • 56

• • 56 57

• • 57

• • 58

• • 58

• • 59

• • • 60 Dynamic Invocation of the Compiler • 61 CHAPTER 6: LINKAGE EDITOR AND LOADER • • 63 Introduction • • • • • • • • •

Choice of Linkage Program • Linkage Editor • • • • • • • •

Module Structure. • • • • • • Linkage Editor Processing •

• • 63

• • 63

• • 64

• • 64 65 Job Control Language for Link-Editing • • 66 EXEC Statement. • • • • • • 66 DD Statements • • • • • • • .• • • 67 5

(6)

Example • • • • • • Optional

LIST.

MAP.

XREF.

LET • XCAL.

NCAL.

SIZE.

Facilities.

Listing. • • • • • • • • •

Control Statements and Errors • Diagnostic Message Directory. • Module Map. • • • • • • • • • • Cross-Reference Table

Return Code • • • • Additional Processing.

Format of Control statements. • Module Name • • • • • • • • Additional Input Sources.

Overlay Programs. • • Linkage Loader • • • •

Module structure. • • • • • Linkage Loader Processing •

• 68

• 69

• 69

• 69

• 69

• 69

• 69

• 69

• 70

• 70

• 70

• 71

• 71

• 72

• 72

• 72

• 72

• 73

• 73

• 74

• 77

• 77

• 78 Job Control Language for Link-Loading. • 80 EXEC Statement. • • • • • • • 80 DD Statements • • • • 80 Optional Facilities. •

Control Statements.

Options in the PARM CALL I NOCALL I NCAL • • EP. • • •

LETINOLET • • MAPINOMAP • • PRINTINOPRINT • SIZE. • • • • RESINORES • • Default options Listing. • • •

Parameter.

Module Map. • • • • Explanatory Error or Warning

Messsages. • • • • • • • • Diagnostic Messages • • • • • •

• 83

• 83

• 83

• 84

• 84

• 84

• 84 .. 84

• 84

• 85

• 85

• 85

• 85

• 85

.. 86

CHAPTER 7: EXECUTING THE LOAD MODUL:E • • 87 Introduction • • • •

Load Module processing • • Identifying the Module.

Job Control Language for Execution EXEC statement. • • • •

standard DD Statements.

User DD Statements. • • Listing. • • • • • • • •

contents of SYSPRINT Listing • • Return Codes. .• .. • • • • • • • communication with Program during

Execution • • • • • • • • • • .. •

• 87

• 87

• 87

• 88

• 89 .. 90

• 91

• 91

• 91

• 92

• • • 92

CHAPTER 8: CATALOGED PROCEDURES. • • Introduction ..

PL/I Cataloged Procedures Supplied by 9:3

• .. 93

IBM • • • .• • • • • • .. • • • • .. 93 Compile and Punch Object Deck

(PLIDFC) • • • • • .. • • .• • • 93 Compile and Write Object Module

(PLILFC) . • • • • • • .• • • • • 93 Compile and Link-Edit (PLILFCL) • • • 94 Compile, Link-Edit, and Execute

(PLILFCLG) • .. • • • .. • • • • • 95 Link-Edit and Execute (PLILFLG) .. • • 95 Compile, Load and Execute (PLILFCG) • 9'5 Load and Execute (PLILFG) • .. • 96 Dedicated Workfiles • • 96 Using Cataloged Procedures

Altering Cataloged Procedures.

Temporary Modi:fication. • • Permanent Modification. • •

• • 97 97 97

• .1010 CHAPTER 9: DATA SETS AND PL/I FILES. • .101

Introduction • .101

Data Sets. • • • • lOt

Data Set Names. • .101

Record Formats. • .10:2

Data Set Organization • • .104 Labels. • • • • • ~ .. • • .105 Data Definition (DO) Statement. • • • 105 Files and Data sets • • .. • .. • .107 Operating system Data Management .. •

Buffers • • • • .• • . '

• .107

.10;~

Access Methods. • • ..

Data Control Block. •

Opening a File. .. • .. .. • • • Closing a File. • .. ..

Auxiliary storage Devices.

Card Reader and Punch • Paper Tape Reader • • Printer • • • • • • • • Magnetic Tape • • • • • Direct-Access Devices • CHAPTER 10: STREAM-ORIENTED

TRANSMISSION. • .. .. • ..

Record Format. .. • .. .. . ' . • ..

Fixed-Length Records. • • • Variable-Length Records .. ..

Undefined-Length Records. • Choice of Record Format • Buffers • • •

DCB Subparameters.

Creating a Data Set. • • • • ..

Essential Information • Example .. • • • • • • Accessing a Data Set

• .109

• .1110

• .111

• .11:2

• .11:2

• .11:2

• .. 11:2

• .11:2

• .113

• .113

.. • .111[J

• .ll/[J

• .lll[J

.11/~

• .111[J .. .ll'tJ

• .115

• • • 115

• .11'5

• .1115 .117

• .117

(7)

Essen.tial Information • • • • • Magnetic Tape Without Standard

Labels • • • • • • • Record Format •

Example • • • PRINT Fil es • • •

Record Format • Example • • • Tab Control Table Standard Files

CHAPTER 11: RECORD-ORIENTED TRANSMI SSION • • • • ,e Record Format. •

Choice of Record Format

.117 .118 .118 .119 .119 .120 .120 .120 .122

• 124 .124

• 124 Buffers. • • • • • • • • • .125 creating and Accessing Data Sets. • .125 CONSECUTIVE Data Sets. • • • • • • • •

creating a CONSECUTIVE Data Set • • Accessing a CONSECUTIVE Data Set. • Example of CONSECUTIVE Data sets. • printing and punching Cards

INDEXED Data sets • • •

Indexes • • • • • • • • • Creating an INDEXED Data Set • • Accessing an I~DEXED Data Set • • • Reorganizing an INDEXED Data Set. • Examples of INDEXED Data sets • REGIONAL Data Sets • .• • • • .• • • creating a REGIONAL Data Set. • Accessing a REGIONAL Data Set • Examples of REGIONAL Data Sets.

.125 .125 .126

• 128 .129 .130 .130

• 131

• 137 .138 .138 .139 .141 .143 .144 Teleproc.essing • • • • • • • .152 Introduction. .. • • • • • .152 Messa.ge Processing Program (MPP) • • • 153 How to Run an MPP • • • • • • • .153 CHAPTER 12: LIBRARIES OF DATA SETS .155

Introduc·tion • .155

Structurle of a Partitioned Data set. • .155 Direct.ory • • • • • • • • • .155 Creating a Partitioned DaLa Set. •

Space Parameter • • • • • • processing a Member. • • • • •

Processing with PL/I. •

Operatin9 System Utility Programs.

System Libraries • • • • • Link JLibrary. • • • • • Procedure Library • • PL/I Subroutine Library

.156 .157 .15t .159 .160 .161 .161 .161 .161

Private Libraries.

Job Library • • step Library. •

CHAPTER 13: MULTITASKING.

Introduction • • • • • • •

• .161

• .161

• .162

• .163

• .163 Multitasking Requirements. • • • .163 systenV360'Requi;rements • • 163 Operating system Requirements • • • • 163 Programming Requirements. • • .163 Multitasking Management. ~ • •

Trans fer of Control,. • • • • • • Use of Priorities in PL/I •

programming considerations.

Input/Output Handling • Task Termination.

Multiprocessing. • . • Synchronization •

CHAPTER 14: OTHER FACILITIES OF THE OPERATING SYSTEM •

Introduction

Dump of Main storage

• .164

• .164

• .166

• .167

• .1'69

• .172

• .173

e 174

• .175

• .175

• .175

• .176

• .177 Checkpoint/Restart Interface •

Types of Restart • • • • • • • Checkpoint/Restart Requirements and

Diagnostic Aids. • • • • • • Job Control Language Details.

PL/I CALL Statement Details • Restriction on Use of

Checkpoint/Restart • • • • • Effect of Checkpoint/Restart on

Data Sets. • • • • •

.178

• .178

• .180

• .183

• .183 Sort Interface • • • • • • • • • • • • • 184 PL/I Sort Environment • • • • • • • • 184 User' Control of SORT ddnames • • • • • 186 Defining the Sorting Application. • .187 Entry Point lHESRTA • .189 Entry Point lHESRTB .• • • .191 Entry Point IHESRTC • • • .193 Entry Point IHESRTD • • • .195 Sorting Variable-Length Records • • .191 Use of PL/I Sort in a Multitasking

Environment. • • • • • • • 198 CHAPTER 15: PL/I AND OTHER LANGUAGES • .201

Introduction • • • .201

Data set Interchange • • 201 PL/I-FORTRAN Data set Interchange • • 201 PL/I-COBOL Data Set Interchange • • • 203 Linkage with Other Languages • • • • • • 204

PL/I (F) Environment and

Communications • • • • • • • • • • • 204 Communication with Other Languages • • 212

7

(8)

PART 3: APPENDIXES. • • • • • • • .217 APPENDIX A: PROGRAMMING EXAMPLES. .219 Example 1: Simple PL/I Program • • .219 Listing • • • • • • • • • • • • .219 Example 2: Compiler and Linkage-Editor

Listings. • • • • • • • • • • • .226 Listing. • • • • • • • • • • • 227 APPENDIX B: PARAMETERS OF DD STATEMENT .249 APPENDIX C: VERSIONS OF THE PL/I (F)

COMPILER. • • • • • • • • • • • • APPENDIX D: SYSTEM REQUIREMENTS. • Control Program Options.

Machine Requirements • • • •

.261 .267 .267 .267 APPENDIX E: PL/I LIBRARY SUBROUTINES • .270 APPENDIX F: SHARED LIBRARY. •

Introduction

.279 .279 How to Create a Shared Library. .. .279 How to Use a Shared Library. • .281

Using standard IBM Cataloged

Procedures .. • • .. • • • .. • .. .. 282 providing Your Own cataloged

Procedures. • • • • • • .283 APPENDIX G: IBM SYSTEM/360 MODEL 91

AND MODEL 195 • • • • .. • • • • . . . 287 APPENDIX H: COMPILER DATA SETS • • .289 APPENDIX I: ON, RETURN, AND USER

COMPLETION CODES. • .291

ON-Codes . . . 291 Return Codes and User Completion codes .294 step Abend Facility • • .295 Return Codes. • • • • • .295 APPENDIX J: IMPLEMENTATION CONVENTIONS

AND RESTRICTIONS. • • • .297 APPENDIX K: DIAGNOSTIC MESSAGES . . . 313 Source Program Diagnostic Messages • • .313 Compile-Time Processing Diagnostic

Messages. • • • • • • • • • • • .. • • .. 445 Object-Time Diagnostic Messages. • .467 INDEX. .oo • .506

(9)

Figure 1-·1. A JOB statement • • • • 15 Figure 1-·2. An EXEC statement • .. • 16 Figure 1-3. A DD Statement (Using a

Continuation Card). • • .. _. • • • • 18 Figure 1-·4. Typical Sequence of Job

Control ,statements for Compile,

Link-Edi.t, and Execute steps.. • • 19 Figure 1--5. Typical Sequence of Job

Control statements for Compile and

Load-and-Execute steps. • -.. .. • • .. • • 19 Figure 2-·1. Job Control Cards for the

Execution of.a simple PL/I Program • • • 20 Figure 3-·1. Creating a CONSECUTIVE

Data Set.: Essential Parameters of DD

Statement .. • • • • • • • • • • • • • .. 23 Figure 3-· 2. Accessing a CONSECUTIVE

Data Set.: Essential Parameters of DD

statement • • • • • • • • • • • • • 25 Figure 3-·3. creating a simple

CONSECU'l~IVE Data Set. • .. • • • • • • • 27 Figure 3-·4. Accessing a Simple

CONSECU'l'IVE Data Set. • • • • • • • 27 Figure 5-'1. PLII (F) Compiler:

Simplifi.ed Flow Diagram • • • • • • 38 Figure 5-· 2. standard Data sets for

Compilat,ion • • • • • • • • • • • • 40 Figure 5-·3. Characteristics of

CompileI: Data Sets. • • • • • • • • • • 41 Figure 5-·4. Compiler Options,

Abbreviations, and standard Defaults. • 44 Figure 5-· 5.. Optional Components of

Compiler Listing. • .. • • .. .. • • .. 49 Figure 5-·6. Typical Standard ESD

Entries • .. • • • • • • • • • • • .. 53 Figure 5-·7 .. An Example of Batched

Processing_ • • • .. • • • • .. • • • 59 Figure 5-· 8. Execution of the Programs

Compiled in Figure 5-7 . . . 60 Figure 5-· 9. Using the Preprocessor to

Create a Source Deck. • • • • • • • .. • 60 Figure 5-·10. Placing Source

Statements in a New Library .. • • .. 61 Figure 5-· 11. Including Source

Statements from a Library • • .. • • 62 Figure 6-·1. Basic Linkage Editor

Processing. • • .. • • • • • • • • • 66 Figure 6-·2. Linkage-Editor Data Sets • • 67 Figure 6-·3. Processing of Additional

Data Sources. • .. • • .. • • • • • • 74 Figure 6-'4. Program Suital:>le for

Overlay Structure • • • • • • • • .. • • 75 Figure 6-· 5. Overlay Tree Structure

for Proqram of Figure 6-4 • • • • • • .. 76 Figure 6-·6. Compiling, Link-Editing,

and Executing an Overlay Program. • • • 76 Figure 6-,7. Loader Processing (SYSLIB

Resolution) • • • . . . 78 Figure 6-· 8. Loader Processing

(Link-Pack Area and SYSLIB

Resolution) • • • • • • • • • • • • • • 79 Figure 6-·9. Automatic Editing • 79

Figures

Figure 6-10. Linkage-Loader Data Sets • 81 Figure 8-1. Cataloged Procedure

PL1DFC (Compile and Punch Object

Deck) • • • • • • • • .. • • • • • .. • • 93 Figure 8-2. Cataloged Procedure

PL1LFC (Compile and Write Object

Module) • • • .. • . . . . . . 94 Figure 8-3. Cataloged Procedure

PL1LFCL (Compile and Link-Edit) • .• 94 Figure 8-4. Cataloged Procedure

PL1LFCLG (Compile, Link-Edit, and

Execute). • • .. • • • • • -. .. .. 95 Figure 8-5. Cataloged Procedure

PL1LFLG (Link-Edit and Execute) • • 95 Figure 8-6. Cataloged Procedure

PL1LFCG (Compile, Load-and-Execute) 96 Figure 8-7. Cataloged Procedure

PL1LFG (Load-and-Execute) • -. .• 96 Figure 8-8. Invoking Cataloged

Procedure PLlLFLG • • • .. • • • 99 Figure 8-9 Executing PL1DFC as an

In-Stream P~ocedure • .• • • • • • • • .100 Figure 9-1. A Hierarchy of Indexes • • • 102 Figure 9-2. Fixed-Length Records • • • • 103 Figure 9-3. Variable-Length Records • • • 103 Figure 9-4. Associating a File with a

Data Set. • • • • • • • • • • • • • • .108 Figure 9-5. Data Management Access

Methods for Record-Oriented

Transmission . . . 110 Figure 9-6. How the Operating System

completes the Data Control Block. • • .111 Figure 9-7. Card Read Punch 2540:

Stacker Numbers . . . 112 Figure 10-1.. Creating a Data Set:

Essential Parameters of DD Statement • • 116 Figure 10-2. Using Stream-Oriented

Transmission to Create a Data set • • • 117 Figure 10-3. Accessing a Data Set:

Essential Parameters of DD Statement • • 118 Figure 10-4. Using Stream-Oriented

Transmission to Access a Data Set .• • .119 Figure 10-5. Using a PRINT File • • • • 121 Figure 10-6. Tabular Control Table

(Module IHETAB) • • • .. • • • • .. .122 Figure 10-7. Making a Temporary

Change in Tab Settings • • • • • • • • • 123 Figure 11-1. Creating a CONSECUTIVE

Data Set: Essential Parameters of DD

statement .. • .. • • • • • • • • • • • • 126 Figure 11-2. DCB Subparameters for

CONSECUTIVE Data Sets • • • • • • • • • 126 Figure 11-3. Accessing a CONSECUTIVE

Data Set: Essential Parpmeters of DD

Statement .. • .. • • • • • • • • • • 127 Figure 11-4. Creating and Accessing a

CONSECUTIVE Data Set. • • • • • • • • .128 Figure 11-5. ANS Printer and Card

Punch Control Characters. • • • • • • • 129 Figure 11-6. 1403 Printer Control

codes. • • • . • • • • • . • • • .129

9

(10)

Figure 11-7. 2540 Card Read Punch

Control Codes • • • • • • • • .130 Figure ll-B. Printing with

Record-Oriented Transmission. • • .130 Figure 11-9. Index Structure of

INDEXED Data Set. • • • • • • • • .131 Figure 11-10. Adding Records to an

INDEXED Data Set. • • • • • • • • .132 Figure 11-11. Creating an INDEXED

Data Set: Essential Parameters of DD

Statement • • • • • • • • • • • • .133 Figure 11-12. DeB Subparameters for

INDEXED Data Set. • • • • • • • .134 Figure 11-13. Record Formats in an

INDEXED Data Set. • • • • • • • .136 Figure 11-14. Record Format

Information for an INDEXED Data Set. .136 Figure 11-15. Accessing an INDEXED

Data Set: Essential Parameters of DD

Statement • • • • • ,. • • • .. • • .13B Figure 11-16. Creating an INDEXED

Data Set. • • • • • • • .. • .. • • .139 Figure 11-17. Updating an INDEXED

Data Set. • • • • • • • • • • • • .140 Figure ll-lB. Creating a REGIONAL

Data set: Essential Parameters of DD

Statement • • • • • • • • • • .142 Figure 11-19. DCB Subparameters for

REGIONAL Data Set • • • • • • • • • • .142 Figure 11-20. Accessing a REGIONAL

Data Set: Essential Parameters of DD

Stat ement • • • • • • • • • • • • • • • 143 Figure 11-21. Creating a REGIONAL(l)

Data set. • • • • • • • • • • • • • • .145 Fi,gure 11-22. Accessing a REGIONAL(l)

Data set . . . 146 Figure 11-23. Creating a REGIONAL(2)

Data Set. • .. • • . . . 147 Figure 11-24. REGIONAL (2) Data Sets:

Direct Update . . . e . . . 14B Figure 11-25. REGIONAL(2) Data Sets:

Sequential Update and Direct Input. • .149 Figure 11-26. Creating a REGIONAL(3)

Data Set. • • • • • .. • • • • • • • • .150 Figure 11-27. REGIONAL(3) Data Sets:

Direct Update • ,. • • • • • • .. • • • .151 Figure 11-2B. REGIONAL(3) Data Sets:

sequential Update and Direct Input. G .152 Figure 11-29. PL/I Message Processing

Program. • • .. • .. • • • • . . . e .153 Figure 12-1. A Partitioned Data set e .156

Figure 12-2. A Partitioned Data Set

Directory Block ~ • • • • . ' . • • .. .. .157 Figure 12-3. Contents of Directory

Entry • • • .. .. .. • . ' . • • • •.• '. • .157 Figure 12-4. Placing an Object Module

in a New Library . . . ~ • • • • • • 15B Figure 12-5. Placing a Load Module in

an Existing Library • • • • • o O ' . .159 Figure 12-6. Using a PL/I Program to

Create a Member of a Partitioned Data Set. ' . . . 160 Figure 12-7,. Updating a Member of a

Partitioned Data Set. • • • • • • • • .160 Figure 12-B,. Use of JOBLIB statement • • 162 Figure 13-1. Transfer of Control

within a Multitasking Program • • • • • 165 Figure 13-2. Flow of Control through

a Program , . . . '. • • • .. .167 Figure 14-1. Return Codes from

Checkpoint Module IHECKP. • • • • .lB2 Figure 14-2. Auxiliary Storage

required for Sort.. • ,. • • . ' . • .lB5 Figure 14.3. DD Statements for

Sort/Merge. • • • • .186

Figure 14-4. PL/I Program Invoking

IHESRTA '. • • • • • • • • • • • • 191 Figure 14-5. PL/I Program Invoking

IHESRTB • • • • • • • • • • • • .193 Figure 14-6. PL/I Program Invoking

IHESRTC • • • • • • • • • • .. • • 195 Figure 14-7. PL/I Program Invoking

IHESRTD • • • • • • • .197 Figure 14-8. Using IHESRTA to Sort

Variable-length Records • • • • • .200 Figure 15-1. FORTRAN-PL/I Data

Equivalents. • • • • • • .202 Figure 15-2. COBOL-PL/I Data

Equivalents • • .. • • ,. • ,. • • .204 Figure 15-3. Initial Entry to

Procedures with the MAIN Option • • • • • 206 Figure 15-4. PL/I-FORTRAN: Example of

Named Common Storage. . ' . • • • • • • • 214 Figure D-l. Control Program Options • • 267 Figure D-2. Minimum system

Requirements. • .. • .. • • .. • • .. • 268 Figure 0-3. possible Minimum

Configurations of Main Storage. .. .269 Figure F-l. Shared-Library Module

Groups • • • • • ,. • • • .. • • • • .280 Figure 1-1. Main ON-Code Groupings • • • 292 Figure 1-2. Detailed ON-Code

Groupings • • • • • • • • • • • • • • • 292

(11)

PART 1: Basic Programming with the PL/I (F) Compiler

Part 1: Basic Programming with the PL/I (F) Compiler 11

(12)
(13)

Chapter 1: Introduction to the Operating System

In IBM System/360, programs are usually executed as part of a group of programs collecti'V'ely termed an operating. system.

This chapter introduces IBM System/360 Operatinq System:l. (the operating system that includes the PL/I (F) compiler), and describes the job control language that enables programmers to define the

requir,ements of their programs for the operating system. Chapter 2 illustrates the'use of job control language for running asimplePLII program. The two chapters are complementary; the first briefly describes the operating system and job control language, and the second

demonstrates how to use them to execute a PL/I program. Chapter 3 introduces the concept of storage of data and shows how to use a simple data set.

IBM Sys~tem/360 Operating System

IBM system/360 Operating system consists of a control program and a number of

processing programs that together assist both the operator and the programmer in the use of IBM System/360. The operating

system relieves the programmer of routine and time-consuming tasks by controlling the allocation of storage space and

input/output devices. Through the language translators that may be included, i t makes programming easier by permitting the use of high-lev'el languages such as PL/I. And i t

increase~s the throughput of the machine because i t can proces,S a stream of jobs without interruption by the operator; i t provides automatic transition from one job to another.

'rhe control :program supervises the execution of all processing programs and provides services that are required in common by the processing programs during their eJ!:ecution. It has four main

elements::

1. Supervisor: The supervisor program is the! control center of the operating system, and controls and coordinates all. activity within i t .

2. Master scheduler: The master scheduler forms a two-way communication link

:l.IBM System/360 operating System is frequent:ly referred to as 'the operating system,' or simply 'the system.'

between the operator and the operating system.

3. Job scheduler: The job scheduler reads and analyzes the input job stream (the sequence of control statements and data entering the system), allocates input/output devices as necessary, initiates the execution of processing programs, and provides a record of the work processed.

4. Data management routines: The data management routines control

input/output operations, regulate the use of input/output devices, and provide access to the data held in them.

The processing programs of the operating system include service programs (for

example, the linkage editor) and language translators (for example, the PL/I (F) compiler) provided by IBM, as well as programs that are written by the user and incorporated as part of the system.

All the programs of the operating system are stored in system,libraries, which are held in auxiliary storage on a -

direct-access storage device.

The most important components of the operating system that directly concern the PL/I programmer are the job scheduler, the PL/I (F) compiler, the linkage editor, and the linkage loader, all of which are

discussed below. The operating system is described in IBM system/360 Operating system: Concepts and.Facilities.

JOB SCHEDULER

The job scheduler is the component of the operating system that handles

communications between the programmer and the services provided by the operating system. A simple programming language called job control language (JCL) enables the programmer to specify his requirements to the operating system. The statements of this language indicate to the job scheduler the start and name of the job, specify the programs that are to be executed, and define the auxiliary storage requirements of the programs. In response to the job control statements, the job scheduler allocates the input/output units required, notifying the operator of any tapes or disk

Chapter 1: Introduction to the Operating system 13

(14)

packs that must be mounted, and then

requests the supervisor program to initiate the execution of the specified programs.

After the execution of each program the job scheduler prints a record of the work done.

PL/I (F) COMPILER

The PL/I (F) compiler is a program that translates PL/I source programs in'to IBM system/360 machine instructions. The set of instructions produced by a compilation is termed an object.module. An ob-ject module is not in a form suitable for loading into main storage and subsequent execution: first it must be processed by the linkage editor.or the linkage loader.

(Chapter 5 discusses the compiler and describes the object module it produces.)

LINKAGE EDITOR

The linkage editor is a program that converts object modules into a form

suitable for loading into main storage for execution; a program in this form is termed a load module. The output (load module) from the linkage editor is always placed in a library, from which the job scheduler can load i t for execution.

The linkage editor can combine separately produced object modules and previously processed load modules into a single load module. It can make changes to sections of a load module: only sections that are affected by the changes need be re-compiled. It also permits a program that is too large for the space available in main storage to be divided so that i,t can be loaded and executed segment by segment.

Chapter 6 discusses the linkage editor and the differelJ.ces between object modules and load modules.

LINKAGE LOADER

The linkage loader is a program tha~

converts object modules into load modules, loads them into main storage and executes them, all in one job step. It can combine object or load modules into a single load module for execution: this load module is always placed in main storage" never in a library.

The use of the linkage loader and the options available are discussed in Chapter 6.

Job Control Language Examples

The following discussion of the job control language is an overview. Job control

language is fully described in IBM

System/360 Operating.System: Job control Langauqe.User's Guide, and Job Control Language.Reference: however the most

significant parameters of the DO statemen't are also described in Appendix B.

Job control language is the means by which a programmer communicates with the

job scheduler; i,t allows the programmer to describe the work he wants the operating system to do, and to specify the

input/output facilities he requires. Only seven types of s'tatetnent are involved, of which four are relevant to this discussion:

the JOB statement, the execute (EXEC) statement, the data definition (DO) statement, and a delimiter statement.

The JOB statement identifies a job to the job scheduler. In IBM System/360 Operating System" a job is an independent request for the facilities of the operating system; it comprises one or more job step~~.

A job starts with a JOB statement and continues until the next JOB statement is encountered.

The EXEC statement identifies a job stE~p to the job scheduler. A job step involves a request for the execution of a program.

Job steps can be interrelated: data can bE~

passed from one job step to the next, and the execution of one job step can depend on the successful execution of a preceding step. (No such relationship exists betweEm

jobs; they are independent of one another.) A job step starts with an EXEC statement and continues until the next EXEC or JOB statement is encountered.

DO (data definition) statements describe the input/output facilities required in a

job step ..

The delimiter (/*) separates data in the input stream from the succeeding job

control statements.

FORMAT OF JOB CONTROL STATEMENTS

A job control statement consists of one or mo're aO-byte records. Since aO-column punched cards are the most common input

(15)

Name of job

Accounting

information Programmer's name

...-"'-EX t1PtE: JOB (2345, A 1111 ), J. ilL GGS

100 0 00 0

(l]

I1J

(]]D

(I]

0 0 m

rno no 0 0 0 0 0 0 0 0 0 0 0 0 0 000 0 0 0 DOnO DOC 0 DOnO nOD 0 0 0 COO 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

'r"!"3'r'56 7 H 9101112131415161718192021222l212S26'i!'282930JI313334~3637383940414143444,46414849,OSl51,3,45556515859606161636465666168691011111314151071181980 (1)1101111 10111111111CJlI1[]1101 1 11 1 1111111111111111111 i 11111111 1'1111111,11111111111 22222222222202202222222222222022220222222222222222222222222222222222222222222222 3 3 3 3 3 3 3 iD3 3 3 3 3 3 3 303 303 3 3 3 3 30303033 3 3 3 33 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 44444044444444444044444444444444444444444444444444444444444444444444444444444444 5 5 [] 5 5 5 5 5 05 5 5 5 505 5 505 5 5 5 5 505 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 5 6 6 6 6 6 6 6 6 6 6 6 (] 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 606 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 7 707 707 7 7 7 7 1 7 7 7 7 7 7 7 77 7 77 7 7 7 7 7 7 7 (1]7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 7 77 77 7 77 7 7 7 7 7 7 7 7 7 7 77 7 7 7 7 7 7 7 7 7

~ 8 8 8 8 8 8 8 8 8 8 8 8 808 8 8 808 8 8 8 8 (]]a 08 a 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 & 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 a 8 8 8 8 8 8 8 8 8 8 8 99999999999999999999999999999999999999999999999999999999999999999999999999999999

I 2 3 4 5 6 7 6 9 10 11 12 13 14 15 16 II 18 19 20 21 2223242528 27 282930 31 323334 353631 38 39 .0 41 42 4344414641 48495051 525354 ,:' ,6 ,1 5S ,9" ,: bl '.J :4 6H6 67 66 69 10 II 12 13 74 15 16 71 16 19 60 113M UNITED KINGDOM LIMITED, ~OBI

Figure i--i. A JOB Statement

medium for the job stream, the following discussion refers to card columns rather than to bytes.

JOB, 'BXEC, and DD statements have the same format, examples of Which appear in Figures :iL-l, 1-2, and 1-3. These

statement,s are identified by / / in card columns :IL and 2. Each statement can contain four fields (name, operation, operand, comments), which are separated by one or more blanks; the name field starts in coluinn 3. A job control statement must not extend beyond column 71; if necessary it can be:! continued on another card, as shown in Figure 1-3.

The .lliime field, which begins in column , 3, can range from one to eight characters 1n length, and can contain any alphameric

(alphabe1:ic or numeric) or national (Ii) $ #)

characters. The first character must be alphabetic or national. This field is somtimes omitted. The name identifies the statemeni:. and enables other job control statemeni:.s (or PL/I statements) to refer to it.

The ~~eration field specifies the type of job cc:mtrol statement (JOB, EXEC, DO).

Whether it.he name field is used or not, the operation field must be preceded by at least once blank.

The QPerand field can contain one or more pari5lmeters separated by commas; these

param~ters pass information to the job scheduler, and, for the JOB, EXEC and DO

statements, are of two types, pOSitional and keyword. Positional parameters must be placed at the beginning of the operand field, and are identified by their pOSition relative to other parameters. If a

positional parameter is omitted, its

absence is indicated by a comma, unless it is the last positional parameter, when the comma is omitted. A keyword parameter consists of a keyword followed by an equals sign, which is followed by a single value or a list of subparameters; keyword

parameters may appear in. any order, and their omission need not be indicated.

The comments- field is intended for programmer's notes. It has no fixed format, and can contain any information.

The comments field is the only field that can include blanks.

The following paragraphs contain a

general description of the functions of the JOB, EXEC, DO, and delimiter statements;

these, and other job control statements, are discussed further under appropriate headings in later chapters. IBM System/360 Operating system: .Job Control Language, User'.S Guide, and Job Control Language Reference, gives a full description of all the job control statements, their formats and parameters ..

Chapter 1: Introduction to the Operating system 15

(16)

JOB STATEMENT

The JOB statement (Figure 1-1) indicates the start of a job and the end of the preceding job. It assigns a name to the new job. which is used by the job scheduler in the messages it passes to the operator and prints on the program 1isting~ The parameters (none of which need appear unless your installation has made some of them mandatory) include the programmer's name and accounting information.

EXEC STATEMENT

The EXEC statement (Figure 1-2) marks the start of a new job step and the end of the preceding job step. It requests the job scheduler to fetch a load module from the system library (or from another library) and cause i t to be executed; other load modules can be loaded dynamically during the execution of the first. but only one can be named in the EXEC statement. The first parameter (PGM=) names the program to be executed. Sometimes the EXEC statement passes information to the program that it calls (PARM parameter). and it may include accounting information and specify

conditions for bypassing the job step.

DD STATEMENT

In IBM System/360, a collection of data held in an auxiliary storage device (a reel of magnetic tape, a disk pack. etc •• ) is termed a data set. A DD statement (Figure 1-3) identifies a data set and describes its attributes. There must be a DD

statement for each data set that is useal or created in a job step. The DD statement:s are placed immediately after the EXEC statement for the step.

The parameters of the DD statement

contain such information as the name of the data set, the name of the volume on which it resides, the type of device that holals the data set, the format of the records in the data set, and the method that will be used to create or access the data set. The name of the DD statement provides a

symbolic link between the file named in a PL/I program and ·the actual name and location of the corresponding data set.

The DD statement allows the programmer to leave the specification of his data set requirements until he is ready to execute his program, and enables him to relate t,he file in his program to different data sets on different occasions. Some data set information can be given in the PL/I ENVIRONMENT attribute rather that in a DD statement.

Name of

job step Program to Information being passed be executed to program IEMAA

, r

'r /

~-/-/~P~L~1~L~~~X~~~C~P~G~M-=~I~~A~~~4'~P~A~R~~~=~'~---~

om 0 OO[D 0 OJ IDJ 000 OD D Dm IlJ

[I]

0

mO 0 D D D DnO 0 0 DOD DOD 0 DOnO 0 0 0 0000 C ono 0 G 3 0 0 0 DOC 0 0 0 0 0 0 0 000000000000000000000000000000

W 3 4 5 6 7 I 'r'10 11 72131415161718 191021W21212~2627281930 3131~343~3Sl7383940 41414J444~46474849505151535455565758596061626J64656667686970 II 11 7374757677787980

[1]1 10 1 1 1 1 1 1 1 1 1 1 1 1 1 1

III

1 101 1 1 1 1 101 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 Iii I 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 I 1 1 I 22222222222222222222222222222222222222022222222222222222222222222222222222222222 3 3 30303 3 3 303 3 3 3 3 3 3 3 3 303 3 3 3 3 303 3 303 3 3 303 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 3 44444444444444044404444440444440444044444444444444444444444444444444444444444444 55555550505555555055555555505555505505505555555555555555555555555555555555555555 6 6 6 6 6 6 6 6 6 6 6 6 6 6 606 6 6 6 6 6 6 6 6 606 6 [)6 6 6 6

Os

6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 6 7 707 7 7 7 707 7 7 [J]7 77 7 77 77

077

77 71 77 7 7 77 71 77 7 77 7 7 7 7 77 7 7 7 7 77 7 77 7 77 77 7 7 77 7 77 77 7 7 77 7 7 7 7 7 8 8 8 8 8 8 8 8 8 8 8 8 8 8 808 8 8 8 808 8 8 8

rna

8 8 8

Os

8 8 8 8 808 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 8 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9

ng

9 9 9 9 9 9

n

9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 9 1234587'9~l1tlQ~~I6~I619~~n21NW28n28H~~n~~~~n»»d~~o«~«c«u~~~~~e56H5656~~~~"~~~U"ronn73H~~77n~~

IBM UNITED KINGDOM LIMITED ~081

Figure 1-2~ An EXEC Statement

Références

Documents relatifs

• Maintenance of a catalog of programs ncertified n to operate as message processing programs under IMS/360, including related documentation. processing priorities,

This command (Process Stop) stops the sending and receJ.vJ.ng of messages relative to a particular communications line or terminal, or stops the scheduling of

An output writer, activated by your command, START WTR, writes system output data sets, according to job priority and output class, on external devices such as

Functional additions for the fifth version of the F Compiler consist of the following: teleprocessing support by means of TRANSIENT files; two Ilew st:ring

The Supervisor communications region displacement 98 contains the address of a block of information in the unit-check routine providing these transients with the

The system service routines are divided into eight categories: catalog services; external storage allo- cation; device management; virtual memory allocation;.. small

Whenever the matching record indicator MR is on and indicator 02 is on, the contents of the field AMT are added to the MASBAL. The result is stored

The EXEC job control language statement can be used to pass control information to the first program of the specified job step. The control info:r·mation is