Previous Topic: &USERPW

Next Topic: &ZACBNAME


&VSAMFDBK

Indicates the VSAM return code from a file processing operation.

A VSAM return code (extracted from the VSAM RPL) is set after the execution of the &FILE ADD, &FILE DEL, &FILE GET and &FILE PUT file processing statements. This return code is placed in the &VSAMFDBK system variable, which can then be tested to determine the exact cause of a VSAM-related error. For logical processing errors, the variable contains the two hexadecimal characters of the VSAM feedback, for example X'1C'. If a physical error occurs, the variable is set to contain the characters PY and a message is written to the activity log giving the actual error code. The meaning of the various return codes is found in your VSAM documentation.

Although &VSAMFDBK is always set, it carries an error-related code only if the &FILERC system variable has been set to a value of 8, indicating that an error has occurred.

Example: &VSAMFDBK

&FILE OPEN ID=HELPDESK FORMAT=DELIMITED 
&FILE GET ID=HELPDESK KEY='PROB005' VARS=TXT 
IF &FILERC NE 8 &THEN +
 &GOTO .OK 
&WRITE DATA=RECORD READ ERROR - VSAMFDBK = &VSAMFDBK

Notes:

The &FILERC system variable is set on completion of a file processing operation and should be used to determine whether the operation was generally successful.

Testing of the &VSAMFDBK system variable would normally only be performed if a severe error were detected. However, use of the &FILE GET OPT=UPD facility, where exclusive use of a record is requested, could result in the request failing if the record was already being processed elsewhere. In such a case, the user might have to test &VSAMFDBK to determine why the request failed and then retry if the failure was because exclusive use was not possible.

More information:

&FILERC