search cancel

OPS/MVS REXX - Bad Arithmetic conversion error while executing REXX code in batch

book

Article ID: 201425

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

 

We are executing a REXX code through a batch job.

The job is failing with error " ERROR 41 RUNNING CRDPRCNT, LINE 17: BAD ARITHMETIC CONVERSION  ".

Line 17 is  x = amt/tot.

This division statement is not working when the REXX is executed in batch job. But the same REXX code is working when we execute the REXX code manually using !oI command.

Attached are 3 files: (1) Joblog for job execution, (2) JCL for the batch job, (3) REXX code being called and executed

 

Environment

Release : 13.5

Component : OPS/MVS

Resolution

Issue was caused by the input file, which was padded by the sort step with low values after the numeric data. So the program took the last numeric value padded with null values and made it a non numeric data, causing the exception error.  To correct the problem, the sort step was changed to pad the rest of the record with spaces.  Then the OPS REXX step was able to take the numeric values correctly, and the division worked successfully without further issues.    

-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------

When engaging CA Broadcom Support for these type of errors, repeat the error with trace i in the REXX, and provide the following:

* The JCL job being executed

* All REXX code involved

* The output of the job

*  Either a few lines of the input file, or the field formats of the file so that an input file can be created for testing.