z/OS MVS IPCS Customization
Previous topic | Next topic | Contents | Contact z/OS | Library | PDF


Format Service

z/OS MVS IPCS Customization
SA23-1383-00

IPCS provides this service with the format model processor service. See Format Model Processor Service.

The format service is available to format the output of your module. This service performs two functions:
  • Converts data to printable hexadecimal, if necessary
  • Formats data in the output buffer
At each invocation, the format service formats a maximum of one output line. Your routine must provide the following input:
  • The address of the output buffer by passing the exit parameter list address
  • The addresses of data items and/or labels by providing format patterns

The ADPLBUF field of the exit parameter list contains the address of the 133-byte buffer where the output line is formatted. ADPLBUF also contains two words of work area, ADPLFMT1 and ADPLFMT2, that the format service uses. The format patterns indicate data and labels to be inserted in the output line.

Your module can invoke the format service once and specify format patterns to create one output line or invoke the format service more than once and each time specify patterns for part of an output line. Note that if you choose to format a portion of a line, you must be careful not to overlay previously-formatted portions.

When a line is formatted, your module must invoke the print service to perform the print operation. The format service does not print the buffer.

You can invoke the format service by obtaining the address of the format service from the ADPLFRMT field in the IPCS exit parameter list, BLSABDPL, and using standard linkage conventions. The following discussion gives details on this method of invoking the format service.

When invoking the format service using standard linkage conventions, you must pass the address of the first format pattern in register 0 and the address of the exit parameter list in register 1.

When the format service passes control back to your module, register 15 contains a return code of 00 or 04. The value of the code is the same as that received by the format service when it used the storage access routine; the meanings of the codes are the same as for the storage access routine.

Figure 1 shows how a format service is invoked. Figure 2 shows format patterns associated with that invocation.

Figure 1. Example - Using the Format Service
*THIS SECTION ACTUALLY OUTPUTS TWO LINES OF A TAPE UCB THEN SKIPS A LINE
OUTPUTIT  LA R0,TAPE1         SET ADDR OF LINE 1 FORMAT PATTERN
          BAL RLINK, FORMAT   GO FORMAT LINE
          BAL RLINK, PRINTIT  GO TO PRINT IT WITH THE SERVICE RTN
          LA R0, TAPEL2       SET ADDR OF LINE 2 FORMAT PATTERN
          BAL RLINK, FORMAT   GO FORMAT LINE
          BAL RLINK, PRINTIT  GO TO PRINT IT WITH THE SERVICE RTN
          BAL RLINK, PRINTIT  GO PRINT A BLANK LINE
*THIS SUBROUTINE CALLS THE FORMAT SERVICE TO AUTOMATICALLY
*FORMAT AN OUTPUT LINE OF THE UCB.  INPUT TO THIS SECTION OF CODE
*IS THE ADDRESS OF THE FIRST FORMAT PATTERN IN REG 0.  REG 1 MUST
*CONTAIN THE ADDRESS OF THE ORIGINAL EXIT PARAMETER LIST.  IF
*DATA CANNOT BE OBTAINED BY THE SERVICE, CONTROL IS
*PASSED TO AN ERROR SUBROUTINE TO PRINT ERROR MESSAGE
FORMAT    L     R15,ADPLFRMT  GET RTN ADDR FROM PARM LIST
          BALR  R14,R15       GO TO SERVICE TO FORMAT LINE
          LTR   R15,R15       WAS FORMAT SUCCESSFUL
          BCR   8,RLINK       YES, GO PRINT LINE IMMEDIATELY
          B     ERROR         NO, GO TO ERROR ROUTINE
* THIS SECTION OF CODE IS USED TO CALL THE PRINT SERVICE.
* REGISTER 1 MUST CONTAIN THE ADDRESS OF THE ORIGINAL
* EXIT PARAMETER LIST.
PRINTIT    L     R15,ADPLPRNT       GET PRINT RTN ADDR FROM PARM LIST
           BALR  R14,R15            GO TO PRINT ROUTINE
           BR    RLINK              RETURN TO SECTION OF CODE ABOVE

Go to the previous page Go to the next page




Copyright IBM Corporation 1990, 2014