Well this is turning out harder than expected. I basically expected minor ENVIRONMENT and DATA DIVISION issues between MVS and DOS. Not data and logic issues. I mean IBM COBOL should basically be IBM COBOL. But Noooooooooooo!
I wanted to make a few small changes like accepting input from the console. And I wanted to right justify and replace spaces from the input with zeros using the INSPECT. But no such animal. Then I got a whole bunch of truncation warnings and any value > ~200…dumps. No problem I’ll use “ON SIZE ERROR” with some DISPLAYS on all the math statements to narrow down the problem. But the compiler doesn’t like that for some reason. Right justify is not working like I expected. I’m sure COBOL rust is playing a part. So, as of now you must enter leading zeroes. so 00200 for 200.
I’m getting “ILA5011I-W HIGH ORDER TRUNCATION MIGHT OCCUR.” on “ADD +2 TO I” and it is defined as “77 I PIC S9(8) COMP VALUE +1.”. Yeah it might occur if I do that ADD 2, ~50 million times. I mean anything is possible, but it seems a little over cautious to me.
It was fairly easy to port to gnuCOBOL. IBM COBOL to IBM COBOL should have been a piece of cake.