In this challenge I’ll be working with a COBOL program to connect and communicate with a DB2 relational database table. Again, it’s not needed to know COBOL but I bet it would help.
I’ve read that COBOL is a relatively easy language to learn and I will take a shot at it together with Java after this mainframe series. I’ve tried some courses on Udemy but, with all due respect, they are horrible. I think I refunded 4 courses in total.
However, PluralSight has a very nice course brought by Tim Slate. I’ll definitely write a blog about that course! My backup is a course at GoGoTraining but that’s a bit too expensive right now. Of course, I won’t forget about Murach’s books 😉
View COBOL compile failure related to a misspelled internal file name
IBM Master the Mainframe – Part Three – Challenge #09
Let’s get right into it! We must navigate to Z30163.SOURCE and create a new empty member using the s db2cbl primary command. Then we’ll copy ‘zos.mtm2018.public.source(db2cbl)’ into it and execute it. Easy!
That’s done! MAXRC code was 12 so that means the compilation fails. Now where does it go wrong and how do I find the error? Well, let me tell you. Enterprise COBOL messages begin with IGY, so we can issue the find command f igy.
The first message beginning with IGYPS2122-S is a severe error indicating the real problem. The first error starts the chain reaction of errors. We know it’s a severe error as the error code ends with –S. The other errors end with a W which means they are just mere warnings. So let’s first fix the first. Uh… haha.
Study the message the text identifies and correct the code. They also gave a big hint, only 1 character is involved that creates the problem. Let’s open the code and search for every word beginning with REC and see what we find. Then fix.
I found the mistake, I’m not saying the mistake is on the screenshot. “IBM: Remember the big hint – removal of a single character in the COBOL will fix the problem”. Submit the code and hope you get return code 4. JOB07842 submitted! My ouput is good, now let’s copy my output to P3.OUTPUT(#09). Let’s verify!
Ouch! It’s empty! See, it’s always nice to double check! The JCL executes the COBOL code so it would read from my DB2 relational database table. But I guess it has the name wrong?
Let’s edit the DB2CBL code inside SOURCE. Look what the table name is called inside the code and make it read from my table name. Starting from line 000066 we see that it reads ACCTNO, LIMIT, BALANCE, SURNAME, … seems familiar? The change command should do the trick.
I’ll compile, then run the tso submit command. Your output should be in P3.OUTPUT(#09).
My output is what it should be! Yay! Another victory for team basement coders!
My disk space
You know, I was the kind of guy that bought an 85 cents hosting package and expects it to be enought to host a blog with already over a hundred images.
What’s your disk space status?