The IBM Decimal Arithmetic Library for Java enables Java applications to duplicate the results of COBOL's arithmetic with extreme precision.
Location of the blog post announcing the 2.0 version.
https://community.ibm.com/community/user/blogs/gregory-cernera/2026/04/07/ibm-decimal-arithmetic-library-for-java-v20-releas
The post is also the location of the original code.
Note: The published code didn't compile so I researched the issues and made changes. The code I post here did give me a clean compile however, running this code at home, I get a runtime error since I don't have the IBM Dataaccess product on my laptop.
This is a tiny project that I ran from the terminal shell. I used vim to edit the files.
I used Maven to download the jars because the only known source was the Maven repo.
I had to use javap (the java profiler) to find the static INSTANCE variable in the DAAFactory class which was a change I found necessary to make. javap also showed me the correct paths for the classes. The other necessary change was to have main throw Exception because the FormatterException used in the code on the announcement post doesn't exist in the jar I downloaded from the Maven repo.
These are the commands used in this project.
mvn dependency:copy-dependencies -DoutputDirectory=./lib
export IBMJAR=.:./lib/decimal-arithmetic-2.0.0.jar:./lib/ibmjzos-2.4.11.3.jar
javap -cp lib/decimal-arithmetic-2.0.0.jar com.ibm.arithmetic.decimal.daa.DAAFactory
javac -cp .:$IBMJAR TestInterestExample.java
mvn clean install
java -cp .:$IBMJAR TestInterestExample