• No results found

Introduction to the Mainframe

1.3 Job Control Language (JCL)

1.3.3 Using ISPF to Create and Run Batch Jobs

1.3.3.2 Editing Data Set Members

When the data set is created , go to the ISPF editor. To do this, enter =2on any command line.

This is the ISPF “fast path” to the ISPF edit panel, which is option 2 from the main ISPF menu. On this panel, specify the name of the data set that you just allocated. Because you are editing a PDS, you need to specify either the name of an existing member or the name of a member that you want created, as shown in Figure 1.11. In this example, we’re creating a member named HELLOW.

1.3 Job Control Language (JCL) 13

Figure 1.10 Step 2 indataset creation

Figure 1.11 ISPF edit panel

The ISPF Editor

A full description of the ISPF editor with all its features is beyond the scope of this book. For a detailed explanation of the commands, browse to http://publibz.boulder.ibm.com/bookmgr_ OS390/libraryserver/zosv1r6/ and open z/OS V1R6.0 Elements, Features, and Software Products→z/OS Elements and Features, z/OS Collection Kit, March 2005 →z/OS V1R6.0 ISPF Edit and Edit Macros →1.0 Part 1, The ISPF Editor.

After you press Enter, ISPF creates the member and places you in the ISPF editor. At this point, type the JCL shown in Listing 1.2. You need to type it on the lines that start with ‘‘‘‘‘‘, under the blue asterisks (*), as shown in Figure 1.12. Remember to change ORIPOMEto your own user ID. Traditionally, JCL lines use the eight characters after the //for identifiers or leave them empty when no identifier is required. That is the reason, for example, that the word EXECon the second line starts on the same column as the word JOBon the first line. The JCL would work with just one space, but it is more readable this way.

Figure 1.12 Theeditorafter typing thebatch job

After this is done, press Enter. ISPF saves your changes and replaces the quotes on the left with line numbers.

At this point, you’re ready to submit your job. Type SUBMITon the command line, and your

batch job is submitted to the job entry subsystem at your installation. You will get a confirmation message with the job number, as shown in Figure 1.13.

Figure 1.13 Jobsubmission confirmation message

Your installation has a policy for executing batch jobs, and that policy determines when your batch job is executed. After it has executed, you can view the output of the job. When your job executes, it sends a message to your TSO user ID. If you are logged on and are accepting mes- sages, the message appears as your batch job executes. If you are not logged on or are not accept- ing messages, it is saved and displayed when you next log on.

When you see the confirmation message, press Enter again. In all likelihood, your job will have already executed and you will see the message, as well as a job confirmation message, as shown in Figure 1.14.

Figure 1.15 The log data panel whenleaving ISPF

1.3.4 JCL Syntax

Now that you’ve run the JCL and seen that it works, let’s review Listing 1.2 line by line and explain exactly what it does.

First, you’ll notice that most lines start with two slashes. The two slashes mark a line as part of JCL. Lines that do not contain those slashes, such as the last two lines in this job, are usually embedded input files.

//TSOJOB JOB CLASS=A,NOTIFY=&SYSUID,MSGCLASS=H

This line is the job header. It defines a job called TSOJOB. The CLASS parameter specifies the job’s priority, the maximum amount of resources the job is allowed to consume, and so on. A is a good default in most installations, at least for the short jobs we’ll use in this book.

TheNOTIFYparameter specifies that a user should be notified when the job ends. It could be the name of a user to notify, but here it is &SYSUID, which is a macro that expands to the user who submits the job.

TheMSGCLASSparameter specifies that the output of the job needs to be held. This makes it accessible afterward, as you will see in Section 1.3.5, “Viewing the Job Output.”

// EXEC PGM=IKJEFT01

This line starts an execution step—a step in the batch job that runs a program. It is possible for these steps to be named using an identifier immediately after the two slashes. However, this is a very simple job, so there is no need to identify this stage.

1.3 Job Control Language (JCL) 15

Figure 1.14 The message the jobsent

When you are done with ISPF, enter =Xon the command line to tell it to exit. If you get a log data panel, such as the one in Figure 1.15, select option 2to delete the log. You can then use

The program that this step executes is IKJEFT01, which is the TSO interpreter. //SYSTSPRT DD SYSOUT=*

This line is a data definition. It defines the data stream called SYSTSPRT, which is the out- put of TSO. SYSOUT=*means that this data stream will go to the standard output of the job. In the next section, you will learn how to get to this output to read it.

//SYSTSIN DD *

This line is another data definition. It defines SYSTSIN, which is the input to the TSO interpreter. The value *means that the text that follows is the data to be placed in SYSTSIN. SEND ‘Hello, World’ U(ORIPOME)

/*

This is the input to the TSO interpreter. The first line is a command, the same “Hello, World” command we executed in Section 1.2.3, “ ‘Hello, World’ from TSO.” The second line, /*, is a delimiter that means the end of the file.