IBM MTM 2018: Part Three – Challenge #09

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?

4 thoughts on “IBM MTM 2018: Part Three – Challenge #09

  1. sir by mistake i have deleted the line number 66 and i am not being able to write the exact line back ,can you tell me what the line was … and in the previous correction was i supposed to change all ” RECIN” TO ” RECINX” ??

    1. Hi,

      I’m a bit late, but I believe you can navigate to ZOS.MTM2018 and get a clean copy of any exercise there. If I remember correctly, you need to change RECINX to RECIN. The “X” is an illegal character.

      Kind regards,
      – Kevin

  2. sir what change should i do in the last part where you have mentioned starting from line 000066 ;.. i tried a lot sir ..
    please can you help

Leave a Reply

Your email address will not be published. Name, email and website not required.