C$GetLastFileOp

Retrieves the last COBOL I/O operation performed.

Syntax:

Note: When calling this routine, ensure you are using the 1024 calling convention.

Use this library routine within a declarative procedure after an I/O error has occurred.

CALL "C$GetLastFileOp" USING operation

Parameters:

operation
PIC X(20)

On Exit:

operation
The name of the last I/O operation performed. The valid operations returned are:
  • Close
  • CloseUnit
  • Delete
  • DeleteFile
  • DeleteRandom
  • Open
  • ReadNext
  • ReadPrevious
  • ReadRandom
  • Rewrite
  • RewriteRandom
  • Start
  • Unlock
  • Write
  • WriteRandom

Comments:

If the operation is longer than 20 characters, it is truncated to the right.

If the value SPACES is returned that indicates that no operation is available.