Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Creating work files

If you wish to create the work files explicitly, you must issue the appropriate CREATE-FILE commands. If you specify too little storage space (with SPACE), the value you specify will be corrected internally by BINILOAD.

/CREATE-FILE FILE-NAME=workfile-n [,SUPPORT ...]

/ADD-FILE-LINK LINK-NAME={SCRTCH1 | SCRTCH2 |SCRTCH3 |SCDnnnnn | STKnnnnn |
                        KEYnnnnn | KSTnnnnn | SORTWK | SRT1WK},
                       FILE-NAME=workfile-n[,ACCESS-METHOD={PAM | SAM}]

workfile-n

Freely selected name for the work file

SUPPORT

The storage space size can be specified with the SPACE entry in the SUPPORT operand:

ACCESS-METHOD


The work files SORTWK and SRT1WK are created as PAM files. The other work files are created as SAM files.

Link names for the work file

SCRTCH1
SCRTCH2
SCRTCH3
SCDnnnnn
STKnnnnn
KEYnnnnn
KSTnnnnn
SORTWK
SRT1WK


Calculating primary requirements for work files

The primary allocation for work files should be based on the data population that is to be buffered. There should always be an appropriate secondary allocation in case it should be necessary to extend the storage space.

The approximate space requirements for individual work files can be calculated by using the formulas below.

SCRTCH1

(total key lengths + 12) x number of input records Bytes

total keylengths:
is the total length of the following keys:

      • keys by which the owners of the set are selected
        (CALC keys, ASC/DESC keys, SEARCH keys or database keys)

      • keys that do not belong to a set (CALC keys)

      • keys for all sets in which these records are to be inserted
        (ASC/DESC keys, SEARCH keys).

SCRTCH2

12 x number of input records Bytes

SCRTCH3

3 x number of input records Bytes

SCDnnnnn

with 2048-byte page length:

40 x number of input records Bytes

with 4000/8096-byte page length:

50 x number of input records Bytes

STK nnnnn

with 2048-byte page length:

(8 + reclength_1) x number of input records Bytes

with 4000/8096-byte page length:

(12 + reclength_1) x number of input records Bytes

reclength_1:
reclength_1 is the sum of the key lengths of all SEARCH keys in the set withSET-REF nnnnn.

KEYnnnnn and for SEARCH key

with 2048-byte page length:

(16 + keylength_1) x number of input records Bytes

with 4000/8096-byte page length:

(24 + keylength_1) x number of input records Bytes

keylength_1:
Key length of the key with KEY-REF nnnnn

KEY mmmmm and KST nnnnn for SORT-Key

with 2048-byte page length:

(keylength_1 + 12 + keylength_2) x number of input records Bytes

with 4000/8096-byte page length:

(keylength_1 + 16 + keylength_2) x number of input records Bytes

keylength_1:
Length of the key used to specify the owner of the set.
This may be:
CALC keys, ASC-/DESC keys, SEARCH keys or database keys.

keylength_2:
Key length of the key with KEY-REFmmmmm
For KSTnnnnn with SET-REF nnnnn: keylength_1 = 0. 

SORTWK and SRT1WK

SORT needs the two work files with the link names SORTWK and SRT1WK if there is not enough virtual memory for pre-sorting. The primary allocation should be based on the data population that is to be sorted while taking account of the safety factor recommended by SORT (see the discussion of work files in the manual "SORT (BS2000)"). There should always be an appropriate secondary allocation in case it is necessary to extend the storage space.

The volume of the data that is to be sorted is calculated using the formula:

(reclength_2+SCD+12) x number of input records Bytes

reclength_2:
is the length of the database record.

SCD:
Length of the Set Connection Data. You can take over this value from the BPSIA log where it is located in the SYSINFO column under the heading
RECORD-INFORMATION (see the manual "Recovery, Information and Reorganization").

When the load operation is complete, it is up to you to delete any work files that were explicitly created.