• Aucun résultat trouvé

EXAMPLE: USER-WRITTEN EXIT ROUTINE

Dans le document Program Product (Page 157-160)

This example demonstrates a user-written exit routine. It is a SYNAD exit routine that examines the FDBK field of the RPL checking for the type of physical error that caused the exit.

After the checking~ special processing may be performed as necessary. The routine returns to VSAM after printing an appropriate error message on SYSPRINT.

ACB1 EXITS RPL1

PHYERR

ACB EXLST=EXITS EXLST SYNAD=PHYERR RPL ACB=ACB1,

MSGAREA=PERRMSG, MSGLEN=128

USING *,15

LA 13,SAVE

SHOWCB RPL=RPL1, FIELDS=FDBK, AREA=ERRCODE, LENGTH=4

PUT PRTDCB,ERRMSG

BR 14

ERRCODE DC PERRMSG DS DS

F'O'

OXL128 XL12 XL116 ERRMSG

PRTDCB SAVE SAVREG

DS

DCB DS DS

18F 3F

This routine is nonreentrant.

Register 15 is entry address.

Save caller's register (1, 13, 14).

Point to routine's save area.

If register l=address of RPL1, then error did not occur for a CLOSE.

Show type of physical error.

Examine error, perform special processing.

Print physical error message.

Restore caller's registers (1, 13, 14).

Return to VSAM.

RPL error code from SHOWCB.

Physical error message.

Pad for unprintable part.

Printable format part of message.

QSAM DCB

SYNAD routine's save area Save registers 1, 13, 14

APPENDIX A. INVOKING ACCESS METHOD SERVICES FROM A PROBLEM PROGRAM

Access method services can be invoked by a problem program through the ATTACH, LIN~, or LOAD and CALL macro instructions.

The dynamic invocation ~f access method services enables respecification of sel~cted processor defaults as well as the ability to manage input/output operations for selected data

sets.

AUTHORIZED PROGRAM FACILITY (APF)

For information on APF authorization, see "Security Protection."

INVOKING MACRO INSTRUCTIONS

The following descriptions of the invoking macro instructions are related to Figure 34 on page 145, which describes the argument lists referenced by the invoking macros.

LINK OR ATTACH MACRO INSTRUCTION

Access method services may be invoked through either the LINK or the ATTACH macro instruction.

The format of the LINK or ATTACH macro instruction is:

[name] LINKIATTACH EP=IDCAHS,

PARAM=(optionaddr [,dnameaddr]

[,pgnoaddrl [,iolistaddr]), VL=l

EP=IDCAMS

specifies that the program to be invoked is IDCAMS.

PARAM=

specifies the addresses of the parameters to be passed to IDCAMS. These values can be coded:

optionaddr

specifies the address of an option list, which can be specified in the PARM parameter of the EXEC statement and is a valid set of parameters for the access method services PARM command. If you do not wish to specify any options, this address must point to a halfword of binary zeros. Figure 34 on page 145 shows the format of the options list.

dnameaddr

specifies the address of a list of alternate dd names for standard data sets used during IDCAMS processing.

If standard dd names are used and this is not the last parameter in the list, it should point to a halfword of binary zeros. If it is the last parameter, it may be omitted. Figure 34 shows the format of the

alternate dd name list.

pgnoaddr

specifies the address of a 3-byte to 6-byte area that contains an EBCDIC starting page number for the system output file. If the page number is not specified, but this is not the last parameter in the list, the

parameter must point to a halfword of binary zeros.

If it is the last parameter, it may be omitted. If omitted, the default page number is 1. Figure 34 on page 145 shows the format of the page number area.

iolistaddr

VL=1

specifies the address of a list of externally controlled data sets and the addresses of

corresponding I/O routines. If no external I/O

routines are supplied, this parameter may be omitted.

Figure 34 shows the format of the I/O list.

causes the high-order bit of the last address parameter of the PARAM list to be set to 1.

LOAD AND CALL MACRO INSTRUCTIONS

Access method services may also be invoked via a LOAD of the module IDCAMS, followed by a CALL to that module. The format of the LOAD macro instruction is:

[name] {EP=IDCAMS/EPLOC=address of name}

where:

EP=IDCAMS

is the entry point name of the IDCAMS program to be loaded into virtual storage.

EPLOC=address of name

is the address of an a-byte character string 'IDCAMS bb'.

After loading IDCAMS, register 15 must be loaded with the

address returned from the LOAD macro. Then CALL may be lJsed to pass control to IDCAMS. The format of the CALL macro

instruction is:

LR

15,0

[name] CALL (15),

(optionaddr [,dnameaddrJ [,pgnoaddr]

[,iollstaddr]), VL

where:

15

is the register containing the address of the entry point to be given control.

optionaddr

specifies the address of an options list that can be specified in the PARM parameter of the EXEC statement and is a valid set of parameters for the access method services PARM command. If you do not want to specify any options, this address must point to a halfword of binary zeros.

Figure 34 on page 145 shows the format of the options list.

dnameaddr

specifies the address of a list of alternate dd names for standard data sets used during IDCAMS processing. If standard dd names are used and this is not the last parameter in the list, it should point to a halfword of binary zeros. If it is the last parameter, it may be omitted. Figure 34 shows the format of the alternate dd name list.

Appendix A. Invoking Access Method Services from a Problem Program 143

pgnoaddr

specifies the address of a 6-byte area that contains an EBCDIC starting page number for the system output file. If the page number is not specified, but this is not the last parameter in the list, the parameter must point to a

halfword of binary zeros. If it is the last parameter, it may be omitted. If omitted, the default page number is 1.

Figure 34 on page 145 shows the format of the page number area.

iolistaddr

VL

specifies the address of a list of externally controlled data sets and the addresses of corresponding I/O routines.

If no external I/O routines are supplied, this parameter may be omitted. Figure 34 shows the format of the I/O list.

causes the high-order bit of the last address parameter in the macro expansion to be set to 1.

Dans le document Program Product (Page 157-160)