gtps2m3vACF/SNA Data Communications Reference

Retrieving NCB and SPA Data Records (CSNB)

You must use the CSNB segment to retrieve node control block (NCB) or scratch pad area (SPA) records in the applications that you develop. For more information refer to Allocating or Retrieving a Scratch Pad Area (SPA) for a Dynamic LU or Migration Guide. You can also use this segment to retrieve the following:

If an error occurs, you can return to the calling program or exit using the EXITC macro.

The CSNB segment is activated using the ENTRC macro.

Input requirements are as follows:

Register 1  must point to a 5-byte work area aligned on a halfword
boundary. The format is:
 
Bytes 0-1                Contains the 2-byte resource identifier
                         (RID) for the requested NCB or SPA.
 
      0-2                Contains the 3-byte resource identifier
                         (RID) for the requested NCB or SPA.
 
      3                  Available data level for which the data
                         record may be retrieved.  This must be a
                         multiple of 8.  For example, X'00' means
                         data level 0, X'08' means data level 1 and
                         X'10' means data level 2, etc.
 
      4                  Option Byte
 
             Bit 0   =   0.  The NCB is requested
                     =   1.  The SPA is requested
                 1   =   0.  Retrieve the data record
                     =   1.  Return the file address of the data
                             record (no retrieval is required).
                 2   =   0.  Issue a FIWHC macro to retrieve the
                             record
                     =   1.  Issue a FINWC macro to retrieve the
                             record
                 3   =   0.  Return to caller on an error condition
                         1.  Issue EXITC on an error condition
                 4   =   0.  Retrieve 2-byte RID from bytes 0-1.
                         1.  Retrieve 3-byte RID from bytes 0-2.
                 5-7         Reserved and should be set to zero.

CNSB output is as follows:
 
     * Registers:
 
       R1         =   0   If the requested function was performed
                          successfully
                  =   1   If an error was encountered in calculating the
                          file address of the record
                  =   2   If an error was encountered on FINWC or
                          FIWHC macro
                  =   3   If the input parameter is invalid
       R1  - 5    =   Same as on entry
       6   - 7    =   Contents unpredictable
 
     * Data Levels:
 
       CE1CRx  =  Address of the main storage block containing the
                  requested data record
 
       CE1FAx  =  File address of the requested record
 
     * Entry Control Block Work Area
 
       EBX000 - EBX009 are used by this program
 
       CE1UR2 is the beginning of this program's save area for caller's
       registers 2 - 5