SAMAGET

The SAMAGET routine reads and returns the next auxiliary subfile record into user storage.
view
The SAMAGET routine reads and returns the next auxiliary subfile record into user storage.
Calling Parameters
  • Address of a record area
  • Address of two-byte (halfword) record area length
  • Address of two-byte (halfword) area to return the actual length of record (optional)
Return Codes
Output Return Codes (general register 15):
  • 0
    Record successfully read
  • 4
    End of file
  • 8
    Database error
Calling Example: Assembler
The following is an example using assembler:
. . . SFGET CALL SAMAGET,(REC,RECL,RETL),VL GET SUB-FILE RECORD CH 15,=H'4' CHECK RETURN CODE BH DBERR ERROR BE DBEOF END OF FILE . . Process record . B SFGET . . . REC DC CL255' ' RECORD AREA RECL DC Y(255) RECORD LENGTH RETL DS H RETURN RECORD LENGTH
Calling Example: COBOL
The following is an example using COBOL:
. . . 77 RTNCODE PIC S9(8) COMP. 77 REC-AREA PIC X(255) VALUE SPACES. 77 REC-LEN PIC S9(4) COMP VALUE +255. 77 RET-LEN PIC S9(4) COMP. . . . SFGET. CALL 'SAMAGET' USING REC-AREA, REC-LEN, RET-LEN. MOVE RETURN-CODE TO RTNCODE. IF RTNCODE > 4 GO TO DBERR. IF RTNCODE = 4 GO TO DBEOF. . . . GO TO SFGET.