IBM MTM 2019: Part Two – Challenge #12

300 readers a day keep the doctor away!

I took a 5 day break from blogging but don’t worry. They only send out the badges of part 2 on the 20th of September. There’s still four days to finish part 2 in time.

Edit VSAM using File Manager

IBM Master the Mainframe 2019 Part Two – Challenge #12

I might have made a mistake in challenge #11 of part 2. Please forgive me 🙂 It’s a learning blog 🙂 Let me add a few more smileys to make it right 🙂 🙂

If you have only 4 lines in VSAM.ESDS then you need to go to PDS.DATA and make a new member called PACKED using s PACKED. Then copy ‘zos.mtm2019.public.shared.data(packed)’ into it. After that, edit Z######.JCL(IDCAMS) and change 000013 to PDS.DATA(PACKED) and sub ; =sd ; st. If it doesn’t work, then please do challenge 11 again.

How to open the File Manager

From the ISPF Primary Option Menu type F.2 and press enter.

Use File Manager to Identify and Modify Packed Decimal in a VSAM data set

Let’s edit VSAM.ESDS data set using the File Manager.

I now am in my VSAM.ESDS file. We need to change the File Manager Editor Format setting from CHAR to HEX.

Change the Format to HEX and press enter. Then enter the line command cols at 000009 and 000012. Next up we need to change a few things:

  1. Change packed decimal positive 4096 to positive 2048
  2. Change packed decimal negative 256 to negative 128

I have changed 04096A to 02048A and 256B to 128B. Let’s enter the primary command top and let’s prepare to copy the output to P2.OUTPUT(#12).

I have entered the line command c12 at line 000001 and the primary command rep p2.output(#12).  You should see Member #12 replaced in the upper right corner!

Let me see if I did it right.

Challenge #12 is correct! Nice!

IBM MTM 2019: Part Two – Challenge #11

In challenge 11 of IBM’s Master The Mainframe we’re going to learn a thing or two about VSAM. VSAM is one of several access methods in z/OS. But, more about this on the official challenge page.

VSAM Data Sets

IBM Master the Mainframe 2019 Part Two – Challenge #11

Define a VSAM ESDS and copy member of MVS Partitioned Data Set to new VSAM ESDS

Here we go again! We need to copy a data member to a new member inside our JCL data set.

  • dslist jcl as primary command from the ISPF primary option menu.
  • e line command next to the JCL DDNAME.
  • s idcams as primary command to create a new empty member.
  • copy ‘zos.public.jcl(idcams)’ as primary command when in edit mode of idcams.

Here we go. We need to submit this using sub ; =sd ; st but the nice thing is that we already know there’s going to be an error. Choose a as jobname character. We need to view the output of the SYSPRINT with StepName COPY.

Hmm, @@ NOT FOUND IN SYSTEM. We need to replace @@ with the appropriate OUTFILE value. Let’s navigate back to our member and correct the issue.

The outfile was declared as O1. That’s an O, O from Oscar. Not a zero. This should fix it. There are no other @@’s in this file anymore. Let’s sub ; =sd ; st. I chose job character e. Spoiler alert! This fix is not enough, keep on reading instead of executing!

It’s still doesn’t work? Well, it took me a whole 10 minutes to find why! My debugging skills are slacking. The input file is PDS.DATA(PACKED). But do you remember what we did with PACKED in challenge 8? We need it again. Go to PDS.DATA and make a new member called PACKED using the s PACKED primary command. Then copy ‘zos.mtm2019.public.shared.data(packed)’.

Let’s change that! And check the output.

12 records were processed! Awesome! Let’s check if it copied to our P2.OUTPUT(#11).

It did! We completed challenge 11!

IBM MTM 2019: Part Two – Challenge #10

More UNIX and more JCL? I can feel my beard growing already! Let’s grow a LINUX beard together!

Manage Unix Processing with JCL

IBM Master the Mainframe 2019 Part Two – Challenge #10

Submit JCL used to execute Unix shell commands

From the ISPF primary option menu we need to issue the primary command tso submit ‘zos.public.jcl(unixsh)’. Now via SDSF we need to check the job output, we can get to that using the sd primary command and then filter using prefix ; owner Z50087; st. Change my ID to your IBM ID.

Next to the job we can use the line command ? to see the output of the job. Next to every output we can use the line command s to select and view the job output.  We need to view DDNAME STDOUT with StepName SHELLSTDOUT is where the unix commands wrote the output.

Let’s go back to the output list by pressing F3. Now we need to view DDNAME SYSPRINT with StepName LISTCThis is the output of the VSAM linear data set. When you viewed it, just return using F3.

To view the JCL we can put sj line command next to the jobname in the NP column. When inside the edit mode we need to execute the primary command rep jcl(unixsh) and also copy the first 19 lines using c19 as line command at line 000001.

If you get a warning screen, then just press enter.

Modify JCL to execute Unix commands and write output to MVS Partitioned Data Set Member

This will be easy as cake! Let’s first navigate to our JCL data set using dslist jcl and edit the data set. Select s member UNIXSH.

We need to modify this member its STDOUT DD to DSN=&SYSUID..P2.OUTPUT(#10),DISP=SHR,DCB=LRECL=80Besides that we also need to change the //STDPARM DD * to only execute 3 commands.

  • sh uname -mrsvI ;
  • rm -r * ;
  • ls -al ;

Let’s see.

This looks like it. I’ll submit using sub ; dslist p2.output and see if the output is there.

Looks good! TSO SCOREP2 also deems this correct. I am a happy man!