-2

Which language can I use in z/OS to create a job in DB2 Z/OS V10?

In Z/OS Mainframe, please provide example script to create or SUBMIT a JOB which executes stored procedures.

dstaudacher
  • 546
  • 3
  • 11
Vivek Harry
  • 419
  • 3
  • 11
  • 25
  • 2
    Impossible to answer in a very broad sense. We know what none of your libraries are called, nor any of your site standards for jobs or STCs. You haven't even said what you want to do, and that means a bunch of different stuff. You have colleagues. You have technical support. There is where you ask, not here, where your question is already broad, and where we can only make guesses. Jobs are written in JCL, and JCL only, if you are not already aware of even then, then you need extra support at your site. – Bill Woodger Mar 05 '17 at 12:38

1 Answers1

2

Though I agree with Bill W. (above), I thought I'd provide a bit of detail here in case someone genuinely wants to write an app that can submit a mainframe job.

At the core, a "job" in z/OS is just a series of JCL statements that define a unit of work. The good news is that there are lots of ways jobs can flow into z/OS:

  • TSO, ISPF or OMVS "SUBMIT" commands (or equivalents in other subsystems)
  • FTP, by using QUOTE SITE FILETYPE=JES and FTP PUT
  • Via JCL, for example using IEBGENR to copy JCL to an INTRDR SYSUT2
  • In CICS applications using EXEC CICS SPOOL APIs
  • From the operator console using the START command
  • From remote systems using the NJE protocol
  • From all manner of vendor products, such as job scheduling software

The various "SUBMIT" commands can usually be scripted without too much trouble if you're looking to do something simple.

If you need to submit a job in a script or other software, the cool thing to remember is that jobs can be submitted just by opening a special file called the internal reader. All you need to do is allocate and open the internal reader, then write your JCL (typically fixed, 80 byte records), then close the internal reader - viola, your job is submitted.

You can allocate the internal reader a number of different ways. In JCL, it's as easy as //ddname DD SYSOUT=(,INTRDR). You can also use the TSO ALLOC command, and so forth - there's even good support in the LE runtime, making the internal reader accessible to C, Java, COBOL and so forth. And for the bit-level (assembler) folks, SVC 99 provides everything you need to allocate an internal reader.

Once you have an internal reader file allocated, you just open and write to it as though it was any other file. Under the covers, the internal reader is just a "pipe" to JES, the "job entry subsystem"...as you might guess, JES handles (among other things) handling job submissions. With that pipe to JES open, what you write should be JCL representing the job you want to submit.

If you're running on some other platform and want to submit work to z/OS, then FTP can be the simplest path. Connect as normal and enter the SITE command above, then you can "PUT" a file containing a set of JCL records. One cool thing about the FTP interface is that it gives you back a job identifier that you can use to track the job and fetch its output.

Keep in mind that there are various options and security controls to restrict who can do what on z/OS, so you might have other hurdles to overcome if your site has protected the privilege of submitting jobs.

There's my two-cents worth on submitting jobs on z/OS... :)

Valerie R
  • 1,769
  • 9
  • 29