Saving Report Output in INTERNAL Format

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:


Top of page

x
Syntax: How to Suppress Field Padding in HOLD Files
SET HOLDLIST = PRINTONLY
TABLE FILE filename 
display_command fieldname/[In|Pn.d]
.
.
ON TABLE HOLD AS name FORMAT INTERNAL
END

where:

PRINTONLY
Causes your report request to propagate the HOLD file with only the specified fields displaying in the report output. If you do not issue this setting, an extra field containing the padded field length is included in the HOLD file. See Controlling Fields in a HOLD Master File.
fieldname/[In|Pn.d]
Specify correct lengths in the formats for integer and packed fields where you wish to suppress padding. These formats override the ACTUAL formats used for the display formats in the Master File. See Usage Notes for Suppressing Padded Fields in HOLD Files.

Note that floating point double-precision (D) and floating point single-precision (F) are not affected by HOLD FORMAT INTERNAL.

FORMAT INTERNAL
Saves the HOLD file without padding for specified integer and packed decimal fields.

For an illustration, see Creating a HOLD File With HOLD FORMAT INTERNAL.


Top of page

x
Reference: Usage Notes for Suppressing Padded Fields in HOLD Files


Example: Creating a HOLD File Without HOLD FORMAT INTERNAL

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    ,$


Example: Creating a HOLD File With HOLD FORMAT INTERNAL

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.


Information Builders