Chapter 30: Quiz – z/OS Dataset Concepts and Storage Management
Test your knowledge of z/OS dataset organizations, naming conventions, record formats, space allocation, and storage management with the following 25 questions.
Question 1 (Multiple Choice)
What is the maximum total length of a z/OS dataset name, including all qualifiers and periods?
- A) 8 characters
- B) 22 characters
- C) 44 characters
- D) 54 characters
Answer
**C) 44 characters** A z/OS dataset name can be up to 44 characters long, consisting of one or more qualifiers separated by periods. Each qualifier can be up to 8 characters long and must begin with a letter (A–Z) or a national character (@, #, $).Question 2 (True/False)
In a VSAM Key-Sequenced Data Set (KSDS), records can be accessed both sequentially and randomly by key.
Answer
**True.** A VSAM KSDS supports three access modes: sequential (records read in key order), random (direct access by key value), and dynamic (switching between sequential and random within the same open). This flexibility makes KSDS the most commonly used VSAM organization for financial applications.Question 3 (Multiple Choice)
For a dataset with RECFM=VB, what does the LRECL value represent?
- A) The average record length
- B) The minimum record length
- C) The maximum record length including the 4-byte Record Descriptor Word
- D) The maximum data length excluding the Record Descriptor Word
Answer
**C) The maximum record length including the 4-byte Record Descriptor Word (RDW).** For variable-length records, LRECL specifies the maximum record length including the 4-byte RDW. For example, if the maximum data portion is 496 bytes, LRECL should be coded as 500 (496 + 4 for the RDW).Question 4 (Code Analysis)
Examine the following DD statement:
//MASTER DD DSN=BANK.PROD.ACCTMSTR,
// DISP=(OLD,KEEP,KEEP),
// AMP=('BUFND=20,BUFNI=10')
What type of dataset is being accessed, and what do the AMP parameters specify?
- A) A sequential file with buffer allocation
- B) A VSAM dataset with 20 data buffers and 10 index buffers
- C) A PDS with 20 directory buffers and 10 member buffers
- D) A VSAM dataset with 20-byte and 10-byte buffer sizes
Answer
**B) A VSAM dataset with 20 data buffers and 10 index buffers.** The `AMP` (Access Method Parameters) parameter is used exclusively with VSAM datasets. `BUFND=20` allocates 20 data component buffers, and `BUFNI=10` allocates 10 index component buffers. Increasing buffer counts improves performance by caching more control intervals in memory, reducing physical I/O.Question 5 (Multiple Choice)
What is a Generation Data Group (GDG)?
- A) A type of VSAM organization that stores records by generation number
- B) A collection of chronologically ordered datasets sharing the same base name
- C) A PDS where each member represents a different version of the data
- D) An SMS construct for managing dataset backups
Answer
**B) A collection of chronologically ordered datasets sharing the same base name.** A GDG is a group of datasets (called generations) that are related to each other chronologically. Each generation has a unique absolute name (e.g., `BASE.NAME.G0001V00`) and can be referenced relatively in JCL (e.g., `(0)` for current, `(+1)` for new, `(-1)` for previous). GDGs are widely used for daily backups and cyclical processing.Question 6 (True/False)
The BLKSIZE for a fixed-blocked (FB) dataset must always be an exact multiple of the LRECL.
Answer
**True.** For RECFM=FB datasets, the block size must be an exact multiple of the logical record length. If BLKSIZE is not a multiple of LRECL, the system will reject the allocation or the program will encounter errors. For example, with LRECL=100, valid BLKSIZE values include 100, 200, 500, 1000, 27900, etc.Question 7 (Multiple Choice)
In the DISP parameter DISP=(NEW,CATLG,DELETE), what happens to the dataset if the job step abends?
- A) The dataset is cataloged
- B) The dataset is deleted
- C) The dataset is kept but not cataloged
- D) The dataset remains in its current state
Answer
**B) The dataset is deleted.** The three sub-parameters of DISP are: status (`NEW` — create a new dataset), normal disposition (`CATLG` — catalog the dataset if the step completes normally), and abnormal disposition (`DELETE` — delete the dataset if the step abends). This is a common pattern for output files: keep them only if processing succeeds.Question 8 (Code Analysis)
A developer writes the following SPACE parameter:
//OUTPUT DD DSN=WORK.EXTRACT.FILE,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(TRK,(100,50,0)),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=27800)
The file needs to hold 5 million records. Will this allocation be sufficient? Show your calculation.
Answer
**No, this allocation will almost certainly be insufficient.** Calculation: - Records per block: 27,800 / 200 = 139 records/block - Blocks needed: 5,000,000 / 139 = 35,972 blocks - On a 3390, approximately 2 blocks of 27,800 bytes fit per track (track capacity ~56,664 bytes) - Tracks needed: 35,972 / 2 = 17,986 tracks - Primary allocation: 100 tracks - Maximum secondary extents: 15 (standard limit) - Maximum tracks available: 100 + (15 x 50) = 850 tracks The job needs approximately 17,986 tracks but can only allocate up to 850 tracks, resulting in an S B37 space abend. The allocation should use cylinders: `SPACE=(CYL,(1200,200))` since 17,986 tracks / 15 tracks per cylinder = approximately 1,200 cylinders.Question 9 (True/False)
SMS (Storage Management Subsystem) allows storage administrators to manage dataset placement and attributes through policies, reducing the need for programmers to specify VOL=SER on DD statements.
Answer
**True.** SMS automates storage management by using storage classes, management classes, and data classes to determine where datasets are placed, how they are managed, and what their default attributes are. With SMS, the storage administrator defines policies, and the system automatically selects appropriate volumes, eliminating the need for JCL to specify specific volume serial numbers.Question 10 (Multiple Choice)
What is the purpose of the VTOC (Volume Table of Contents)?
- A) To list all cataloged datasets in the system
- B) To record the location and extent information for every dataset on a specific DASD volume
- C) To store the master catalog entries
- D) To track free space across all volumes
Answer
**B) To record the location and extent information for every dataset on a specific DASD volume.** The VTOC is a special area on each DASD volume that contains a DSCB (Dataset Control Block) for every dataset residing on that volume. The DSCB records the dataset's name, location (extents), DCB attributes, creation date, and other physical characteristics. The catalog system tells you which volume a dataset is on; the VTOC tells you where on the volume it is located.Question 11 (Multiple Choice)
When defining a VSAM KSDS with IDCAMS, the FREESPACE parameter FREESPACE(20 10) means:
- A) 20% of the cluster and 10% of each extent are reserved
- B) 20% of each Control Interval and 10% of each Control Area are left free for future inserts
- C) 20 bytes per CI and 10 bytes per CA are reserved
- D) 20% of total space is primary and 10% is secondary
Answer
**B) 20% of each Control Interval and 10% of each Control Area are left free for future inserts.** The first value (20) is the percentage of each CI to leave free, and the second value (10) is the percentage of CIs in each CA to leave completely empty. This distributed free space reduces CI and CA splits when new records are inserted, which is critical for maintaining good performance in frequently updated VSAM files.Question 12 (True/False)
A PDS (Partitioned Data Set) can contain a maximum of 65,535 members.
Answer
**False.** The number of members a PDS can contain is limited by the number of directory blocks allocated, not a fixed architectural limit. Each directory block is 256 bytes and holds approximately 5–7 member entries (depending on whether ISPF statistics are stored). The practical limit depends on the directory block allocation. However, a PDSE (Partitioned Data Set Extended) does not have this directory block limitation and expands its directory automatically.Question 13 (Code Analysis)
Consider these two DD statements:
//INFILE DD DSN=BANK.PROD.EXTRACT(+1),
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(50,10)),
// DCB=(RECFM=FB,LRECL=200,BLKSIZE=27800)
//RPTFILE DD DSN=BANK.PROD.EXTRACT(0),
// DISP=SHR
In the same job, can both DD statements work correctly? Explain why or why not.
- A) Yes —
(+1)creates a new generation and(0)reads the current generation - B) No —
(0)will reference the generation that was(0)before(+1)was created, not the one just created - C) Yes — within the same job,
(0)automatically refers to the just-created(+1)generation - D) No — you cannot create and read GDG generations in the same job
Answer
**C) Yes — within the same job, `(0)` automatically refers to the just-created `(+1)` generation.** Within the same job, GDG relative references are resolved at job allocation time. When a `(+1)` is created in the same job, all references within that job are adjusted accordingly. So `(0)` in a later step will refer to the generation created as `(+1)`, and `(-1)` will refer to what was previously `(0)`. This allows a job to create a new generation and then process it in a subsequent step.Question 14 (Multiple Choice)
Which of the following is NOT a valid VSAM dataset type?
- A) KSDS (Key-Sequenced Data Set)
- B) ESDS (Entry-Sequenced Data Set)
- C) PSDS (Position-Sequenced Data Set)
- D) RRDS (Relative Record Data Set)
Answer
**C) PSDS (Position-Sequenced Data Set)** There is no VSAM type called PSDS. The four VSAM types are: KSDS (Key-Sequenced), ESDS (Entry-Sequenced), RRDS (Relative Record), and LDS (Linear Data Set). "PS" refers to Physical Sequential, which is a non-VSAM access method.Question 15 (True/False)
When BLKSIZE is set to 0 (or omitted) in the DCB parameter of a DD statement, z/OS will calculate an optimal block size automatically based on the device type.
Answer
**True.** Since z/OS 1.7 (and later), when BLKSIZE=0 is coded or BLKSIZE is omitted, the system automatically determines the optimal block size based on the LRECL, RECFM, and the track capacity of the target DASD device. This feature is called System-Determined Blocksize (SDB) and generally produces near-optimal blocking.Question 16 (Multiple Choice)
What is the main advantage of a PDSE (Partitioned Data Set Extended) over a traditional PDS?
- A) PDSEs support longer member names
- B) PDSEs automatically manage directory space and reclaim unused space without compression
- C) PDSEs support VSAM-style keyed access
- D) PDSEs can only be accessed by authorized programs
Answer
**B) PDSEs automatically manage directory space and reclaim unused space without compression.** Unlike a traditional PDS, a PDSE does not require IEBCOPY compression to reclaim space from deleted or replaced members. PDSEs manage their internal space dynamically. They also support multiple concurrent member updates, have a more robust directory structure, and do not have the directory block allocation limitation of traditional PDS datasets.Question 17 (Code Analysis)
A COBOL program contains the following SELECT statement:
SELECT ACCOUNT-MASTER
ASSIGN TO ACCTMSTR
ORGANIZATION IS INDEXED
ACCESS MODE IS DYNAMIC
RECORD KEY IS ACCT-NUMBER
FILE STATUS IS WS-FILE-STATUS.
And the JCL contains:
//ACCTMSTR DD DSN=BANK.PROD.ACCTMSTR,
// DISP=SHR
What type of dataset must BANK.PROD.ACCTMSTR be, and what access capabilities does ACCESS MODE IS DYNAMIC provide?
Answer
`BANK.PROD.ACCTMSTR` must be a **VSAM KSDS** (Key-Sequenced Data Set), because the COBOL program specifies `ORGANIZATION IS INDEXED` with a `RECORD KEY`. `ACCESS MODE IS DYNAMIC` provides the ability to switch between sequential and random access within the same OPEN. The program can: - Use `READ ACCOUNT-MASTER NEXT` for sequential processing - Use `READ ACCOUNT-MASTER KEY IS ...` for random access by key - Use `START ACCOUNT-MASTER KEY IS >= ...` to position for sequential reading from a specific point - Freely intermix these operations without closing and reopening the file This is essential for applications that need to look up specific accounts and also browse ranges of records.Question 18 (True/False)
The high-level qualifier (HLQ) of a dataset name is used by RACF for security checking and by the catalog system to route the dataset to the appropriate user catalog.
Answer
**True.** The HLQ serves dual purposes. For security, RACF uses the HLQ (often matching the user ID or group) to determine which access rules apply. For catalog management, a master catalog alias entry maps the HLQ to a specific user catalog, ensuring datasets with the same HLQ are cataloged together. This is why naming conventions are critical in z/OS environments.Question 19 (Multiple Choice)
A 3390 DASD device has a track capacity of approximately 56,664 bytes. If a dataset has RECFM=FB and LRECL=80, what is the maximum number of records that can fit on a single track with optimal blocking?
- A) 708 records
- B) 840 records
- C) 708 records per block x 1 block per track = 708
- D) Approximately 680 records
Answer
**A) Approximately 708 records** Calculation: - Maximum block size that fits on a half-track: ~27,998 bytes - Records per block: 27,998 / 80 = 349 (rounded down), so BLKSIZE = 349 x 80 = 27,920 - Blocks per track: 56,664 / 27,920 = 2 (rounded down) - Records per track: 349 x 2 = 698 However, with full-track blocking (BLKSIZE up to ~56,664): 56,664 / 80 = 708 records per block, 1 block per track = 708 records. Full-track blocking yields the best space utilization but half-track blocking (2 blocks per track) is often preferred for better I/O concurrency. The exact answer depends on block size choice, but approximately 698–708 records is correct.Question 20 (Code Analysis)
Review the following IDCAMS commands:
DEFINE GDG -
(NAME(BANK.PROD.DAILYBAL) -
LIMIT(30) -
SCRATCH -
NOEMPTY)
What do the SCRATCH and NOEMPTY parameters control?
- A) SCRATCH deletes the physical dataset when a generation rolls off; NOEMPTY means only the oldest generation is removed when the limit is exceeded
- B) SCRATCH clears the dataset contents; NOEMPTY prevents empty generations
- C) SCRATCH removes catalog entries; NOEMPTY keeps all generations indefinitely
- D) SCRATCH is for tape datasets; NOEMPTY is for DASD datasets
Answer
**A) SCRATCH deletes the physical dataset when a generation rolls off; NOEMPTY means only the oldest generation is removed when the limit is exceeded.** - **SCRATCH**: When a generation exceeds the GDG limit and must be rolled off, SCRATCH causes the physical dataset to be deleted from DASD (or scratched from tape). Without SCRATCH (i.e., NOSCRATCH), only the catalog entry is removed, and the physical data remains on the volume. - **NOEMPTY**: When a new generation would exceed the limit, only the oldest generation is removed. The alternative, EMPTY, would uncatalog ALL existing generations when the limit is exceeded.Question 21 (True/False)
In an SMS-managed environment, the DATACLAS parameter on a DD statement can provide default DCB attributes (RECFM, LRECL, BLKSIZE) so that the programmer does not need to code them explicitly.
Answer
**True.** An SMS Data Class (DATACLAS) defines default dataset attributes including RECFM, LRECL, BLKSIZE, SPACE, and RETPD. When a DATACLAS is assigned (either explicitly on the DD statement or automatically through ACS routines), any attributes not coded on the DD statement default to the values in the Data Class. Attributes explicitly coded on the DD statement override the Data Class defaults.Question 22 (Multiple Choice)
Which SPACE allocation unit typically results in the most efficient use of DASD space for large datasets?
- A) TRK (tracks)
- B) BLK (blocks)
- C) CYL (cylinders)
- D) KB (kilobytes)
Answer
**C) CYL (cylinders)** Cylinder allocation is most efficient for large datasets because: (1) the system allocates space in whole cylinders, eliminating fractional track waste; (2) sequential access can proceed without head movement between tracks on the same cylinder; (3) fewer extents are needed, reducing VTOC overhead. For very small datasets, track allocation may be more appropriate to avoid wasting an entire cylinder.Question 23 (Code Analysis)
A batch job creates a dataset with the following DD:
//WORK DD DSN=&&TEMPFILE,
// DISP=(NEW,PASS),
// SPACE=(CYL,(10,5)),
// DCB=(RECFM=FB,LRECL=300,BLKSIZE=27900)
What is special about this dataset, and what does DISP=(NEW,PASS) mean?
Answer
The `&&` prefix indicates this is a **temporary dataset**. Temporary datasets: - Are automatically assigned a system-generated dataset name - Exist only for the duration of the job - Are deleted when the job completes (or abends) - Cannot be cataloged - Are only accessible within the same job `DISP=(NEW,PASS)` means: - **NEW**: Create the dataset in this step - **PASS**: Pass the dataset to subsequent steps in the same job (rather than deleting it at the end of this step) A later step can reference `&&TEMPFILE` with `DISP=(OLD,DELETE)` or `DISP=(OLD,PASS)` to read the data. This is a common pattern for passing intermediate work files between job steps without creating permanent datasets.Question 24 (True/False)
An ESDS (Entry-Sequenced Data Set) allows records to be deleted or have their keys changed after insertion.
Answer
**False.** An ESDS does not support record deletion or key-based operations (it has no key). Records are stored in the order they are written (entry sequence) and can only be appended — never deleted or reordered. Records can be updated in place, but only if the record length does not change. An ESDS is identified by an RBA (Relative Byte Address) rather than a key. This makes ESDS suitable for log files and audit trails where data integrity requires that records are never removed.Question 25 (Multiple Choice)
What happens when you reference a GDG generation as DSN=BANK.PROD.DAILYBAL(+1) in a JCL DD statement with DISP=(NEW,CATLG,DELETE)?
- A) It opens the most recent existing generation for update
- B) It creates a new generation, one higher than the current highest
- C) It creates a generation only if the current generation count is below the limit
- D) It creates an empty placeholder that must be populated by IDCAMS