実践編(08.MVS Data Set Names, Stored Data, and Attributes)

  • 予備知識

Due to the long history of technology advancements without deprecation of earlier technology insured investment protection and upward compatibility.

  • ・sequential data set (SEQ)
    partitioned data set (PDS)
    partitioned data set extended (PDS/E)
    virtual storage access method data set (VSAM)

EBCDIC、ASCII、およびPacked Decimalデータ形式に関する知識。

MVS Data Set Name Rules
EBCDIC, ASCII, and HEX Reference Conversion Table
Packed Decimal Format


Open your CC#####.JCL and locate the following members. These are required to complete this challenge successfully:

Packed Decimal is commonly used for storing numbers used in arithmetic processing. Packed Decimal arithmetic operations improves computer performance.

As you saw in an earlier challenge, EBCDIC and ASCII are encoded differently. Now you can add a third encoding format for decimal values. Here's a side by side comparison of the different formats:

Data Encoding Stored Value
abcde EBCDIC x'8182838485'
abcde ASCII x'6162636465'
25873 EBCDIC x'F2F5F8F7F3'
25873 ASCII x'3235383733'
25873 Packed Decimal x'25873C'

Note the right most hexadecimal digit in packed decimal is always one of three values. "C" indicates positive, "D" indicates negative, and "F" indicates unsigned. Also, it doesn't make sense for there to be a packed decimal representation of "abcde" because packed decimal is used solely for numeric data.

At this time, open CC#####.JCL(DSNAMES) and read the following description of the programs and data definitions:

  • IEFBR14 is a system utility that is useful for allocating sequential and partitioned data sets.
  • A DD statement exists for each of the three data set types. Take a close look at the DD operands to determine the data set name, type, attributes and space allocation.
  • IDCAMS is a system utility program used to define VSAM data sets.
  • DEFINE is the IDCAMS control statement to determine the data set name, attributes, and space allocation.

Submit the DSNAME JCL now.

DSNAMES will create multiple data sets for you. Use SDSF to view the DSNAMES job output and determine what the names of the newly created data sets are. There are new data sets for each type in SEQ, PDS, PDS/E, and VSAM. You will need the names of these data 


  • Sequential data set organization is referred to as Physical Sequential (PS) and allocated in JCL with the DD operand "DSORG=PS".
  • Partitioned
    Partitioned data sets organization is referred to as Partitioned Organization (PO), allocated using JCL DD operand "DSORG=PO".
    Partioned Organization Extended (PO-E) is allocated using JCL DD operand "DSORG=PO" with "DSNTYPE=LIBRARY".
Note: Both PO and PO-E are commonly referred to as 'libraries', implying that they contain data of a similar type. However, the JCL DD operand "DSNTYPE=LIBRARY" is used exclusively for allocating PDS/E (PO-E) data sets.
  • VSAM, Virtual Storage Access Method
    VSAM organized data sets have performance benefits over sequential and partitioned data sets. DB2 tablespaces are stored in a VSAM organization where DB2 itself formats and manages the storage. Unix file systems are also stored in VSAM data sets and Unix formats and manages the internal storage.

VSAM is defined using the system utility IDCAMS. IDCAMS can define, delete, and rename VSAM data sets. It can also import and export data using the "REPRO" control statement and print data using the "PRINT" control statement.

At this time, open CC#####.JCL(SEQ2SEQ) for editing. This JCL copies some "in-stream" data in the SORTIN DD into a sequential data set. Note on line 4, we've left the DSN= parameter incomplete. You will need to type in the sequential data set name that was created by the DSNAMES job. Once you have done this, submit the job. Review the job execution in SDSF and take note of the data set referenced by the SORTIN DD statement. Then use =3.4 to open and view the contents of this data set.

Next, edit CC#####.JCL(SEQ2PDS). This job copies the contents of a sequential data set into a partitioned data set. Using the same sequential data set that was just copied into by SEQ2SEQ, amend line 4. Then submit the job and review the output. Ensure the job has ran successfully before continuing.

Edit CC#####.JCL(SEQ2PDSE). This JCL will copy the aforementioned sequential data set to the PDSE that was created by DSNAMES. Amend line 4 as needed, submit the job, and review it's output in SDSF. Continue once the job has ran successfully.

Edit CC#####.JCL(SEQ2VSAM). This JCL copies the same sequential data set into the VSAM data set that was created by DSNAMES. Again make your amendment to line 4, and take note here -- line 5 has an incomplete DSN as well. This needs to be set to the VSAM data set from DSNAMES. Once ready, submit the job and review the output in SDSF. Once satisifed, continue on with this challenge.

The ISPF editor is not able to view or edit VSAM data due to his complex data structure. However, there exists another interactive utility named File Manager (FM) that provides this capability. Use the ISPF primary command =F followed by option 2 to open the File Manager Edit Entry Panel.

Enter the fully qualified name for your DSNAMES created VSAM data set in the "Data set/path name" field, enclosed with single quotation marks. Just like the ISPF editor, the FM editor also has the ability to display hexadecimal values. Enter the primary commands HEX ON and HEX OFF to toggle hexadecimal character representation display.

The data inside the VSAM data set should be identical to the data found in the sequential data set.

From inside the FM editor on line 1, type in C99, then enter the primary command REPLACE '/z/cc#####/charset'. Make sure that cc##### is all lowercase. Set the Owner attribute to 6, Group to 0, and Other to 0, then press enter. Observe the message "Data set replaced" in the top-right corner.

Press F3 a few times to return to the ISPF Primary Option Menu, then jump to =3.4. Just like in part one, type in the full path to your USS home directory (/z/cc#####). Recall that your ID in your USS path is all lowercase.
Tab down to the line command area next to the filename "charset" and open it for viewing. Confirm that the contents matches the other data sets in this challenge, then press F3 to return to the z/OS UNIX Directory List.

Again, next to the "charset" filename, enter the line command C to open the Copy From z/OS Unix File dialog. In the To Name field, type in P2.OUTPUT(#08) and press enter.

Review the P2.OUTPUT(#08) member and confirm that it contains the same data as has been passed around repeatedly in this challenge. If all is well, you may move on to the next challenge!











tips(REXX プログラミング言語による SDSF の使用

REXX プログラミング言語による SDSF の使用)


  • ASID

アドレス・スペースID。オペレーティング・システムが割り当てることのできる ASID の数には制限があります。

  • ISF

VM/ISF VM/Intersystem Facilities


  • OTSU

Only Time Sharing Users


Job Name



z/OSは、初回立上げ時に読み込まれるシステムパターメータを使用することでカスタマイズすることが出来ます。z/OSの初回立ち上げのことをIPL(Initial Program Load)と呼びます。PCを立ち上げるときのように、z/OS IPLはMBR( Master Boot Record)を含むディスクストレージを配置する間に、 IPLTEXTを含むディスクストレージを配置します。

Why? Because this z/OS is created from a model which is used to create dedicated z/OS environments for software companies around the world that build and maintain z/OS software products used by large production systems around the world.
Therefore, do not be intimidated by the system parameter structure of this contest system because most other systems have a significantly simplier system parameter structures.

z/OSを理解するキーは、"message id"です。
Therefore, the and experienced z/OS person can quickly recognize "what" component is writing a message and "why" the message is being written.
Highly experienced z/OS System Programmers and z/OS System Administrators will read the system log (SYSLOG) for messages when an abnormal situation is reported for them to resolve.
System Programmers and System Administrators look up these messages in manuals to get a full description of message beyond the summary message text written to the system log (SYSLOG) when they are uncertain about "why" a message was written and "what" action to take. If the component message is reporting an abnormal situation, then the full description of the message in the manual will include a recommended action.
Keep in mind that z/OS environments are responsible for the most critical second to second transaction activity required by the world economy. Therefore, being able to identify, manage, and resolve abnormal processing situations quickly is mandatory.
We will just restate again, employers are clamoring to find students with exposure to z Systems technology. They want to pair young people with highly experienced technicians, who are near the end of their careers. These are highly responsible and highly paid jobs for those of you who can prove yourselves capable of managing the responsibilities of these mission-critical operating environments.


①z/OS Message IDを理解できるよう
②z/OS Message IDを読んで解釈出来るよう

z/OS IPLの間に書かれたSYSLOGメッセージを読むREXXルーチンを修正して下さい。
始めるにあたって、 z/OS Unix System Services (USS)の一意な3文字のコンポーネント識別子をを識別する方法を学ぶ必要があります。
URL:z/OS Message Directory

上記URLはzOSコンポーネントの3文字の接頭辞の識別子のリストです。the z/OS Unix System Serviceの一意の3文字のメッセージID識別子を見つけます。
このz/OSメッセージディレクトリ表は、"Document Title" 列を含みます。
The z/OS Unix System Services component "Document Title" は、特定のz/OS MVS System Messagesドキュメントです。
このz/OS MVS System Messagesドキュメントは、コンポーネントメッセージの数々のボリュームの1つです。

割り当てられたz/OS MVS System Services document を選択して、z/OS Unix System Services messagesを探して下さい。
メッセージの見出しを選択して下さい。FILE SYSTEM name WAS SUCCESSFULLY MOUNTEDのメッセージIDを見つけて下さい


REXX code is available to read this SYSLOG which write a simple report about specific IPL activity.

CC#####.REXX.CLIST PDS ディレクトリに多数のメンバがいます。IPLMSGの左側にEXを入力しREXXルーチンを実行して下さい。
IPLリポートは、UNIX files successfully mountedのカウント件数が最後のラインに欠けています。

UNIX files successfully mountedの件数を含めるためにIPLMSGのREXXルーチンを修正して下さい。
代わりにBrowse (B) や View (V) でデータセットを閲覧して下さい。



Format of lines in the z/OS System Log




REstructured eXtended eXecutor (REXX)は名前の割に学習と読解が簡単にできるようにデザインされています。
・Oxford Computer Science
The REXX Tutorial
・The American Programmer
The American Programmer.com REXX Language Programming: REXX Boolean operators
IBM DeveloperWorks
Rexx for everyone
・Magazine Article
IBM Technical Manuals
IBM REXX Family - IBM publications



ISPFコマンド TSO XTBLを入力して実行して下さい。

注意)このプログラムのソースコードは、CC#####.REXX.CLIST(XTBL)にあります。このコードを正しいREXX syntaxのサンプルとして見ることに加えて、インターネットで検索することはこのチャレンジを完了するのに役立ちます。

REXXコードを確認し、誤りを正して下さい。the data set list utility panel (=3.4) へ移動し、CC#####.REXX.CLISTを編集モードで開いて下さい。数多くのメンバがいることがわかります。
The second screen immediately shows a problem:

16 *-* sa 'When where your born? '
+++ RC(-3) +++

However, the routine continued to function.
Enter 1 and observe another problem. This one causes the program to abend.
Execute the HOROSCOP program again. This time enter 13. Yes, there's a third problem.
Execute the HOROSCOP program again. Choose option 4 and observe yet another problem. Go ahead and end the HOROSCOP program now.
Edit the HOROSCOP member and correct all the problems. REXX syntax is easy to understand, take your time and read the source code carefully. Do not forget the reference links we gave you at the start of this challenge, and you can use the XTBL program as a reference as well.
Each time you attempt a correction, use F3 to save the HOROSCOP member and return to the directory listing. Then enter EX next to HOROSCOP to try out your modification.
Once you have corrected all the problems, observe the horoscope for selection 1 and 2 are identical. This is another problem to correct. A hint to help you debug your REXX code can be found in the 2 lines of selection 1 output.
Note: In the event you want to restore HOROSCOP to it's original state, you can find a copy in 'ZOS.PUBLIC.P2.REXX.CLIST(HOROSCOP)'. Feel free to take a copy!
Once these problems are corrected, enter TSO SUBMIT JCL(HOROSCOP). This JCL will execute your HOROSCOP program in batch and create P2.OUTPUT(#15). Upon successful execution, member #15 will have the Aquarius and Taurus horoscopes contained within.
Helpful Hint #1: Close examination of the REXX routine shows that the Horoscope text message are PDS members in 'ZOS.PUBLIC.DATA'. This is significant to correcting the the problem with TAURUS horoscope. Do NOT edit 'ZOS.PUBLIC.DATA' - Only view or browse 'ZOS.PUBLIC.DATA'. The system will not permit any changes to this data set.
Helpful Hint #2: REXX return statement is significant to execution flow.
Just one more challenge to go! Stay frosty!



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

下の画像のCOMMAND INPUT ===> がSDSF primary command プロンプトです。
SDSFプライマリーコマンドの DA を入力して"display active jobs"パネルを開き、プライマリコマンドとしてSET DISPLAY ONを入力して下さい。
ディスプレイフィルターの値(PREFIX, DEST, OWNER, and SYSNAME)が上段付近に表示されます。これらのフィルターを使用しどのようなデータを表示するか操作することが出来ます。


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はログメッセージに関するメタデータを表示します。

F8, F7, F10, and F11キーを使用してISPFエディターのように移動してみて下さい。

the System Command Extension panelを開くためにISPFプライマリーコマンド上で/を入力実行して下さい。
これは、ISPFの=6 TSOコマンドインプットと似ています。このパネルに入力されたコマンドのみz/OSシステムコマンドとして実行されます。
一つずつ以下のコマンドをthe System Command Extension panelで入力してみてください。
・D T
・D A,L
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:
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:

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:
Next, use the ISPF Command Shell (=6) panel to submit another JCL job:
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:
Next, enter the following commands to filter jobs owned by you, and only display their status:
NP JOBNAME JobID Owner Prty Queue
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:
Note line 6 contains the SORTOUT DD statement. This is where SORT will be writing it's output to:
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.

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


******************************* 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!.