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:

6 thoughts on “IBM MTM: Part Two – Challenge #07

  1. Howdy! I could have sworn I’ve been to this blog before but after reading through some of the post I realized it’s new to me.

    Anyhow, I’m definitely happy I found it and
    I’ll be bookmarking and checking back frequently!

    1. Hi mixotekno

      I’m glad to see I have another reader, I’m happy to have you! I hope this blog helps you a bit through IBM’s Master the Mainframe contest.

      Please let me know if there’s something that could be improved 🙂
      Kevin

  2. Realllllly stupid question but how did you view the P.2 output in that last screenshot? i feel like i should know this by now lol. Like everything else went right and i tried to mess around in the data sets but i couldnt find how to see if it copied.

    Thanks.

    1. Hi Anonymous, there are no stupid questions! When you’re at the homescreen (ISPF Primary Option Menu), enter =3.4 and then you’ll see the Data Set List Utility screen. There you can filter by Dsname Level, do so by entering your IBM ID. Then tab to P2.OUTPUT and enter line command e to edit, then tab to member name 07 and enter line command s. This should show you the text. Hope I helped! 🙂

      Like this:

        https://kevindurant.be/wp-content/uploads/2018/11/output_1.png
        https://kevindurant.be/wp-content/uploads/2018/11/output_2.png
        https://kevindurant.be/wp-content/uploads/2018/11/output_3.png
        https://kevindurant.be/wp-content/uploads/2018/11/output_4.png

      – Kevin

Leave a Reply

Your email address will not be published.