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:

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:

IBM MTM: Part Two – Challenge #04

Well hello there person!

It’s funny to think that this blog actually exposes who I really am more my Facebook profile does isn’t it? I think I’ve posted a total of 3 facebook statuses in the last three, maybe four, years. That’s great!

SDSF – System Display and Search Facility: the movie

IBM Master the Mainframe Part Two – Challenge #04

I have to admit, I had to watch the lecture 9 video a few times before being able to fully understand what SDSF can do and how to work with it.

In Challenge #04 I’ll learn how to submit some JCL to execute a job. Review its output and write that output to P2.OUTPUT. Now, let’s blast some Stephan Bodzin through my speakers and get on with the challenge!

First let’s open the SDSF by using the sd command in the main menu.

SDSF Editor

Now I’m about to apply a filter which only displays every item owned by my ID.

owner z30163 tells the system to limit the jobs by owner. prefix tells the system to filter jobs by name. st instructs to display the ST panel so we can view the statusses of all entries.

‘owner z30163; prefix; st’ result

Now IBM tells me to just submit a job, so let’s go ahead and do that.

Done! In the command line you can see the code to execute the job. Further down the screen I had to enter b as the jobname and pressed enter to execute the job. Those three asterisks means that the system is waiting for me to press enter so it could continue.

Oof, I pressed enter and it went wrong? Let’s see. Oh wait… nevermind! The interface just doesn’t refresh. I entered the owner z30163; prefix; st command again to refresh.

Oh, was reading the next instructions and they explicitly said that you will need to refresh. Sometimes I’m just too impatient, guilty as charged!

Job output.

I’ve typed 3 in the command bar so I can quit the output view and return back to the previous menu. Well I thought that would work and it didn’t. Used f3 and it put me straight back to the menu.

The challenge

I need to write this JESMSGLG output to my P2.OUPUT dataset. This process is almost trivial to the last challenge, it’s just a bit easier because of the SDSF.

First print the JESMSGLG output. xdc is used to store the spool information into a dataset. It will open a SDSF Open Print Data Set menu.

Now we get to see the Open Print Data Set menu.

Now we need to fill in to which data set we wish to print the output to and which member we want to use. The SHR disposition specifies that the data set exists before this step. Other jobs can share the dataset and use it at the same time, think of SHR as SHARE.

Let’s go ahead and initiate the copying.

It’s hard to spot but in the upper right corner it says PRINT CLOSED so that means the data is copied! Hooray! I’ve entered return to return to the ISPF primary menu.

Now I’m ready to continue to Challenge #05! I have to admit one thing. For what is was, the challenge looked a lot more scary than it was in reality.

I’ve just checked challenge #05 and again it looks more challenging that #04. I guess I’ll study it a bit first and then report back 🙂

Programming on a Sunday

It feels weird. Sometimes it feels like I’m at my job but actually doing my own thing. I’m as exhausted as I would be after a day of hard work.

I know, this blog is probably released on a wednesday but I wrote it on a sunday. Are you upset about this? Mail your opinion to wednesdayisnotsunday@kevindurant.be!

What are you working on? Do you also code in your free time?

Share this: