This time I’m tackling two challenges at once. I really want to get to challenge 15 by the end of this week. Let’s do this!
JCL & Unix Files
IBM Master the Mainframe Part Two – Challenge #12
In this challenge I’ll learn how to copy data to a Unix file using JCL. There’s several ways to do this but this challenge is particularly about using JCL. This could also be done by using Unix cp command, TSO ocopy, oput, oget, oputx and ogetx commands. And some other methods.
Let’s go ahead and view the JCL of CH12JCL.
I need to edit line 0000013 where SYSUT2 is the output of the data copy. I also need to change line 000017 where STDOUT is the output of the word count command. This proves that the data was successfully copied into the Unix file name.
The output of this JCL then needs to be copied to P2.OUTPUT(#12). Let’s read what IBM has to say about this challenge.
- Reminder – substitute your ID for Z##### and z#####
- Copy input is data set name Z#####.PDS.DATA member name MIX
- Copy output is Unix path and file name /z/z#####/mix
- Program IEBGENER DDNAME SYSUT1 is input
- Program IEBGENER DDNAME SYSUT2 is output
- JCL DD PATH= is used to reference Unix file name
- What follows PATH= must be enclosed in single quote marks
A comma is needed after the path name to continue the DD statement
- The Unix file path and file name is lowercase
- Program BPXBATCH DDNAME STDOUT is the Unix command output
- JCL RESULT stepname, DDNAME STDOUT, needs to write output to &SYSUID..P2.OUTPUT(#12)
So as you can read from the bullet list, the paths equals to “‘/z/z30163/mix’,” without the double quotes, lowercase. Then the DSN STDOUT needs to write to is &SYSUID..P2.OUTPUT(#12).
That’s pretty straight forward. Let’s change the JCL.
So we get MAXCC=0256 as expected! I’ll check member #12 inside P2.OUTPUT to verify the word count.
Looks like a word count! Let’s continue to challenge #13!
Unix System Services Fun and Facts
IBM Master the Mainframe Part Two – Challenge #13
In this challenge I’ll learn how to use JCL for Unix shell processing and I’ll also edit some Unix files. I need to execute CH13JCL then I’ll have to edit the file using the Unix shell prompt.
Let’s first verify the output.
Output written to sept1752. Looks like I can start enter the realm of Unix safely! I can do that by entering tso omvs as a primary command just about anywhere.
Looks familiar! Anyway, let’s edit sept1752. Entered oedit sept1752 and here I go!
It appears that 11 days are missing from the calendar. On line 8 starting in column 1 I need to enter the year in which the Gregorian calendar was first introduced. A quick Google search says that it was first introduced in the year 1582.
Then I’ll replace P2.OUTPUT(#13) using primary command replace p2.output(#13) and prepare to copy the first 99 lines using the line command c99.
Member #13 created! Now let’s exit the oedit section & the unix shell session and return to the ISPF session. I’ll go ahead and check if I’ve copied everything correctly.
P2.OUTPUT(#13) looks good!
I’m getting there! I’m slow I know! I could’ve done these challenges a month ago if I knew they were so simple. Part 3 is getting closer and I’m very curious about it’s difficulty. Please keep in mind that I won’t be posting part 3 solutions, I’ve promised that to Paul Newton! I will post my ideas on how to solve the challenges, but there’ll be less screenshots and code.
Next challenge will be about DB2. I’ll have to dig up my SQL skills again, hell yeah!
Have you made any progress anywhere?