The DSORG (Dataset Organization) parameter specifies the physical organization of a dataset. It is a critical parameter that defines how data is stored and accessed within a dataset, which in turn determines the appropriate access methods and utilities that can be used with the dataset.
Key Point:
DSORG is primarily used in DD statements and data set utility programs to define or identify the dataset's organization, ensuring that the correct access methods are applied to read or write data.
123//ddname DD DSN=dataset.name, // DCB=(DSORG=xx,...), // ...other parameters...
Where xx
is the dataset organization code.
123456//SYSIN DD * DEFINE CLUSTER(NAME(dataset.name) - ... DSORG(xx) - ...) /*
Value | Description | Common Uses |
---|---|---|
PS | Physical Sequential | Flat files, report files, sequential processing |
PSU | Physical Sequential Unmovable | Sequential datasets that must have fixed disk locations |
PO | Partitioned Organization | Libraries, source code, JCL procedures |
POU | Partitioned Organization Unmovable | Libraries that must remain in fixed disk locations |
DA | Direct Access | Random access files with fixed-length records |
DAU | Direct Access Unmovable | Direct access files that must remain in fixed locations |
IS | Indexed Sequential | Legacy indexed files (largely replaced by VSAM) |
ISU | Indexed Sequential Unmovable | Legacy indexed files in fixed locations |
VS | VSAM | Generally used for allocation of VSAM datasets |
Value | Description |
---|---|
CX | Communications line group |
GS | Graphics organization |
MQ | Message queue |
TQ | Task input/output queue |
TX | TCAM line group |
Note:
The "U" suffix in PSU, POU, DAU, and ISU indicates "unmovable" datasets, which are datasets that cannot be moved by the system during routine operations. This is rarely used in modern systems except for specialized applications.
1234//DD1 DD DSN=USER.DATA.FILE, // DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(10,2)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DSORG=PS)
This example creates a new physical sequential dataset with fixed-block records.
1234//SRCLIB DD DSN=USER.SOURCE.LIB, // DISP=(NEW,CATLG,DELETE), // SPACE=(CYL,(5,1,10)), // DCB=(RECFM=FB,LRECL=80,BLKSIZE=8000,DSORG=PO)
This example creates a new partitioned dataset (library) with directory blocks for member entries.
1234//DIRECT DD DSN=USER.DIRECT.FILE, // DISP=(NEW,CATLG,DELETE), // SPACE=(TRK,(50,10)), // DCB=(RECFM=F,LRECL=256,BLKSIZE=256,DSORG=DA)
This example creates a direct access dataset, which allows records to be accessed directly by their key.
12345678910//STEP1 EXEC PGM=IDCAMS //SYSPRINT DD SYSOUT=* //SYSIN DD * DEFINE CLUSTER (NAME(USER.VSAM.KSDS) - VOLUMES(VOL001) - INDEXED - RECORDSIZE(80 80) - KEYS(8 0) - CYLINDERS(2 1)) /*
For VSAM datasets, you typically use IDCAMS DEFINE commands instead of specifying DSORG=VS directly.
12ALLOC F(OUTDD) DA('USER.DATA.FILE') NEW SPACE(1,1) TRACKS - DSORG(PS) RECFM(FB) LRECL(80) BLKSIZE(8000)
Example of using DSORG in a TSO ALLOCATE command.
DSORG | Typical RECFM | Common Use Case |
---|---|---|
PS | FB or VB | Report files, extract files, logs |
PS | FBA or VBA | ASA print control files (reports) |
PO | FB | Source code libraries, JCL libraries |
PO | U | Load module libraries |
DA | F | Direct access applications requiring fixed record locations |
DSORG | Access Method | Notes |
---|---|---|
PS | QSAM (Queued Sequential Access Method) | Efficient for sequential processing |
PS | BSAM (Basic Sequential Access Method) | Used when more control is needed over I/O operations |
PO | BPAM (Basic Partitioned Access Method) | For member access in libraries |
DA | BDAM (Basic Direct Access Method) | For direct record access by relative record number or key |
IS | QISAM/BISAM (Queued/Basic Indexed Sequential Access Methods) | Legacy access methods, largely replaced by VSAM |
VS | VSAM (Virtual Storage Access Method) | For KSDS, ESDS, RRDS, and LDS datasets |
While DSORG=VS exists, VSAM datasets are typically created and managed using IDCAMS. VSAM has its own organization subtypes:
Issue | Cause | Solution |
---|---|---|
Access method errors | Attempting to process a dataset with an incompatible access method for its DSORG | Verify DSORG and use the appropriate access method or utility for that organization |
OPEN errors | DCB parameters don't match the dataset's actual organization | Use ISPF 3.2 or IDCAMS LISTCAT to confirm the dataset's actual DSORG |
Space allocation issues | Different DSORG types may require specific space allocations (e.g., PO needs directory blocks) | Ensure space parameters match the DSORG requirements (e.g., include directory blocks for PO) |
Performance issues | Using inappropriate DSORG for access patterns | Select DSORG based on how data will be processed (sequential vs. random access) |
ABENDU0004-14 | Opening a non-VSAM dataset with VSAM access or vice versa | Verify dataset type and use appropriate access method and JCL |
Era | Popular Organizations | Notes |
---|---|---|
1960s-1970s | PS, DA, IS | Early mainframe dataset organizations |
1970s-1980s | PS, PO, VSAM introduction | VSAM began replacing IS for indexed data |
1980s-1990s | PS, PO, VSAM dominance | VSAM became the standard for business applications |
1990s-2000s | PS, PO, VSAM, DB2 | Relational databases supplemented traditional datasets |
2000s-Present | PS, PO, VSAM, DB2, zFS | Unix file systems and modern storage technologies |
The DSORG parameter is generally consistent between JES2 and JES3 environments as it relates to the underlying data management system rather than the job entry subsystem. However, there are some considerations:
Feature | JES2 | JES3 |
---|---|---|
Basic DSORG support | Full support for all DSORG types | Full support for all DSORG types |
Spool datasets | JES2 spool has its own internal format | JES3 spool has its own internal format |
System datasets | JES2 uses specific PDS/PDSE formats for control | JES3 uses specific PDS/PDSE formats for control |