in IBM Master the Mainframe 2018, Mainframe

IBM MTM: Part Two – Challenge #06

Hey!

Brrr… it’s cold outside! I guess it’s a good time to stay inside and do another challenge! Who am I kidding… the weather doesn’t really matter. I stay inside anyway. Although I must say, I should install a window in my basement. Some sunlight might do me good.

We’re already at part 6 dear reader(s), mom and myself. I’m still really hyped for part three! I’m not rushing it, I want to digest all information before getting my hands on another challenge.

JCL, Data Definition Operation

IBM Master the Mainframe Part Two – Challenge #06

Yes, that. This challenge continues where challenge #05 ended and goes a bit more in depth. I quickly scrolled through the challenge when I was on my way home last night and read that, if I fail this challenge I’ll need to do challenge #05 again before I get another shot at this. Let’s do it right the first time!

In this challenge I’ll be introduced to JCL DD operations which are used to describe the program its inputs and outputs. Let’s listen to some Interstellar Ambient Mix music and get on with it.

Note to myself: read the error messages and take your time Kevin! 

Some useful information

(You can skip this.) Took this directly from the challenge #06 page.

  • DSNAME= Data Set Name of the physical resource.
  • DISP= DISPOSITION of the DSNAME phys. res.
    • SHR: res. exists and will share access.
    • NEW: resource gets created as output.
    • OLD: resource exists but wants exclusive access.
  • PATH= Unix file name path of the phys. res.
  • PATHOPTS= Access file- and status options.
  • * (asterisk): everything that follows the ‘*’ is data and NOT JCL.
  • SYSOUT=* writes the data to the system JES spool data set.
  • Entering ‘p‘ to the left of a line inside the SDSF status panel will purge the unwanted output.

Start your engines!

I wasn’t as adventurous as last time. This time I’ve read through the challenge and it looks relatively easy. I need to edit the #05 job so it copies the last names to output #06. This instead of copying the names to output #05.

Now let’s first take a look at the JCL job. Specifically line number 000007. I know what SYSOUT does, but what is SYSIN? I know that SORT is a program… but how does it work?

Let’s ask that question to my search engine. Hmm… I found some information on the asterisk parameter and here I found some information on SYSIN. It’s still not really a hundred percent clear to me what it does, I’ll get back to you after the break!

1
2
3
4
5
6
7
8
000001 //SORT05 JOB 1,NOTIFY=&SYSUID
000002 //STEP1 EXEC PGM=SORT
000003 //SYSOUT DD SYSOUT=*
000004 //SORTIN DD DSN=ZOS.MTM2018.PUBLIC.DATA(NAMES),DISP=SHR
000005 //SORTOUT DD DSN=&SYSUID..P2.OUTPUT(#05),DISP=SHR
000006 //SYSIN DD *
000007 SORT FIELDS=(1,5,CH,A)
000008 /*

So as you can see, I’ve highlighted the SORT program. It SORTS the data from SORTIN starting from column 1 for a length of 5 using the character CH format in ascending A order.

So I need to check which column lastname is inside ZOS.MTM2018.PUBLIC.DATA(NAMES) and change the SYSIN SORT to that column.

Let’s check the dataset using the bd command…

bd command line 000004

After execution we get the list like you can see on the image below. The first names are 11 characters long at maximum. The lastnames start from column 13 up to column 23. However we will only SORT based on the first five characters.

ZOS.MTM2018.PUBLIC.DATA(NAMES)

Let’s also check the previously sorted dataset from challenge #05.

Z30163.P2.OUTPUT(#05)

I don’t really see any difference? Anyway, let’s just do challenge #06.

I modified the code as follows.

1
2
3
4
5
6
7
8
000001 //SORT05 JOB 1,NOTIFY=&SYSUID
000002 //STEP1 EXEC PGM=SORT
000003 //SYSOUT DD SYSOUT=*
000004 //SORTIN DD DSN=ZOS.MTM2018.PUBLIC.DATA(NAMES),DISP=SHR
000005 //SORTOUT DD DSN=&SYSUID..P2.OUTPUT(#06),DISP=SHR
000006 //SYSIN DD *
000007 SORT FIELDS=(13,5,CH,A)
000008 /*

Observe the changes I made on line 5 and 7. Let’s execute is using submit ; =sd ; st.

JOB06009

Let’s use the to ask the system to display JOB06009 its information. Navigate to SYSOUT STEP1 and use s to select and view it.

The output looks okay at first glance. I can always check the dataset to see if it’s really sorted.

Looks good! Just looked at challenge #07 and it looks much more difficult than this. I’m really in doubt, I’m not sure if my armpits will be able to handle that much sweat.

Size issues

Gosh, my image gallery is getting so big that I’m having a hard time to navigate through it and embed images into my blogposts. Also my homepage is getting too long! When does WordPress its pagination activate? And WOW, those code snippets are so small! I need to fix that.

Are you also experiencing sizing issues? Let me know in the comments below!

Share this:

Write a Comment

Comment