IBM MTM: Part Two – Challenge #07

You, I welcome.

Voila, I’ve used the last bit of Yoda in me to write that intro. Wait, don’t tell me… you don’t know who master Yoda is? I’d show you, but I can’t use any copyrighted images. Nor have I a clue when I can use a picture and when I can’t.

It seems I’m writing this post on a Friday. This means that the weekend is at our doorstep fellow mainframers, readers, mom, dad, uncle and aunt Eugene. This also means that you have some extra time to read this blog and learn something more about z/OS data sets.

Hmm… wait! I’ll release this on a tuesday, darn it. I tried!

Challenge #07 – Data Sets, let’s dance!

This challenge is all about data sets. It still feels weird to write it like that, I used to write it as dataset. I just double checked and both are gramatically correct. Not important!

OOH! Guess it’s time to watch lecture 11! Be right back after the break! z/OS Communications Server Developer Joshua Bennetone first covers the basic data set naming rules.

Data set segments are easily comparable to how domain names work in webdevelopment but in reverse order. DEPT58.SMITH.DATA3 for example. High qualifier is DEPT58, Middle-level Qualifier SMITH and low-level qualifier DATA3. There are some other rules but let’s keep it simple, for now.

z/OS reads data records differently than other systems. They don’t manage data records as a stream of bytes. Unlike the way streams are dependentent on ASCII CRLF, z/OS records are assigned a length.

Records carry a record format attribute. Fixed (F), Fixed Block (FB), Variable (V), Variable Block (VB) and Undefined (U). More info at z/OS Basic skills.

Data Set Organization

This paragraph is more of a note to myself. You might want to skip this if you’re not doing the challenge yourself 😉

But nonetheless interesting! There are three types of data sets. Sequential, a collection of records. Partitioned a collection of members where the members contain records. VSAM, Virtual Storage Access Method, provides the flexibility to organize records in four unique types designed for high speed and high volume access to data.

We also need to understand some basic syntax in order to efficiently create a dataset. Syntax:

  • LRECL (logical record length)
  • RECFM (record format)
  • BLKSIZE (block size)
  • DSORG (data set organization)
  • SPACE
    • primary extent value, all sets have 1 primary extent
    • secondary extent value, numerous secondary extents are automatically created after the primary extent is full
  • UNIT and optionally VOL=SER= (device type and volume label)
  • LIKE (uses attributes of a like data set name for creating a new data set)

Almost there! Phew. Time for another lecture video 15! This video is about how z/OS manages data on disk volumes.

The IBM Z is connected to the disk storage controller using fiber optic channel. The OS knows the Disk Volume Labels and the respective Disk Device Address. The Disk Volume Label knows the location of the disk storage VTOC. The VTOC maintains the table of the data set names and freespace of that disk storage device.

In the case of MY.DATA, the VTOC knows the starting and ending location of the primary extent. All data have a primary extent that contain data. If the primary extent is full then a secondary extent with a different starting and ending location gets created.

YOUR.DATA only has one primary extent. An extent is a contiguous area on the disk storage device. There are several ways to create new data sets like the ALLOCATE command, using JCL, ISPF menus or other access methods.

Back to the challenge!

IBM Master the Mainframe Part Two – Challenge #07

I’m given a JCL script with 3 EXEC statements. Each statement can be seen as a JOB step. Line 000003 is STEP1, 000009 is STEP2 and 000020 is STEP3.

This script will fail, so let’s execute it…

JOB04081

I’ll carefully analyse what’s wrong. I won’t make the same mistake again as last time. Let’s take a look at the output…

IEF643I UNIDENTIFIED POSITIONAL PARAMETER IN THE DSORG SUBPARAMETER OF THE DCB FIELD

Don’t forget, you can read the entire error by moving to the right using the right <number> command. This allowed me to read the entire error. I’ll highlight where it goes wrong.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
000001 //CH07JCL JOB 1,NOTIFY=&SYSUID
000002 //* --------------------------
000003 //STEP1 EXEC PGM=IDCAMS
000004 //SYSPRINT DD DUMMY
000005 //SYSIN DD *,SYMBOLS=CNVTSYS
000006 DELETE &SYSUID..CLIENTS
000007 SET MAXCC=0
000008 //* --------------------------
000009 //STEP2 EXEC PGM=SORT
000010 //SYSOUT DD SYSOUT=*
000011 //SORTIN DD DSN=ZOS.MTM2018.PUBLIC.CLIENTS,DISP=SHR
000012 //SORTOUT DD DSN=&SYSUID..CLIENTS,DISP=(NEW,CATLG),
000013 // DCB=(DSORG=@@,RECFM=@@,LRECL=@@@,BLKSIZE=@@@@),
000014 // SPACE=(@@@,(@,@)),UNIT=@@@@@
000015 //SYSIN DD *
000016 OPTION COPY
000017 //* --------------------------
000018 // IF RC = 0 THEN
000019 //* --------------------------
000020 //STEP3 EXEC PGM=IKJEFT01
000021 //SYSTSPRT DD SYSOUT=*
000022 //SYSTSIN DD *
000023 LISTDS CLIENTS
000024 //* --------------------------
000025 // ENDIF

I need to replace the @ symbols with data set name attributes in order for the script to run successfully. I’ve used the DFSMS knowledge center page as a guide to understand the parameters better. To be more specific, the page about Absolute Track helped the most.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
000001 //CH07JCL JOB 1,NOTIFY=&SYSUID
000002 //* --------------------------
000003 //STEP1 EXEC PGM=IDCAMS
000004 //SYSPRINT DD DUMMY
000005 //SYSIN DD *,SYMBOLS=CNVTSYS
000006 DELETE &SYSUID..CLIENTS
000007 SET MAXCC=0
000008 //* --------------------------
000009 //STEP2 EXEC PGM=SORT
000010 //SYSOUT DD SYSOUT=*
000011 //SORTIN DD DSN=ZOS.MTM2018.PUBLIC.CLIENTS,DISP=SHR
000012 //SORTOUT DD DSN=&SYSUID..CLIENTS,DISP=(NEW,CATLG),
000013 // DCB=(DSORG=PS,RECFM=FB,LRECL=170,BLKSIZE=8500),
000014 // SPACE=(TRK,(1,1)),UNIT=SYSDA
000015 //SYSIN DD *
000016 OPTION COPY
000017 //* --------------------------
000018 // IF RC = 0 THEN
000019 //* --------------------------
000020 //STEP3 EXEC PGM=IKJEFT01
000021 //SYSTSPRT DD SYSOUT=*
000022 //SYSTSIN DD *
000023 LISTDS CLIENTS
000024 //* --------------------------
000025 // ENDIF

JOB04165 successfully completed! Now just to write the output to member name #07 in P2.OUTPUT.

Yarr! Let’s copy the output!

Did it copy?

Yes it was copied! WOW!

THIS POST IS LONG I KNOW

This post is a thousand words long! Imagine if I was paid per word… Also, I’m sorry it took a week for me to release something. Been busy!

Took a sneak peek at challenge #08 and it’s about bits, bytes, hexadecimal, EBCDIC, and ASCII. Interesting!

What’s been keeping you busy?

Share this:

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=&amp;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=&amp;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=&amp;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=&amp;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:

IBM MTM: Part Two – Challenge #05

YES HELLO!

THIS CHALLENGE IS ABOUT JCL AND JCL IS UPPERCASE. I JUST READ THAT PEOPLE SHOULD BE ABLE TO COMPLETE PART 2 IN JUST ABOUT A WEEK… GULP! I’M ONLY AT PART 5 OUT OF 15…

I HAVE TO HURRY! ANYWAYS IT’S KIND OF IMPOSSIBLE AS THE POSTS ARE SCHEDULED PER 2 DAYS.

BY THE WAY, HOW HAVE YOU BEEN?

ON THE OTHERHAND, LET’S GO!

Challenge #05 – Job Control Language, JCL and the meaning of life inside a big iron

IBM Master the Mainframe Part Two – Challenge #05

Today marks the day that I first learnt something about JCL besides its existance. JCL is used to define jobs. I would like to explain JCL a bit more during this intro but I’m afraid IBM’s explanation will be a lot better than mine. If you’re interested you can view it at mybluemix.net. I will explain my actions throughout my blog though 🙂

First let’s get and select my partitioned data set with my ID as its name. This is done by issuing dslist ‘Z30163.jcl’.

Editing it will return a list of all available JCL documents. Now let’s select CH05JCL to view it.

Hmm, looks a bit messy! Let’s fix that! The reset primary commands hides the ==MSG> lines and hilite jcl, well… highlights the JCL code.

Execute order 66!

Now all the unwanted lines are removed and the code is highlighted. The challenge is to figure out what I should write instead of DDNAME. Let’s figure it out together shall we? Should be fairly easy!

First run the job and check what the error message is. That’s how I do it when I’m writing code at work 😉 Well… not exactly. I’m using a linter and can debug properly but hey, let’s continue.

submit, well submits the job. Then we state that we want it to jump to the SDSF status display.

Now where is JOB07618? Let’s select it…

Found it!

Now let’s check the STEP1 output to see what’s wrong.

Hmm, at the time of writing this I was well aware of the error. My javascript experience in undefined variables failed to notify me that SORTOUT should be defined. Instead of that I went looking for a data set name to replace DDNAME with.

My initial idea was to replace DDNAME with SPF2 as it was a data set. Lets try…

Executed…

SORTOUT still not defined. Holy cowboybelts! At this moment I realised what caused the issue of ‘SORTOUT NOT DEFINED’. It was not defined… Let’s define it!

I changed DDNAME to SORTOUT and executed the JCL job.

Let’s check JOB07698 its output.

YES! I DID IT! No more SORTOUT NOT DEFINED but a correct, wouldn’t say clean, job output.

Wow, this blogpost has a lot of screenshots… This challenge took me about 30 minutes and it would’ve been more if it weren’t for that sudden realisation.

Foot

That’s right, I just wrote ‘foot’. Not footer, not footnote… just foot. If you have an issue with this then express your feelings to idontlikefoot@kevindurant.be.

I AM STOKED! This challenge was really interesting and I feel like I’ve learnt a lot. I should’ve checked the IBM Knowledge Center about SORTOUT before analysing and digging for errors. Sometimes I forget about all the resources the internet offers… BAD!

It’s almost 11pm and I’m still writing a blog, I have to work tomorrow you know!

Take care and sleep tight!

Share this: