実践編(05.SDSFとJCLのJob出力の確認)

★厳選オススメ記事!

予備知識

The System Display and Search Facility (SDSF)は、システムの活動・リソース・z/OSへ実行されたシステムコマンド・JOBキューのインプットとアウトプットを確認するパネルドリブンインターフェースです。
ISPFナビゲーションショートカットとして =SD を実行することでSDSF Primary Option Menuへ直接移動することが出来ます。

下の画像のCOMMAND INPUT ===> がSDSF primary command プロンプトです。
f:id:kenta_everyday:20170430165049p:plain
SDSFプライマリーコマンドの DA を入力して"display active jobs"パネルを開き、プライマリコマンドとしてSET DISPLAY ONを入力して下さい。
ディスプレイフィルターの値(PREFIX, DEST, OWNER, and SYSNAME)が上段付近に表示されます。これらのフィルターを使用しどのようなデータを表示するか操作することが出来ます。
f:id:kenta_everyday:20170430165518p:plain
すべてのフィルターをクリアするには、以下のSDSFプリマリーコマンドを入力して下さい。
PREFIX
OWNER
SYSNAME
DA
自分がOWNERのJOBを見るには、以下のコマンドを打ちます。
OWNER CC#####
ST
DA
DAコマンドは、単一エントリーを表示します。

注)

Note: When output queue has multiple jobs with the same JOBNAME, then the JOBNAME with highest JOBID number is the most recently processed.

z/OSのシステムログを見るには、 LOG と入力し実行します。
システムログにカラムを表示するには、 COLS と入力し実行します。カラム2から57はログメッセージに関するメタデータを表示します。
カラム58からは、システムメッセージやシステムコマンドを表示します。
f:id:kenta_everyday:20170430170702p:plain
システムメッセージの右側で短いログメッセージがあります、詳細な説明はインターネットで検索することで見つかります。

システムログ上で以下SDSFコマンドを入力して下さい。
TOP
RIGHT 26
F8, F7, F10, and F11キーを使用してISPFエディターのように移動してみて下さい。
次に、z/OSディスプレイコマンドを探索してみて下さい。稼動システムについて有益なデータが手に入ります。

the System Command Extension panelを開くためにISPFプライマリーコマンド上で/を入力実行して下さい。
f:id:kenta_everyday:20170430171730p:plain
これは、ISPFの=6 TSOコマンドインプットと似ています。このパネルに入力されたコマンドのみz/OSシステムコマンドとして実行されます。
多くのz/OSシステムコマンドがあり、それらはコマンドオペランドを持っています。
一つずつ以下のコマンドをthe System Command Extension panelで入力してみてください。
・D TS,L
・D TCPIP,,NETSTAT,HOME
・D TCPIP,,NETSTAT,BYTE
・D T
・D A,L
・D M=CPU
次に、ログ上で以下のSDSFコマンドを入力実行してみて下さい。
・BOTTOM
・LEFT MAX
・RIGHT 37
Use F7 to page up, watching in column 57 for your user ID. Once located, observe the output to the right - you will see the commands you just entered and the response given.

JCL Output

SDSF is also used to view the output of JCL execution.
JCL consists of statements that tell z/OS which program name to execute followed by program inputs and outputs. Filename references are coded into z/OS programs; however, these filenames are abstract names without any association to a real resource. The purpose of JCL is to associate program filenames to physical system resources.
This association is achieved using JCL DD statements.
JCL statement types:
EXEC
DD
JCL statements begin with // in columns 1 and 2, followed by an internal name, then the statement type, EXEC or DD. For example, to execute the SORT program, the following JCL could be used:
//S1 EXEC PGM=SORT
//SORTIN DD DSN=&SYSUID..DATA(HESF),DISP=SHR

Note: The &SYSUID. in JCL will automatically substitute to CC##### when the job is initiating.
Assuming that the SORT program includes the statement "OPEN SORTIN", the JCL DD statement is used to associate the real resource with SORTIN.
The format of a JCL DD statement follows:
//SORTIN DD Resource
SORTIN is a Data Definiton Name (DDNAME) and must match the SORT program internal filename reference. Resource describes the real resource such as a PDS. See DSN=&SYSUID..DATA(HESF) in the example above. Submitting JCL for system interpretation and execution can be accomplished in many different ways, some of which will be explored now.

実践

Take the described actions to submit JCL jobs JOB01, JOB02, JOB03, and JOB04 using 4 separate ways:
From any SDSF or ISPF panel, enter the following primary command:
TSO SUBMIT JCL(JOB01)
Next, use the ISPF Command Shell (=6) panel to submit another JCL job:
SUBMIT JCL(JOB02)
Next, from the data set directory list (=3.4), browse into your CC#####.JCL PDS.
Enter SUBMIT to the left of member JOB03.
Finally, submit JCL from ISPF editor Browse, View, or Edit mode. Open your CC#####.JCL(JOB04) member in Browse, View, or Edit mode:
Enter SUBMIT in the primary command line.
There are many more submit options, but these are enough for now!
Have you noticed that after each submit an unsolicited message was displayed? This message contains information like the JCL jobname (JOBnn) and a uniquely defined JOB number JOB#####.
Let's take a look at the output from the JCL jobs you have just submitted. Return to the SDSF Primary Option menu (=SD) and enter the following SDSF primary command to reset your filters:
prefix;dest;owner;st
Next, enter the following commands to filter jobs owned by you, and only display their status:
OWNER CC#####
ST
SDSF STATUS DISPLAY ALL CLASSES
COMMAND INPUT ===>
NP JOBNAME JobID Owner Prty Queue
TEST008 TSU07324 TEST008 15 EXECUTION
JOB01 JOB07343 TEST008 1 PRINT
JOB02 JOB07344 TEST008 1 PRINT
JOB03 JOB07345 TEST008 1 PRINT
JOB04 JOB07346 TEST008 1 PRINT
Notice the characters NP? The NP column to the left of each JOBNAME is used to issue actions against specific jobs. Some of the commands that can be issued are:
S : Selects the entire output for browsing.
? : Allows you to select individual JCL DDNAMEs for browsing. Use S against the DDNAME to view individual output.
P : Purges (deletes) the job output.
SJ : Selects JCL that was used to submit the job.
At this time, enter SJ to the left of JOB01.
While viewing the JCL of JOB01 enter HILITE JCL on the primary command line. This will highlight the JCL reserved words: JOB and EXEC. The JCL JOB statement is primarily used to give the JCL JOB a name, in this case the jobname is JOB01. The JCL EXEC statement is used to tell z/OS to execute a something, here we are executing the program IEFBR14. IEFBR14 is a simple program that starts execution and immediately returns (exits). There are no virtual filenames inside the source code of IEFBR14, therefore no DDNAMEs are required here.
Press F3 to return to the SDSF status display panel and enter S to the left of JOB01. The entire job output is displayed, including system messages.
Press F3 and enter ? to the left of JOB01. Now the JCL job DDNAMEs are displayed. Hold up! We just told you that there were no abstract filename statements inside the IEFBR14 code, and you clearly saw that JOB01 had no DD statements coded. But here are 3 DDNAMEs. What gives?
The reason these DDNAMEs exist is that z/OS dynamically creates these 3 DDNAMEs for every job that gets submitted. They are used to hold the job log summary, JCL interpretation output and various system messages.
Enter S to the left of each DDNAME and view their contents, then press F3 to return to the SDSF status display panel.
Select JOB02's output. Notice that the EXEC statement here includes an optional STEPNAME, namely "STEP1" before the EXEC statement. A STEPNAME is used to identify blocks of JCL and is used in more advanced JCL techniques.
Select JOB03's output. Notice that JOB03 has multiple EXEC statements. It should be clear now that JCL jobs can execute more than one program, with each program being contained within a step. Multiple EXEC steps are executed in order. STEP1 must finish before STEP2 can begin, and so on.
Select JOB04's output. Notice that JOB04 failed to execute due to a JCL error. At the bottom of the output is the error message IEFC605I indicating that something is wrong on JCL statement number 3.
Press F3 then enter SJ on JOB04. SJ permits you to alter the JCL directly in the output queue. Enter HILITE JCL on the command line to help identify the error.
All JCL must be UPPERCASE with a few exceptions. Correct the error and enter SUBMITon the command line to re-submit the JCL for interpretation and execution.
F3 will return to SDSF queue.
Observe another JOB04 entries exist. Recall that the highest JOB##### job number is the most recently executed.
Useful Tip: Enter P to the left of any unwanted JCL jobs. This will purge them from the output queue, never to be seen again.
Once JOB04 successfully executes, enter ? on the successful job output and select the JESJCL DDNAME. Observe that the program executed in step 3 is SORT. Next, look closely at line 5, where the input to the SORT program is defined:
//SORTIN DD DSN=ZOS.PUBLIC.DATA(HESF),DISP=SHR
Note line 6 contains the SORTOUT DD statement. This is where SORT will be writing it's output to:
//SORTOUT DD DSN=&SYSUID..P2.OUTPUT(#05),DISP=SHR
The line immediately after 6 indicates that z/OS substituted something in the previous statement. This is where &SYSUID gets resolved to CC#####.
//SYSPRINT and //SYSOUT on lines 7 and 8 are coded to DD SYSOUT=*. SYSOUT=* is the job log.
Finally on line 9, //SYSIN DDNAME references the physical resource "*", where * indicates whatever follows is stored in the input queue and passed to executing program.
Press F3and return back to JOB04 DDNAME list and enter INPUT ON on the SDSF primary command line. Observe that more system generated DDNAMEs are now being displayed.
Select SYSIN STEP3.
SDSF OUTPUT DISPLAY JOB04 JOB07363 DSID
COMMAND INPUT ===>

******************************** TOP OF DATA *

SORT FIELDS=(20,2,CH,A)

******************************* BOTTOM OF DATA

What you are viewing is the non-JCL data that followed the //SYSIN DD * in the JCL stream. This data was stored in the queue for the system to access when the SORT program executed and describes the fields that the SORT program should evaluate and how they should be sorted.
The actual data input and output for JOB04 SORT is a college campus survey of hair color, eye color, and sex combination frequency. The output of SORT was written to P2.OUTPUT(#05) as described in the //SORTOUT DD DSN statement and will be used to evaluate successful completion this challenge.
Feel free to check your P2.OUTPUT data set for the output, then move on to the next challenge!.