Information
Limited support BMC provides limited support for this version of the product. As a result, BMC no longer accepts comments in this space. If you encounter problems with the product version or the space, contact BMC Support.BMC recommends upgrading to the latest version of the product. To see documentation for that version, see BMC AMI SQL Explorer for Db2 13.1.

Printing error messages


The following code formats and prints SQL error messages to the SYSTSPRT data set when the product is running in batch mode or TSO:

rc = pssrxsql("select current_timestamp into :TS from sysibm.sysdummy1")
if rc <> 0 then do                                                      
   msg = "BMC184001S-PSSREXIT rc=" || rc || "/n"                        
   if sqlcode <> 0 then do i = 1 to 1000 by 80                          
   m = substr(sqlerrm,i+1,79)                                           
   if m = ' ' then leave                                                
   msg = msg || "BMC184001S-" || m || "/n"                              
   end                                                                  
   rc = sets("OUT", msg)                                                
end
Warning

Note

BMC does not recommend using the SAY command instead of the STEPS function because the DBC does not allocate a SYSTSPRT data set.

You can use the REXX variable SQLSTATE instead of SQLCODE. SQLSTATE indicates both warnings and errors.

If the product issues a warning without an error, PSSRXSQL returns rc=0, SQLCODE=0, ignoring warnings so that all the row values are returned. If you want to inspect warnings, use the SQLSTATE variable.




 

Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*

BMC AMI SQL Explorer for Db2 12.1