• Aucun résultat trouvé

Executing the Load Module

Dans le document It System/360 (Page 87-93)

Standard Files

Chapter 7: Executing the Load Module

Introduction

To execute a program, i t must be in the form of a load module or an object module.

If in load-module form you must use an EXEC

statemE~nt to request the job scheduler to load and execute. If in object-module form you must use an EXEC statement to request the job scheduler to load and execute the loader which will process the module and pass control to i t .

~jodules for execution are selected from one of two sources:

1. A partitioned data set which is a module library. The modules are either object modules created by the compiler or load modules created by the linkage editor.

2. A sequential data set which is an object module created by the compiler.

partitioned data sets and module librariles are des cribed in Chapter 12, sequential data sets are described in Chapter 9.

This chapter describes the selection of the object or load module for execution, the job control statements required for load module execution, and the messages and other da.ta printed on the output listing.

Load M()dule Processing

IDENTIFYING THE MODULE

The data. set containing the module to be selected for execution is identified in one of two ways:

1. Jobs using the linkage editor: The data set is identified in the PGM parameter of the EXEC statement for the execution job step.

2. Jobs using the linkage loader: The data set is identified in a DD

statement with the name SYSLIN in the execution job step.

Jobs Using the Linkage Editor

The data set exists in a library created in a previous job step of the same job, 'or in a previous job.

Library Created' in' a ,Previous Job Step:

The basic reference is:

//stepname EXEC PGM=*.prevstepname.ddname where 'prevstepname' is the name of the job step in which the library is created.

If the data set is the output data set created by the linkage editor, code:

//stepname EXEC PGM=*.linkname.SYSLMOD where 'linkname' is the link-edit stepname.

If you use the cataloged procedures

PL1LFCLG or PL1LFLG, the code generated is:

//GO EXEC PGM=*.LKED.SYSLMOD

Library, Created'inaPrevious'Job: If the library is a system library (SYS1.LINKLIB), code:

//stepname EXEC PGM=progname

where 'progname' is the member name of the module in the system library.

If the library is a private library used as a job library, the syntax is the same as for the system library. The private

library must be identified in a JOBLIB DD statement placed immediately after the JOB statement.

If the library is a private library used as a step library, the syntax is the same as for the system library. The private library must be identified in a STEPLIB DD statement which follows the EXEC statement that initiates the job step.

Jobs Using the Linkage Loader

The data set exists in a library or is a single module, created in a previous job step of the same job or in a previous job.

Library Created' in' a-Previous Job step:

The basic reference is:

Chapter 7: Executing the Load Module 87

//SYSLIN DD DSNAME=*.stepname.ddname,

/ / DISP=(disp)

where '*.stepname.ddname' refers to the name of the DD statement that

describes the data set in which the member of the library is created.

'disp' is the set of terms for the disposition of the data se1:: before and after the job step.

If you use the cataloged procedure

PL1LFCG with input from a library, you must override the SYSLIN DD statements in both

job steps. The ddnames for the input data set you are using must be qualified as PL1L.SYSLIN and GO.SYSLIN respectively. If you use the cataloged procedure PL1LFG, you must supply the SYSLIN DD statement, using //GO.SYSLIN.

Library Createdina.PreviousJob: If the library is the system library, code:

//SYSLIN DD DSNAME=dsname,DISP=(disp) where 'dsname' is the name of the member of

the library.

'disp' is as defined previously in this chapter.

If the library is a private library, the syntax is the same as for the system

library.

If the library is neither cataloged nor in a job library, i t must be described fully in the SYSLIN DD statement. (A cataloged data set, which can be a library or a single module, has its name in the system catalog and can be called by specifying the name only.) Code:

//SYSLIN DD DSNAME=dsname(mbname),

/ / DISP=(disp),

/ / VOLUME=volume,

/ / UNIT=unit

where 'dsname' is the name of the library.

'mbname' and 'disp' are as defined previously in this chapter.

'volume' is the set of terms defining the volume and its usage.

'unit' specifies the storage device.

If yo~ use the cataloged procedure PL1LFCG or PL1LFG, the same considerations apply as for a library created in a

previous job step.

Module Created ina.Previous·Job step: The basic reference is:

//SYSIN DD DSNAME=dsname,DISP=(disp) where 'dsname' is the name of the temporary

or permanent dat~ set.

., disp' is as defined previously in this chapter.

The cataloged procedure PL1LFCG generates the appropriate SYSLIN DD statement. If you use the cataloged procedure PL1LFLG, you must supply this statement, using the qualified ddname //GO.SYSLIN.

Module Created i n a Previous Job: The reference for the SYSLIN DDstatement depends on whether the data set is cataloged or not.. For a cataloged data set, code:

//SYSLIN DD DSNAME=dsname,DISP=(disp) where 'dsname' is the name of the catalog led

data set.

'disp' is as defined previously in this chapter.

If the data set is uncataloged, code:

//SYSLIN DD DSNAME=dsname,

/ / DISP=(disp),

/ / VOLU~volume,

/ / UNIT=unit

where 'dsname' is the name, of the data set.

'disp', 'volume', and 'unit' are as defined previously in this chapter.

If you use the cataloged procedures PL1LFCG or PL1LFG, the same considerations apply ap for libraries created in a

previous job step.

Job Control Language for Execution

You can use a cataloged procedure to

generate the job control statements or you can supply them yourself. The IBM-supplied cataloged procedures that apply to this step are:

PL1LFCG PL1LFCLG PL1LFG PL1LFLG

Compile, load-and-execute

Compile, link-edit, and execute Load-and-execute

Link-edit, and execute These procedures are described in Chapter 8, 'Cataloged procedures,' which includes an account of the methods used to modify or overwrite any of the statements in the procedures.

If you want to supply your own job

control statements, the statements required for thE:! execution job step are described below.

EXEC S'.l~ATEMENT

The basic form of the EXEC statement

require~s only the PGM parameter:

/ / EXEC PGM=reference

where 'reference' has one of two forms:

1. Jobs using the linkage editor: a reference to the data set containing the load module. This has already be'en described in 'Identifying the Load Module' in this chapter.

2. Jobs using the linkage loader: the

n~ne of the loader program:

PGM=LOADER

ThE:! use of the linkage loader is described in Chapter 6, 'Linkage Editor and Loader.'

WhilE~ the PGM parameter is the only mandatOl:Y parameter as far as the operating system is concerned, some or all of the other parameters available may be mandatory at your installation. The use of these

parametE~rs is discussed here.

ACCT PaI:~ameter

The accounting procedure at your

installation may require you to provide information here, if each job step is to be charged separately.

COND Parameter

This is a useful parameter if your execution job step is dependent on the successful completion of a previous job step. The use of the EVEN and ONLY subparam,eters allows you precise control over the conditions under which this job step can be executed. '

PARK ,Parameter

The PL/I CF) compiler provides a facility for passing, in this job step, a single parameter to the main procedure of the PL/I program. The data specified in the PARM parameter field can be up to 100 characters long and must be enclosed in quotation marks. Any character in the character set available can be specified. The associated parameter in the main procedure should be declared CHARACTER(100) VARYING.

The PARM parameter is a useful means of passing data to a load module. For

example, i f the SYSIN file is already associated with a user data set, any extra data required can be quickly inserted by being specified in this parameter. Another use is to pass data that can be employed to determine how the program will be executed and which category or categories of output will be produced. Both the PL/I CF)

compiler and the linkage editor use the PARM parameter in this way; the characters passed represent various options which determine, for example, the information to be printed on the output listing.

If you want to use the PARM parameter for the second of these purposes, you should include, at the beginning of your PL/I program, code to convert the parameter characters to variables, and code to set a series of program switches. For example:

STOCK: PROCCINPARM) OPTIONS(MAIN);

DCL INPARM CHAR(100) VAR, 1 VALUES BASEDCP),

2 (TERMA, TERMB, TERMC, TERMO,

TERME) ,CHAR C 1) , 2 NUMBER PIC'9999', 2 SPEC CHAR(l), 2 CTCHAR CHAR(3),

P=ADDR (INPARM) ;

Ll:IF TERMA=TERMB THEN GO TO ••• ; ELSE IF CTCHAR='I/M' THEN ••• ; L2:IF TERMC,=TERMD THEN GO TO ••• ;

ELSE GO TO ••• ;

L3:IF TERMA=TERME THEN GO TO ••• ; ELSE IF SPEC='.' THEN ••• : L4:IF NUMBER~1000 THEN ••• :

ELSE IF NUMBER<10 THEN ••• :

END STOCK:

Chapter 7: Executing the Load MO,dule 89

If this program, once compiled and

link-edited (or loaded), is executed wit:h the following EXEC statement:

I I EXEC PGM= ••• ,PARM='ABCDE1414*I/M'

then the elements of the structure variable VALUES will have the following values:

TERMA = 'A' TERMB = 'B' TERMC = 'c'

TERMD = 'D' TERME

=

, E'

NUMBER = '1414' SPEC ' *' CTCHAR = '11M'

These values will then be used in the four switching statements to determine which parts of the program will be executed and therefore what output the program will produce.

The result of the pointer assignment statement is that the elements in VALUES now have the appropriate values from the parameter field. If any character in the parameter field is omitted for a particular

job, i t must be replaced by a blank: this will create a blank in the corresponding VALUES element. The existence of a blank or blanks in these variables must be considered when the switching statements are coded, in order to avoid erroneous switching.

GET STRING or SUBSTR could be used in place of the pointer assignment, if the context was such that they offered an advantage.

DPRTY Parameter

If your load module is executed using the MVT control program, you can specify the priority for each job step. For details of this usage, see 'MVT Control Program' in Chapter 4, 'Job Initialization.'

The priority value specified in the EXEC statement is always overridden by a

priority value specified in the JOB

statement; if no priority is specified in the JOB statement, the value specified in the EXEC statement is assumed. I:f neither statement includes a priority parameter, the installation default (if any) is applied.

REGION Parameter

If your load module is executed using the MVT control program, you can specify a region size for the job step. For details of this usage, see 'MVT Control Program' in Chapter 4, 'Job Initialization.'

A region size specified in the EXEC statement is always overriden by a region size specified in the JOB statement. If a region size is not specified in the JOB statement, the size specified in the EXEC statement is assumed. If neither is specified, the installation default (if any) is applied.

ROLL Parameter

If your load module is executed using the MVT control program, you can obtain extra space dynamically in main storage by means of this parameter.

TIME Parameter

If your load module is executed using the MVT control program, you can specify the maximum time that this job step can use the CPU, by means of this parameter. The time specified here overrides the default time for the job class. This parameter is useful if there is a possibility that your program might go into a permanent loop or' if your program requires a long execution.

time.

STANDARD DD STATEMENTS

Three standard data sets can be used for the execution job step. These are:

Purpose Input Output Dump

ddname SYSIN

SYSPRINT

SYSABEND, SYSUDUMP, or PL1DUMP

Of these, only SYSPRINT is necessary in every job. If i t is omitted, the system messages will be put out on the operator" s console and the other output data will he lost. If your installation has

multiple-console support (MCS), you must find out on which console or consoles the system messages will appear.

Input ~SYSIN)

If you want to include data in the input stream., you can do so by means of a DD statemE:!nt of the form: / /ddname DO

*

immediately preceding the data. (A data set in the input stream does not have to be called SYSIN; i t can have any name.) The data should be 80-byte F-format unblocked records (for example, punched cards).

Code:

//SYSIN DD

*

input: data

/*

The SYSIN DD statements with this notation must be: the last statement in the job control statements for the job step for PCP. If the data includes the characters / / in col.umns 1 and 2 replace //SYSIN DD

*

by //SYSIN DD DATA.

The IBM-supplied cataloged procedures PL1LFCG# PL1LFCLG, PL1LFG, and PL1LFLG do not include a SYSIN DD statement. If you want to use one, you must qualify the ddname 1with the step name, that is, code //GO.SYSIN.

Output (SYSPRINT)

System a.nd problem program output can be put out through the system output streams.

The advantage of this is that each output stream can be associated with an output device, such as a printer; this device is speci f,ied in the SYSOUT parameter of the DD statement for the output data set. If, as is usual, output stream A is associated with a printer, the statement

//SYSPRINT DD SYSOUT=A

will result in all SYSPRINT data appearing in a printed listing.

The SYSPRINT data can include both system output (for example, diagnostic messages. from job control statements) and problem program output. If you want system and' problem program ouput to'be on separate listings, you can arrange this by means of the MSGCLASS parameter in the JOB

statement, see Chapter 4, 'Job Initialization.'

The IBM-supplied cataloged procedures PL1LFCG, PL1LFCLG, PL1LFG, and PLILFLG include this statement in the execution job step.

Dump (SYSABEND, SYSUOUMP, '" or PL1DUMP) If you want to obtain a printed listing of any of these dumps, code one of the

following:

/ /SYS}~BEND DO SYSOUT=A //SYSUDUMP DD SYSOUT=A //PL1DUMP DD SYSOUT=A

For further information on DD statements for dumps, see Chapter 14, 'other

Facilities of the Operating System'.

USER DD STATEMENTS

In execution of your program, you can create data sets or you can access data sets already created. For the types of data set that can be Qsed with a PLiI

program, see Chapter 9, 'Data sets and PL/I Files.' For the methods of creating or accessing these data sets, see Chapter 10, 'stream-Oriented Transmission,' and Chapter 11, 'Record-Oriented Transmission.'

The IBM-supplied cataloged procedures PLILFCG, .PL1LFCLG, PLILFG, and PL1LFLG do not include statements for user data sets.

If you want to include such statements, you must code them with the ddname qualified with the step name, that is, code

//GO.ddname.

Listing

CONTENTS OF SYSPRINT LISTING

The SYSPRINT listing that you obtain with your job consists of some or all of the

following entries, usually in the sequence given:

1. Job output, in the format established by any PUT FILE(SYSPRINT) statements in your PL/I source program.

2. Execution-time diagnostic messages produced by the PL/I library. These have the format:

lHEdddI Message text

where'ddd' is a decimal number.

3. Dump of part of or all main storage.

The important information here for you is the completion codes.

Chapter 7: Executing the Load Module 91

4. Diagnostic messages from any operating

6. Step completion information. This depends on your installation but will installation but will probably include

job name, job time, clock time, and

compilation and linkage-editor job steps (see Chapters 5 and 6 respectively),

Non-zero (value depends on cause)

Termination Normal Abnormal

The return code is provided by the PL/J[

library error~handlingsubrbutines. You can generate a return code in your program by coding the statements shown below; this code is added to the value provided by the PL/I library and is printed on the listing.

Single-task processing:

DCL IHESARCENTRY(FIXED BINARY(31,O»;

CALL IHESARC(expression):

Multitask processing:

DeL IHETSAC ENTRY(FIXED BINARY(31,O»;

CALL IHETSAC(expression):

Note: The entry point IHETSAC is applicable to the major task only.

On evaluation, the expression supplies the required value for the return code.

IHESARC and IHETSAC must be declared as fullword binary, otherwise errors may occur in the returned code because of the

halfword binary feature.

Communication with Program during Execution The DISPLAY statement provides a means of

If your installation has

multiple-console support (MCS), you must find out on which console your messages

Introduction

A cataloged procedure is a set of job control statements stored in a system library, the procedure library

(SYS1.PROCLIB). It comprises one or more EXEC statements, each of which may be

followed by one or more DD statements. You can retrieve the statements by naming the catalog,ed procedure in the PROC parameter of an EKEC statement in the input job stream. When the job scheduler encounters such an EXEC statement, i t replaces i t in the input stream with the statements of the catalogced procedure.

The use of cataloged procedures saves time and obviates errors in coding

frequent:.ly used sets of job control statements. Even if the statements in a catalogE:!d procedure . do not match your

requirements exactly, you can easily modify them or add new statements for the duration of a job.

This chapter describes seven cataloged

procedw~es supplied by IBM for use with the (F) compiler, and explains how to invoke them and how to make modifications to them ..

PL/I Cat:aloged Procedures supplied by IBM

The following paragraphs do not fully describe: the individual statements of the IBM cataloged procedures, since all the parameters are discussed elsewhere in this manual. Note that the cataloged procedures described here are the standard PL/I

cataloged procedures. I t is recommended that each installation review these

procedur~~s and modify them to obtain the most efficient use of the facilities available and to allow for installation conventions: refer to 'Permanent

Modification,' at the end of this chapter.

Dans le document It System/360 (Page 87-93)