How to get the remainder from the operation of division.

Document ID : KB000052756
Last Modified Date : 14/02/2018
Show Technical Document Details

Description:

CA Easytrieve does not have a remainder function. The below code will give the remainder result.

Solution:

 FILE FILEA                              
     A-1          1         3 N
     A-RESULT     W         5 N 2
     A-REMAIN   A-RESULT +3 2 N 2
     *
     JOB INPUT(FILEA)
           A-RESULT = A-1 / 3