NOTE (BSAM)

Format

Read syntax diagramSkip visual syntax diagramlabelNOTEdcb_address

Purpose

Use the NOTE macro to obtain the relative position of the last block read or written in a BSAM file.

For many reasons, you may want to know the relative position of the last block you read from or wrote in a BSAM file. You may want to save the location of one or more of these blocks so that you can return to them at some later time.

The relative position of the block does not refer to its address on the disk or other such device. Rather, it refers to the block's position relative to the beginning of the file of which it is a part.

Parameters

dcb_address
Specifies the address of the data control block (DCB) associated with the BSAM file you are processing.

A DCB contains information that defines the characteristics of the data stored in a file and describes the I/O device requirements for handling its data. You are responsible for having created a DCB for the file in question through the DCB macro. See DCB (BSAM/QSAM).

You can write this parameter as an RX-type address or as register (1) through (12).

Usage

  1. Before you enter the NOTE macro, you must confirm that the last I/O operation was completed successfully. Use the CHECK macro to accomplish this. See CHECK (BSAM).
  2. The NOTE macro returns the record ID (or relative position) of the last block read or written in register 1. This is the position of the record within the file relative to the beginning of the file, not to the beginning of the auxiliary storage device. The macro stores the record ID in the following format:
    NNNz
    NNN represents the 3-byte file system record number, and z, a byte of zeros. You must retain this value in a register or in virtual storage for future reference.
  3. You can use the NOTE and POINT macros on any BSAM file. See POINT (BSAM). However, you must inform GCS before you do through the MACRF parameter in the DCB macro.
  4. GCS handles blocks as a group of records in a variable blocked file. Therefore the NOTE macro, for a variable blocked file, is passing back the file system record number of the last record read of the block. For fixed block files the NOTE macro is passing back the file system record of the first record read of the block.

Return Codes and ABEND Codes

ABEND Code Meaning
00A Either you specified an invalid address in the NOTE macro, or an invalid address exists in the data control block associated with your file.