IBM MTM 2019: Part Three – Challenge #06

Okay, another Java challenge! I like that, more coding problems! I have those daily at my j… No I don’t… heheh (awkward smile).

JZOS Toolkit API for Java

IBM Master the Mainframe Part Three – Challenge #06

Copy Java source to your Unix directory

Let’s get started by making sure we have the needed resources. From ISPF I enter the primary command =6 and enter oput ‘zos.mtm2019.public.p3.source(zjava)’ ‘zjava.java’ as primary again shortly after.
The text should then jump to the other line. That’s okay!

View the Java source in your Unix subdirectory

From the same screen we enter oedit.

We now see a file explorer that looks like it was built in one of the matrix movies. We need to edit zjava.java, we can do so by entering the line command next to the file name.

Press enter. You might have to press it twice as another screen pops up. Ignore that one.

I now get to see the file, IBM explains what the code does. We also see that scary warning. But I’m not scared, are you?

Submit JCL to compile and execute Java source program

Let’s run… not away, but the script. Let’s enter tso sub ‘zos.public.jcl(zjava)’ ; =sd ;st as primary command and try to identify the error.

If you can’t see your jobs, try entering prefix * ; owner z#####; as primary command. Thank you Georges! Enter line command v next to STDERR and let’s see..

It looks like there’s an undefined variable? Let’s fix that!

Identify and correct Java compile error

Let’s go back to the ISPF Primary Option Menu and enter the primary command tso oedit. Let’s edit zjava.java and correct the syntax error.

THINK WELL, IBM SAYS: “What was the name of integer value declared early in the Java program?”; You can use the primary command f int to highlight the text ‘int’. That should help!

If you think you’ve fixed it, enter the primary command tso sub ‘zos.public.jcl(zjava)’ ; =sd ; st and check the output to see if the error is gone. If it’s gone, congratulations!

Verify the completion of challenge #06

I have this output in my P3.OUTPUT data set. This means I got it right! On to challenge #07!

6 thoughts on “IBM MTM 2019: Part Three – Challenge #06

  1. Hi Kevin,
    I have the same result, but for me is not exactly the right one, because in the zjava.java there is a line with a replace instruction the text “Who said this” with “Albert Einstein”.
    In the instructions: …Line 13 replaces Who said this   with Albert Einstein… ???
    I have asked this in slack too!!
    And thx for mentioning myself!
    Kind regards
    Georges

    1. Ok ok!
      I just found the solution, the issue will be resolved in challenge 7 !!!
      Someone had to say this!
      Salut
      Georges

Leave a Reply

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