in IBM Master the Mainframe 2018, Mainframe

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:

Write a Comment

Comment