How to: |
Reference: |
HOLD files pad binary integer and packed decimal data values to a full word boundary. For example, a three-digit integer field (I3), is stored as four bytes in a HOLD file. In order for third generation programs, such as COBOL, to be able to read HOLD files in an exact manner, you may need to save the fields in the HOLD file without any padding.
To suppress field padding in the HOLD file, you must reformat the fields in the request in order to override the default ACTUAL formats that correspond to the USAGE formats in the Master File:
SET HOLDLIST = PRINTONLY TABLE FILE filename display_command fieldname/[In|Pn.d] . . ON TABLE HOLD AS name FORMAT INTERNAL END
where:
Note that floating point double-precision (D) and floating point single-precision (F) are not affected by HOLD FORMAT INTERNAL.
The syntax is
bytes = INT (n/2) + 1
where:
To avoid incorrect results, be sure that the format you specify is large enough to contain the data values.
In this example, the values of ACTUAL for RETAIL_COST, DEALER_COST, and SEATS are all padded to a full word. Alphanumeric fields also occupy full words.
TABLE FILE CAR PRINT CAR COUNTRY RETAIL_COST DEALER_COST SEATS ON TABLE HOLD AS DJG END
The request creates the following Master File:
FILE=DJG, SUFFIX=FIX SEGMENT=DJG, SEGTYPE=S0 FIELDNAME=CAR ,ALIAS=E01 ,USAGE=A16 ,ACTUAL=A16 ,$ FIELDNAME=COUNTRY ,ALIAS=E02 ,USAGE=A10 ,ACTUAL=A12 ,$ FIELDNAME=RETAIL_COST ,ALIAS=E03 ,USAGE=D7 ,ACTUAL=D08 ,$ FIELDNAME=DEALER_COST ,ALIAS=E04 ,USAGE=D7 ,ACTUAL=D08 ,$ FIELDNAME=SEATS ,ALIAS=E05 ,USAGE=I3 ,ACTUAL=I04 ,$
In this example, DEALER_COST and RETAIL_COST are defined in the Master File as D fields, but the request overrides RETAIL_COST as an I2 field and DEALER_COST as a P3 field.
SET HOLDLIST=PRINTONLY TABLE FILE CAR PRINT CAR COUNTRY RETAIL_COST/I2 DEALER_COST/P3 SEATS/I1 ON TABLE HOLD AS HINT3 FORMAT INTERNAL END
This creates the following Master File:
FILE=HINT3, SUFFIX=FIX SEGMENT=HINT3, SEGTYPE=S0 FIELDNAME=CAR ,ALIAS=E01 ,USAGE=A16 ,ACTUAL=A16 ,$ FIELDNAME=COUNTRY ,ALIAS=E02 ,USAGE=A10 ,ACTUAL=A10 ,$ FIELDNAME=RETAIL_COST ,ALIAS=E03 ,USAGE=I6 ,ACTUAL=I02 ,$ FIELDNAME=DEALER_COST ,ALIAS=E04 ,USAGE=P4 ,ACTUAL=P02 ,$ FIELDNAME=SEATS ,ALIAS=E05 ,USAGE=I4 ,ACTUAL=I01 ,$
The ACTUAL formats for the overridden fields are I2, P2, and I1. DEALER_COST has an ACTUAL of P2 because P3, the format override, means 3 display digits that can be stored in 2 actual digits. Note that the alphanumeric field is also not padded.