Discussion:
COBUCL?
mfisher_ix
2010-11-26 23:27:40 UTC
Permalink
Hello,

I wonder if you could help mediate a conflict at my Tur(n)key site.

The grumpy MVS operator (my alter ego) would like the COBOL programmers to stop commandeering his console by using the UPON CONSOLE clause in DISPLAY and ACCEPT statements. He says he'll shoot anyone who ever uses these clauses, "for the good of the state".

On the other hand, the antiquarian COBOL programmer (also me) would like to run an interactive COBOL program containing DISPLAY and ACCEPT statements. He says it's his laptop, and his hobby.

I think Mike Murach has shown the way to a peaceful resolution, but am not too clear on the details. Pages 530-531 of Murach's Mainframe COBOL show the TSO commands to allocate SYSIN and SYSOUT, and to call a COBOL load module.

Since the Tur(n)key #3 has no COBUCL job, I'm sure you can see my questions coming from a mile away. If these questions don't bore you too much, I'd like to know:

1) How to code COBUCL. I've seen Jay Moseley's version, but am not sure if it needs any alterations to be used in the Tur(n)key.

2) How (and whether) to use RPF to create a PDS for my COBOL load modules. I've already figured out how to create a PDS named HERC01.TEST.COBOL for my COBOL programs, so the question is how and whether to manually create the corresponding HERC01.TEST.LOADLIB PDS for load modules.

3) What JCL to include in a COBOL job that's meant to be compiled and link-edited, saved for later use, and then called from TSO.

My System/370 JCL book should arrive next week. I also intend to try running KICKS for TSO someday, which would make these moot points. But in the meantime, I'm stumped.

Mit freundlichen Gruessen, und immer mit der Ruhe,

- Matt Fisher
mfisher_ix
2010-11-27 16:07:11 UTC
Permalink
I figured this out using some information from one of Volker Bandke's old posts to H390-MVS:

http://tech.groups.yahoo.com/group/H390-MVS/message/1898

In case any other newbie is looking for this information in the future, here's what worked for me. I would greatly appreciate any corrections from the old timers.

The partitioned data sets HERC01.TEST.CNTL and HERC01.TEST.LOADLIB are pre-allocated in the standard Tur(n)key MVS. We can now use RPF's Allocate option to create a HERC01.TEST.COBOL PDS for our COBOL source code:

* Logon to TSO as user HERC01.
* Start RPF: RPF
* Select the Utility option: 3
* Select the Allocate option: 1
* Enter data as follows (note that this may not be correct). Prefix: HERC01, Library: TEST, Type: COBOL, Unit: SYSDA, Volume: [blank to accept default], Space Unit: Cyl, Primary: 5, Secondary: 5, Directory: 45
* Press ENTER, and you should see a message at top right saying, DATASET ALLOCATED.

Now let's return to the main menu in RPF, and use the Edit option to add a new member named TESTCOB to HERC01.TEST.COBOL. Our TESTCOB program will be the same as SYS2.JCLLIB(TESTCOB), but with 1) the JCL statements removed, 2) the SPECIAL-NAMES paragraph removed, and 3) the UPON CNSL clause removed from the DISPLAY statement. It looks like this:

<pre>000100 IDENTIFICATION DIVISION.
000200 PROGRAM-ID. 'HELLO'.
000300 ENVIRONMENT DIVISION.
000400 CONFIGURATION SECTION.
000500 SOURCE-COMPUTER. IBM-360.
000600 OBJECT-COMPUTER. IBM-360.
000700 DATA DIVISION.
000800 WORKING-STORAGE SECTION.
000900 77 HELLO-CONST PIC X(12) VALUE 'HELLO, WORLD'.
001000 PROCEDURE DIVISION.
001100 000-DISPLAY.
001200 DISPLAY HELLO-CONST.
001300 STOP RUN.</pre>

In HERC01.TEST.CNTL, let's add a new member named TESTCOB:

<pre>000100 //HELLO JOB (HERC01),'TEST COBOL',CLASS=A,MSGCLASS=C,MSGLEVEL=(1,1)
000200 //HELLO EXEC COBUCL
000300 //COB.SYSIN DD DISP=SHR,DSN=HERC01.TEST.COBOL(TESTCOB)
000400 //LKED.SYSLMOD DD DSNAME=HERC01.TEST.LOADLIB(TESTCOB),DISP=SHR
000500 //</pre>
SUBMIT 'HERC01.TEST.CNTL(TESTCOB)'

I don't see any errors in Printer #1, or in the MVS consoles. Maybe this worked?!

Let's try calling the TESTCOB load module from TSO:

ALLOCATE DDNAME(SYSIN) DSNAME(*)
ALLOCATE DDNAME(SYSOUT) DSNAME(*)
CALL HERC01.TEST.LOADLIB(TESTCOB)

Oh, my word. It worked.
mfisher_ix
2010-11-27 16:14:24 UTC
Permalink
Correction:

CALL 'HERC01.TEST.LOADLIB(TESTCOB)'
mfisher_ix
2010-11-27 16:25:02 UTC
Permalink
I also forgot to mention one step:

Create a COBUCL member in the SYS2.PROCLIB PDS. This should be identical to the existing member SYS2.PROCLIB(COBUCLG), except you should delete the //GO line.
Loading...