Previous Topic: &NDBERRI

Next Topic: &NDBRID


&NDBRC

Indicates the success or otherwise of an &NDBxxx NCL statement.

The &NDBRC system variable is set by all &NDBxxx NCL statements, to a value that indicates whether the requested function was performed successfully (&NDBRC set to 0), or not (&NDBRC set to a non-zero value).

The NCL procedure can test the value of &NDBRC to control processing. For example, &NDBRC is set to 1 if an &NDBGET statement does not find a record with the matching key or RID.

&NDBRC values fall into three categories:

OK

&NDBRC = 0

Warning

&NDBRC = 1 to 29

Error

&NDBRC > 29

Warning responses include such things as: Record not found, End-of-file, Scan exceeded a limit.

Error responses include such things as: Invalid field name or value, Unknown keyword in free-format text, Unknown format or sequence name.

Example: &NDBRC

&NDBADD ... 
&IF &NDBRC NE 0 &GOTO ADD_ERROR

Notes:

This example shows how the result of an &NDBADD is determined by using &NDBRC.

If no NDB statements have been issued by the executing NCL process, &NDBRC is always null. Once an &NDBxxx statement has been issued, &NDBRC always has a numeric value.

&NDBRC is always reset when the next &NDBxxx statement is executed. For this reason, the value should be saved in a user variable if other &NDBxxx statements must be executed before using the saved value.

Error responses (&NDBRC > 29) are not returned to an NCL procedure unless &NDBCTL ERROR=CONTINUE is in effect. Instead, the procedure will be aborted. &NDBOPEN and &NDBCLOSE are exceptions to this rule. They are always treated as if &NDBCTL ERROR=CONTINUE is in effect, except for responses 34 (Already open, on &NDBOPEN), and 35 (Not open, on &NDBCLOSE).

Note: For more information about &NDBRC values, see the Network Control Language Programming Guide.

More information:

&NDBERRI