IBM MTM: Part Three – Challenge #10

This challenge is a lot more difficult, in two ways even. It’s difficult because there’s no guidance and it’s difficult to write a blog about it as I’m not allowed to publish solutions. This time we need to locate invalid packed decimal data and fix it.

I’ll need to execute a program called ICETOOL to display and verify packed decimals inside the ZOS.PUBLIC.BBRI.CLIENTS data set. A good help for this challenge is the JCL used in Challenge #03. This challenges asumes we are aware of what the JCL does in challenge #03. I think I was aware, not sure? Uhh…

We need to be aware that only VERIFY is needed to complete the assignment. DISPLAY is not needed. VERIFY produces a return code 12 as a result of finding invalid packed decimal. However, the invalid packed decimal records are written in JCL job output.

Identify every invalid packed decimal record found within 10,000 records

IBM Master the Mainframe Part Three – Challenge #10

Well it’s pretty obvious that we’ll be using the same JCL as challenge #03 so I guess I can show you that much. I’ll just copy Z30163.JCL(SORT003) into a new file. I guess it doesn’t matter what I call the file. I’ll just navigate back to dslist and create SORT010 and just edit it from there.

So I already went ahead and changed the SETVAR to the data set we need and also deleted the DISPLAY statement as we don’t need that. Now what do I need to change? Let’s take a look at the data set.

I’ve put hex on for no reason at all. Seriously. So here we see that a row is 11 characters long. That might give you an idea on what we need to change in SORT010. I’ve changed what I needed to change but the records are written in the JCL job output.

I tried copying sort004 and write the output that way but I kept getting the error 11 BYTE RECORD LENGTH IS NOT EQUAL TO 80 BYTE LRECL FOR BAD. But when you think a little bit, IBM never said to use sort004 didn’t they? And the report is inside the JCL. So why not just XDC it?

I don’t think that just simply using XDC is enough? I am confusion.

Well I guess that just using XDC is enough. Weird.

Easy, but not easy.

I don’t really know what to think about this challenge. It just had me copy some old JCL, edit three things and copy the output using XDC. I’m not really sure if this solution is correct. I guess I’ll see later 🙂

What’s been easy but not easy for you this week?

PS: Did you notice? I published this post at 11/11/2018 11:11. Coolio!

Share this:

IBM MTM: 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?

Share this:

IBM MTM: Part Three – Challenge #08

Where is it? Hmm… I’m looking for some free time. Can’t seem to find any. It’s been a while. Rough week. I’ve changed the website a little bit. It’s also weird writing a blog on a monday, why didn’t I do it in the weekend? Don’t be confused, it’s not monday, I just publish late.

There’s a cookie notice now, and also some share buttons. The first happened because I want to be legal. The second happened because I didn’t really provide any convenient way of sharing a blogpost. Well, there’s that. Oh.. and I removed the ‘pat on the back button’. I didn’t really like it that much and it only worked half of the time.

And yes! I know! The cover photo of Java is really big. Am I even allowed to use their logo just like that? Hmm… I’ll see, if not… send me a mail at dmca@kevindurant.be.

Java and DB2 API, Application Program Interface

IBM Master the Mainframe – Part Three – Challenge #08

In this challenge we’re not supposed to know a thing about Java but the challenge includes a working example of a JAVA API to connect to a DB2 relation database table to read, write and update data.

Oh… you’re asking me if I know Java? Well… sort of! I’ve made some projects at college for Android class in Java.

Copy Java code from partitioned data set to unix file…

We jump to the ISPF Command Shell panel using =6 and enter the primary command “oput ‘zos.mtm2018.public.source(db2jdbc4)’ ‘db2jdbc4.java'”.

I pressed enter but nothing really happened. I think it just copied db2jdbc4 to db2jdbc4.java. Now let’s continue and jump to the Unix Services command shell prompt by entering =u. Then just execute javac db2jdbc4.java, javac actually is the compiler. Hence the ‘c’.

It seems there is not enough storage to load the DLL module we need. -Xms specifies how much memory we allocate to the pool. Maybe we should get that adjusted? Now exit and continue to TSO/ISPF and modify the SIZE value on the TSO/E LOGON display. The display where you, well, login.

Change value from 32768 to 262144 they say. Let’s just do that and login. Don’t forget to enter your password! Now let’s go back to the Unix Services Command Shell and compile again using javac db2jdbc4.java. Then execute the file using java db2jdbc4. Did you notice something? To compile it’s javac, to run it’s java 😉 

When you run the file you’ll see status ‘running’ in the bottom right corner of your screen. Let’s take a look at the output.

The output is beautiful but wrong. Connection authorization failure occurred. Reason: User ID revoked. That’s not good! We must fix it!

Let’s edit the file using oedit db2jdbc4.java, find and change z##### to your username and change wrongpwd to your real password. I’m not too comfortable hardcoding a password into a file but I’m not in a position to refuse.

I see two lines that I need to edit. However I’ll only do the first for the sake of this blog. I’ve noticed we’ve to run into another error because IBM wants us to. I’ve compiled successfully but ran into another error.

It looks like there’s a SQLERRMC. In normal human speech, that means it can’t find the correct table to select from. It also looks familiar doesn’t it? Let’s fix that.

It worked! However, there’s a string attached. Please look very close to the database name. It’s not as simple as just changing the hashtags.

Let’s exit the OMVS and tso submit ‘zos.public.jcl(db2jdbc4)’ to write the output to Z#####.P3.OUTPUT(#08). To be safe, just verify.

Looks good! All done!

Hmm… I want my own mainframe

Just like Sebastian did in Germany! When I was browsing mainframe.reddit.com I stumbled upon Sebastian’s mainframe video blog and I was baffled. Be sure to check him out!

When will you get your own mainframe?

Share this: