Bonjour, another another Java challenge!
I’m reading the intro and they say: Remember what you learned about hexadecimal values. You will need it. *Gulp* I hope I remembered at least something.
More Java using JZOS Toolkit
Use Java program to replace old string of text with a new string of text
Okay, let’s go back the the zjava.java file the same way we did in the last challenge. tso oedit from the ISPF menu and line command e next to the file name. Issue the primary command hex on so we can identify the issue with “Who said this “.
Now we need to go back to the ISPF menu. Enter =6 and issue the primary command obrowse ‘/z/public’.
Let me view it.
Hmm, there’s a difference alright! I see them, do you?
Are there any differences? Fix the JAVA code. How do you fix it? Go back to the java file, put hex on and overtype the hex with the correct values as seen in SOURCE.
Get new copy of JCL to compile and execute modified Java source code
We won’t execute the Java code again. Instead we’ll grab JCL to execute it. Let’s go to our jcl data set by using the primary command dslist jcl and we’ll make a new member called zjava using the primary command s zjava.
Inthere we’ll copy ‘zos.public.jcl(zjava)’.
We need to change the last //STDOUT to have it write to P3.OUTPUT(#07).
If you’re finished, execute using submit ; =sd ; st and go check P3.OUTPUT to see if you have the correct output. Let me see for myself…
There he is! Dear mister Einstein! Great man!
Last task to get full credit
We need to edit our P3.OUTPUT(#07) and copy our Java code into it. Let’s do that.
Don’t forget the a label as line command. Otherwise you’ll have copy pending!
This is my eventual output, minus the censoring ofcourse!