Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

Types of conversion

&pagelevel(4)&pagelevel

Standard conversion

It is assumed that the source and target files for a conversion are stored on public volumes.

This might be called the standard case. Enough space for both files must be available. If this is not the case, conversion must be effected via an intermediate file.

Conversion via an intermediate file

  • General

    During file conversion, the target file requires about the same amount of disk space as the source file. A “self-contained” conversion without the need for additional space is not supported by PAMCONV. This means that enough disk space must be available for the target file. If this is not the case, conversion can be effected using an intermediate file on magnetic tape or private disk.

    When conversion takes place via an intermediate file, the FILE-DISPOSAL operand of the CONVERT-FILE statement (which specifies how the generated file is to be handled after conversion) is ignored.

    For this type of conversion, file convertibility is checked before an intermediate file is generated. This avoids a situation where the intermediate file would not be convertible into a target file.

  • Two-step conversion using an intermediate file

    This type of conversion is performed explicitly by means of two CONVERT-FILE statements.

    The two statements may be issued in the same program run or in separate program runs.

    • Step 1
      Conversion of the source (disk) file on magnetic tape or private disk.

    • Step 2
      Conversion of the intermediate file from magnetic tape or private disk into the target file.

  • One-step conversion using an intermediate file

    Two-step conversion as described above is combined into one operation here, which means that only one CONVERT-FILE statement is needed. This is achieved by entering DISK or TAPE for the DEVICE-FOR-TEMPFILE operand.

    After successful conversion from the source file to the intermediate file, the source file is deleted to obtain space for the target file.

    The intermediate file is assigned a name with the following format:

    SYSTMP.<tsn>.PAMCONV.<ss>.<cpusec>

    This intermediate file is erased after it has been successfully converted to the target file; otherwise further processing of the file is possible via this name.

    Internally, conversion is implemented in two steps as mentioned above. However, the user is not requested to make a new input until both conversion steps have been concluded.

 

Specification of the conversion options

The conversion variants are selected on the basis of the source and target file specifications and the entry in the DEVICE-FOR-TEMPFILE operand of the CONVERT-FILE statement:

  • DEVICE-FOR-TEMPFILE=*NONE

    No intermediate file is stored on a private volume, unless this is specified via /ADD-FILE-LINK.

    The following options exist:

    • The source file is specified as a disk file and there is no catalog entry or /ADD-FILE-LINK for the target file, or the target file is specified as a disk file.

      Conversion from source file on magnetic disk to target file on magnetic disk. (Standard conversion)

    • The source file is specified as a disk file and the target file is specified as a tape file.

      Conversion from source file on magnetic disk to intermediate file on magnetic tape. (Two-step conversion via intermediate file on magnetic tape: Step 1.)

    • The source file is specified as a tape file and there is no catalog entry or /ADD-FILE-LINK for the target file, or the target file is specified as a disk file.

      Conversion from source file on magnetic tape (must be an intermediate file generated by PAMCONV) to target file on magnetic disk.
      (Two-step conversion via intermediate file on magnetic tape: Step 2.)

    Specifying both source file and target file as magnetic tape files is not permitted.

    This implies that a file on magnetic tape must always be a PAMCONV intermediate file, otherwise conversion is rejected.
  • DEVICE-FOR-TEMPFILE=*TAPE

    An intermediate file on magnetic tape is generated in each case. The source and/or target file must not simultaneously be specified as a tape file via /ADD-FILE-LINK.

    The following options exist:

    • The source file is specified as a disk file and there is no catalog entry or /ADD-FILE-LINK for the target file, or

    • the target file is specified as a disk file:

      Conversion from source file on magnetic disk to target file on magnetic disk. (Onestep conversion via intermediate file on magnetic tape.)

  • DEVICE-FOR-TEMPFILE=*DISK

    An intermediate file on private disk is generated in each case. The source and/or target file must not simultaneously be specified as a tape file via /ADD-FILE-LINK. If the source and/or target file is defined by means of /ADD-FILE-LINK (for private disk), the volume specified in this command must not be identical to the private disk volume identified in the DEVICE-FOR-TEMPFILE operand.

    The following options exist:

    • The source file is specified as a disk file and there is no catalog entry or /ADD-FILE-LINK for the target file, or

    • the target file is specified as a disk file:

      Conversion from source file on magnetic disk to target file on magnetic disk. (Onestep conversion using an intermediate file on magnetic disk.)

Format of the intermediate file on magnetic tape

The source (disk) files may be SAM, ISAM or PAM files.

The ISAM access method is not defined for tapes. A standard format is therefore used for the intermediate file on tape. This is a SAM file containing the data records of the source file (ISAM: sorted by keys in ascending order). For general PAM files and load modules, a record consists of an 8-byte field with the user part of the PAM key and a 2048-byte field with the PAM block.

Additional file attributes are stored in a separate user header label (UHL).

Such an intermediate file is merely intended as a temporary file for conversion purposes. Magnetic tapes with standard labels must be used.

  • Two-step conversion via intermediate file on tape

    If several files are to be converted at the same time, /ADD-FILE-LINK with SUPPORT=TAPE(FILE-SEQUENCE =...) must be issued; otherwise the intermediate file on tape will be overwritten.

  • File attributes

    An intermediate file on magnetic tape has the following attributes:

    FCBTYPE = SAM
    BLKSIZE = (STD,16)
    RECFORM = VARIABLE
    LABEL   = STD
    BLKCTRL = PAMKEY
    

    Otherwise the default values from the FCB macro apply.

    As can be seen from the following diagram, an intermediate file on tape is always a K-SAM file, regardless of the key format or FCB type of the source and target files.

    Figure 13: Intermediate file on magnetic tape
  • User labels

    For the registration of the source file attributes, the user header label UHL1 with the following format is used.

    Positions

    Contents

    Function

    1..4

    UHL1

    user header label identification

    5..12

    PAMELA-I

    ID for ISAM intermediate file

    5..12

    PAMELA-S

    ID for SAM intermediate file

    5..12

    PAMELA-P

    ID for PAM intermediate file

    13..66

    CL54

    Name of source file

    67

    AL1(b)

    BLKSIZE=(STD,b)

    68

    X'02'

    RECFORM=VARIABLE

    68

    X'04'

    RECFORM=FIXED

    69..70

    AL2(r)

    RECSIZE=r

    71..72

    AL2(p)

    KEYPOS=p

    73

    AL1(k)

    KEYLEN=k

    74

    X'00'

    VALPROP=MIN

    74

    X'01'

    VALPROP=MAX

    75

    AL1(f1)

    LOGLEN=f1

    76

    AL1(f2)

    VALLEN=f2

    77

    X'80'

    DUPEKY=YES

    77

    X'00'

    DUPEKY=NO

    78

    XL1

    Printer control character (IDCEDMS)

    79

    CL1

    Library type ('P': PLAM)

    80

    XL1

    File indicator (X'40': FGG)

Format of the intermediate file on private disk

In contrast to an intermediate file on tape, an intermediate file on private disk has no special format. It is always a copy of the source/target file, depending on the conversion direction. The intermediate file is always generated as an NK file. This makes it independent of the private disk’s key format.

In the case of SAM files, the RECSIZE value of the copy (intermediate file) may differ from that of the NK source file. If the RECSIZE value of the NK source file is zero, the maximum possible value is used for the intermediate file.

The following diagram shows in which format the intermediate file is created on private disk and from which file the copy is made (depending on the conversion direction).

Figure 14: Intermediate file on private disk