Using Address SQL to retrieve items from a table with a where clause like below:
ADDRESS SQL "SELECT ITEM FROM TABLE WHERE LOCATION = 'TEST'
Say 'RC ' RC
If I inspect the RC variable it is always 0 no matter if the rows were found or not.
Release : 14.0
You need to test the value of the SQLCODE variable. Besides the value itself, OPS puts messages in the EDQ when an error occurs.
So, add to your REXX just after the SQL statement:
if sqlcode <> 0 then
do
say 'SQLCODE' sqlcode
pull errmesssage
say errmessage
end