RUNCOBOL
Mainframe101 sim: compiles and runs a COBOL member in one step. It is a shortcut, not a z/OS command.
Also written COBOL
Why it matters. It lets you see a COBOL program work before you learn to write the compile and run job.
Syntax
RUNCOBOL 'library(member)'
- library(member)
- The COBOL source to run, in quotes.
- SYSIN lines
- If the program reads input, MF/OS passes them in.
Try it RUNCOBOL
- 1
Run the program HELLO from your DEV COBOL library.
RUNCOBOL 'ZB0001.DEV.COBOL(HELLO)' - 2
Run a member that isn't there: NOHELLO.
RUNCOBOL 'ZB0001.DEV.COBOL(NOHELLO)' - 3
Run it from a library that isn't there: ZB0001.TEST.COBOL.
RUNCOBOL 'ZB0001.TEST.COBOL(HELLO)'
Remember
- Mainframe101 sim: RUNCOBOL is a shortcut. It is not on z/OS.
- On z/OS it is a compile, a link-edit and a run, as a job.
- RUNCOBOL 'library(member)', with the quotes.
The usual mistake
RUNCOBOL ZB0001.DEV.COBOL
It needs a member. A library on its own is a folder of programs, not one program.
RUNCOBOL 'ZB0001.DEV.COBOL(HELLO)'
On real z/OS
Mainframe101 sim: RUNCOBOL does not exist on z/OS. Real z/OS compiles with the COBOL compiler (IGYCRCTL), link-edits the object into a load module with IEWL, then runs it with EXEC PGM= in a job. You can do the same here with JCL and SUBMIT. RUNCOBOL does not make a load module, and it writes no listing or CEEDUMP.
Where can I practise RUNCOBOL?
Right here, at ZedBank. You take a junior job at a simulated bank and use RUNCOBOL in real work, with Zed beside you. There's nothing to install.
Start at ZedBankRelated
- CompileTurning COBOL source code into machine instructions, checking the syntax and producing a listing of any errors.
- Link-editCombining compiled object code with the other modules it needs into a single runnable program.
- Load moduleThe runnable form of a program, stored in a library, which JCL executes by name.
- JCLJob Control Language: the language used to tell the mainframe what programs to run, in what order, and with what files.
- Job stepOne program execution within a job. A job is simply a sequence of steps that run in order.
- Return codeA number a program leaves behind saying how it went. Zero for clean, higher numbers for warnings and failures.
- AbendAn abnormal end: a program stopping in an uncontrolled way rather than finishing and reporting a result.