IBM MTM: Part Three – Challenge #06

I’ve noticed some other Belgians have reached the wall of fame on mybluemix, nice! All from the same school too! Where are the New Media and Communication students at? Hello? *echo*

Come on Kevin! I know, I know, I’m slacking… I had time to make a blogpost yesterday but decided to just watch some Netflix and shut down my brain for a few hours. It was awesome! Well, time to put my brain Billie Branchboots back to work for a few weeks. No breaks allowed!

This is the last small and short challenge of IBM’s Master The Mainframe Part three series. The following blogposts will be significantly longer and more complex hereafter.

Load Client Records in VSAM

IBM Master the Mainframe Part Three – Challenge #06

VSAM, Virtual Storage Access Method, is used as an access method to manage verious user data types. VSAM is a high performance data set type and popular for storing critical data. This challenge is about defining a VSAM KSDS and load client data from a sequential data set.

If you’re interested, then you can either read IBM’s redbook or read this VSAM tutorial to know more about VSAM. BUT! It is required to read about KSDS before attempting this challenge.

We need to create the data structure above. Let’s go! Let’s edit Z30163.JCL(defvsam).

I’m in, now I need to do the following:

  1. Replace @TYPE with VSAM DEFINE parameter to define VSAM KSDS type
  2. Replace @LENGTH,@OFFSET to specify VSAM KSDS key
  3. Replace @MIN,@MAX to specify VSAM KSDS minimum and maximum record length

Again, no solution this time! Sorry! I might be able to help a bit though! Tutorialpoint gives us this:

RECSZ(average, maximum)
KEYS(length, offset)

Regarding RECORDSIZE, keep in mind that each record is 170 characters long. Regarding KEYS, specifies the length and offset of primary key from first column. Think about it 🙂

JOB DEFVSAM(JOB02748) SUBMITTED
JOB02748 $HASP165 DEFVSAM  ENDED AT SVSCJES2  MAXCC=0000 CN(INTERNAL)

SYSTSPRT looks okay, now just copy to P3.OUTPUT(#06) and I’m done!

Took me longer than expected

I thought this would only take me 15 minutes or so. Sadly, I was wrong. It took me about an hour and a half.

Next challenge is very long, seriously! Next up, DB2 relational databases! I’ll probably do challenge 07 and 08 this weekend. Expect the longest blogpost ever! I’ll be sure to contact guinsess worlds records.

What took you longer than expected?

Share this:

IBM MTM: Part Three – Challenge #05

I just noticed that I’ve released the blog about challenge #04 at 12pm instead of 10am. Honest mistake! I have to admit, I kind of rushed that blog. Sorry about the lack of quality lately. I’ve been very busy IRL.

I’ve picked up some games again after a year long break of serious gaming. Besides that I run a Dungeons and Dragons the Curse of Strahd party as DM every two weeks. So now you know what I do besides programming 8 hours at my job, writing blogs, Master the Mainframe and going out with friends. I have to admit, I really enjoy the 15 minutes of true free time I have per day.

The badge

I’m sure you’ve noticed the featured image 🙂 I got it! The badge! IBM contacted me and informed that I’m able to accept my IBM Master the Mainframe badge at Acclaim! I’m so happy! I’m not sure if it means much for any employer but it sure is something I’ll brag with at my local nerd cafe!

Not the best picture, but hey!

Visit my Acclaim profile!

Application Development Support

IBM Master the Mainframe Part Three – Challenge #05

A developer at mycompany contacted me and said something is wrong with the BBRI client data. The developer wrote a program to read the BBRI client data. The result was a program execution abnormal end S0C7. Abend S0C7 is a well known failure related to invalid data in a numeric field.

I will recreate the problem, use SORT to remove the invalid packed decimal fields and write the output to a temporary data set. This looks like an easy assignment.

To recreate the problem I’ll create a new member called cbl0002 inside Z30163.source and copy ‘zos.mtm2018.public.source(cbl0002)’ into cbl0002. Then All that’s left is to edit Z30163.JCL(cbl0002) and run it.

Now let’s head to Z30163.JCL(CBL0002J)!

Let’s submit!

 07.35.52 JOB06624 $HASP165 CBL0002J ENDED AT SVSCJES2 - ABENDED S0C7 U0000 CN(INTERNAL) 

The system detected a data exception (System Completion Code=0C7).     
From compile unit CBL0002 at entry point CBL0002 at compile unit offset +000003DC at entry offset +000003DC
at address 1AC003DC.

Not good! I’ll need to use SORT to remove the invalid packed decimal fields and write the output to a temporary data set. Then pass that sorted data to the application developed by my fellow colleague.

Let’s edit Z30163.JCL(cbl0002j) and first of all delete lines 2 up to and including 8. This way we won’t recompile the program again. Deletion happens via the DD line command. Then we need to copy sort004 into cbl0002 after ‘a’. A is a label, if you don’t now then you’ll need to read more about labels here to know how to define a label.

After copying the file I need to do the following:

  1. Delete line beginning with //SORT004 JOB
  2. Delete line beginning with //BAD
  3. Delete line beginning with OUTFILE FNAMES=BAD
  4. Change //GOOD DD SYSOUT=*
    to //GOOD DD DSN=&&TMP,DISP=(NEW,PASS,DELETE),SPACE=(CYL,1)
  5. Change //PRTLINE DD SYSOUT=*,OUTLIM=15000
    to //PRTLINE DD DSN=&SYSUID..P3.OUTPUT(#05),DISP=SHR
  6. Change //BBRI DD DSN=&MASTER,DISP=SNR
    to //BBRI DD DSN=&&TMP,DISP=(MOD,DELETE,DELETE)

This is what I’ve got.

I’ve left out some lines on the screenshot above, I don’t want to post the exact solution. I promised Mr. Paul Newton from IBM!

JOB CBL0002J(JOB06654) SUBMITTED 
07.56.15 JOB06654 $HASP165 CBL0002J ENDED AT SVSCJES2 - JCL ERROR CN(INTERNAL)

Oops I guess I did something wrong! Let me check!

17 IEFC019I MISPLACED ELSE STATEMENT 
18 IEFC019I MISPLACED ENDIF STATEMENT

Hmm… Oh! I didn’t read step 3, it said ‘delete the last 3 lines’. Oopsie! JOB CBL0002J(JOB06657) SUBMITTED!

That’s the output! The challenge is complete! Ofcourse, if I was at my real job I wouldn’t just post a screenshot of acountbalances and account identifiers 😇

Wait this wasn’t about ICETOOL at all?

In my last challenge I said that the next challenge would be about ICETOOL and not COBOL… What? I’m not sure where I got that from. Next challenge is about VSAM KSDS, I double checked this time!

This challenge was REALLY easy and I believe I understood everything I did. The first thing I’ll do after this blog is read the COBOL source code from last two blogs and try to understand what’s going on.

We’ve completed one-third of #MTM part 3! I just checked some other challenges and it seems that challenge #06 will be the last small/short challenge from this series. L

Also, I have to thank all my e-mail subscribers for not unsubscribing as soon as the feature was available! Thanks for your loyalty! I’m also surprised about the amount of traffic the site gets whenever I publish a new blogpost! This is great!

What’s been great for you lately? Let me know! If not in the comments below, you can always mail at great@kevindurant.be!

Share this:

IBM MTM: Part Three – Challenge #04

This is the moment! This is THE challenge! My first encounter with COBOL! YAY! I’ll leave out the intro this time boys ‘n girls. I want to start, now!

Application Development Using COBOL

IBM Master the Mainframe Part Three – Challenge #04

Common Business-Oriented Language, that’s what COBOL stands for. COBOL manages some of the most critical data and business logic in the world’s economy. Many reasons exist for why COBOL is a computer language with incredible longevity. COBOL that runs in the z/OS Environment is called Enterprise COBOL.

In this challenge I will read COBOL source code and compile it into an executable module. This particular COBOL program reads the BBRI client data set name used in the previous challenge and prints several of the fields from each record.

I need to solve the compilation error to complete the challenge. A good COBOL tutorial can be found at tutorialspoint.

I need to edit Z30163.source, create a new member cbl0001 and copy ‘zos.mtm2018.public.source(cbl0001)’ into it. Done! Let’s see…

The code is split in 4 divisions.

  • Identification
  • Environment
  • Data
  • Procedure

Lines with asterisks are treated as comment lines. Now jump back to Z30163.JCL and select member cbl0001j.

  • IGYWCL is a system JCL procedure used to Compile COBOL source code
  • //COBOL.SYSIN references the COBOL source code input that was reviewed
  • //LKED.SYSLMOD references the executable program created from the compile
  • //STEP2 EXEC PGM=CBL0001 is program execution step

Now let’s submit the JCL job! JOB CBL0001J(JOB03331) SUBMITTED!

IGYPS2072-S is a severe COBOL syntax error. The text explains what needs to be fixed. Let’s edit Z30163.source(cbl0001). It was a very simple fix. Let’s run! tso submit jcl(cbl0001j) ; =sd ; st

JOB CBL0001J(JOB03380) SUBMITTED
JOB03380 $HASP165 CBL0001J ENDED AT SVSCJES2 - ABENDED S000 U4038 CN(INTERNAL)

If the compile was successful then the output should show that the program execution failed.

IGZ0035S There was an unsuccessful OPEN or CLOSE of file ACCTREC in program CBL0001 at relative location X'1A2'.
Neither FILE STATUS nor an ERROR declarative were specified. The status code was 35.
From compile unit CBL0001 at entry point CBL0001 at compile unit offset +000001A2 at entry offset +000001A2
at address 1AC001A2.

It failed! Ya… y? Now I need to identify and fix JCL that caused the COBOL program execution to fail. Neither FILE STATUS nor an ERROR declarative were specified. Interesting! But where in the JCL do I need to declare it? I’m not really sure where I should look. Oh wait… HINT: look for ACCTREC inside the JCL 😉

JOB CBL0001J(JOB03539) SUBMITTED
JOB03539 $HASP165 CBL0001J ENDED AT SVSCJES2  MAXCC=0000 CN(INTERNAL)

Looks okay! Now I just need to XDC the output to P3.OUTPUT(#04) and I’m done!

Almost there!

I almost completed 5 Part Three challenges! That’s a small milestone! Next challenge isn’t about COBOL, but about ICETOOL. But hey! COBOL will happen later!

Are you looking forward to something?

Share this: