Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

SAM converter

In comparison to the data structure expected by SAM, text based data of node files are, with the exception of line feeds (LF) used to separate records, non-structured. Therefore, the SAM access method needs an “interpreter”, the SAM converter, that can map the SAM specific processing of a BS2000 disk file onto the node file. The SAM converter is part of the net client.

Figure 3: Converting a SAM node file

The SAM converter modifies logical SAM blocks during the writing or transferring from BS2000 to Net-Storage as follows:

  • It removes the block control field (CF), the data length field (DL) and the record length fields (RL).

  • Depending on the specification for the NET-CODED-CHAR-SET file attribute, a code conversion is performed for the data (see section "Character set for node files").

  • After each record, a line feed (LF) matching the coded character set (CCS) is inserted.

In the other direction, that is when reading the data, the SAM converter builds logical SAM data blocks as if the SAM access method would read the data from a BS2000 disk:

  • At the beginning of each logical block, it inserts the block control field and the data length field.

  • It adds record length fields to the records from the node file.

At every OPEN, the SAM converter analyzes the SAM node file and creates a node file positioning list, which states which virtual logical BS2000 block numbers correspond to which real byte positions within the file on the Net-Storage. While doing so, it determines the file size in PAM pages (LPP) and reports it back to BS2000. By referencing this list, the SAM converter can read any logical blocks in the file, prepare them and send them to BS2000 (e.g. display of a specific record for SHOW-FILE). This list is also a prerequisite for an OPEN EXTEND or REVERSE.

The positioning list exists temporarily while the file is opened, until the CLOSE. For very large files, it may take some time to build the list and require larger main memory resources of the net client. If extremely large files and many files at once are processed, it may come to resource shortages on the net client, which are answered with the corresponding return codes.

Information on using RELSE

Calling RELSE closes the current logical block and starts a new logical block. The block number of the retrieval address is increased by 1 and the record number reset to 0. At the same time, another entry is added to the positioning list of the net client, so that, as in SAM processing on public space, this position can later be found again and recognized as the start of a logical block (SETL).

However, in the case of SAM node files, the data are not written as blocks but as one continuous sequence without gaps. As soon as at least one RELSE is called during the processing of a SAM node file, the saved retrieval addresses become useless after the file is closed and opened again, because they may no longer match the node file positioning list.