DSORG Parameter

Purpose

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.

Where DSORG is Used

  • In DD statements within JCL
  • In IDCAMS utility DEFINE commands
  • In the DCB parameter of DD statements
  • In the DCB macro for assembler programs
  • In TSO ALLOCATE commands
  • In dynamic allocation services (SVC 99)

Basic Syntax

DCB Parameter Syntax

jcl
1
2
3
//ddname DD DSN=dataset.name, // DCB=(DSORG=xx,...), // ...other parameters...

Where xx is the dataset organization code.

IDCAMS DEFINE Syntax

jcl
1
2
3
4
5
6
//SYSIN DD * DEFINE CLUSTER(NAME(dataset.name) - ... DSORG(xx) - ...) /*

DSORG Values

ValueDescriptionCommon Uses
PSPhysical SequentialFlat files, report files, sequential processing
PSUPhysical Sequential UnmovableSequential datasets that must have fixed disk locations
POPartitioned OrganizationLibraries, source code, JCL procedures
POUPartitioned Organization UnmovableLibraries that must remain in fixed disk locations
DADirect AccessRandom access files with fixed-length records
DAUDirect Access UnmovableDirect access files that must remain in fixed locations
ISIndexed SequentialLegacy indexed files (largely replaced by VSAM)
ISUIndexed Sequential UnmovableLegacy indexed files in fixed locations
VSVSAMGenerally used for allocation of VSAM datasets

Special DSORG Codes for System Use

ValueDescription
CXCommunications line group
GSGraphics organization
MQMessage queue
TQTask input/output queue
TXTCAM 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.

DSORG Usage Examples

Physical Sequential (PS) Dataset

jcl
1
2
3
4
//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.

Partitioned Dataset (PO)

jcl
1
2
3
4
//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.

Direct Access (DA) Dataset

jcl
1
2
3
4
//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.

VSAM Dataset via IDCAMS

jcl
1
2
3
4
5
6
7
8
9
10
//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.

TSO Allocation

jcl
1
2
ALLOC 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.

Common DSORG and RECFM Combinations

DSORGTypical RECFMCommon Use Case
PSFB or VBReport files, extract files, logs
PSFBA or VBAASA print control files (reports)
POFBSource code libraries, JCL libraries
POULoad module libraries
DAFDirect access applications requiring fixed record locations

Technical Details

Access Methods by DSORG

DSORGAccess MethodNotes
PSQSAM (Queued Sequential Access Method)Efficient for sequential processing
PSBSAM (Basic Sequential Access Method)Used when more control is needed over I/O operations
POBPAM (Basic Partitioned Access Method)For member access in libraries
DABDAM (Basic Direct Access Method)For direct record access by relative record number or key
ISQISAM/BISAM (Queued/Basic Indexed Sequential Access Methods)Legacy access methods, largely replaced by VSAM
VSVSAM (Virtual Storage Access Method)For KSDS, ESDS, RRDS, and LDS datasets

VSAM Dataset Types

While DSORG=VS exists, VSAM datasets are typically created and managed using IDCAMS. VSAM has its own organization subtypes:

  • KSDS (Key Sequenced Data Set): Records are organized by key, allowing both sequential and direct access
  • ESDS (Entry Sequenced Data Set): Records are organized sequentially by entry order, similar to a PS dataset but with VSAM features
  • RRDS (Relative Record Data Set): Records are accessed by their relative record number
  • LDS (Linear Data Set): A specialized VSAM dataset accessed as a continuous byte stream

Best Practices

  1. Always Specify DSORG: Include DSORG when creating new datasets to ensure proper allocation and organization
  2. Match DSORG with Usage: Select the appropriate DSORG based on how the dataset will be accessed and processed
  3. Define Complete DCB Parameters: Always specify RECFM, LRECL, and BLKSIZE along with DSORG for proper dataset definition
  4. Use VSAM for Indexed Data: For indexed data access, use VSAM KSDS rather than the older IS organization
  5. Consider SMS-managed Storage: For SMS-managed datasets, some DCB parameters may be derived from data class definitions
  6. Document Special Requirements: If using specialized DSORG types like DAU or PSU, document the reasons for requiring unmovable datasets
  7. Use PO for Multiple Related Items: Group related items (like program source code) in PO datasets rather than separate PS datasets

Common Issues and Solutions

IssueCauseSolution
Access method errorsAttempting to process a dataset with an incompatible access method for its DSORGVerify DSORG and use the appropriate access method or utility for that organization
OPEN errorsDCB parameters don't match the dataset's actual organizationUse ISPF 3.2 or IDCAMS LISTCAT to confirm the dataset's actual DSORG
Space allocation issuesDifferent 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 issuesUsing inappropriate DSORG for access patternsSelect DSORG based on how data will be processed (sequential vs. random access)
ABENDU0004-14Opening a non-VSAM dataset with VSAM access or vice versaVerify dataset type and use appropriate access method and JCL

Dataset Organization Evolution

EraPopular OrganizationsNotes
1960s-1970sPS, DA, ISEarly mainframe dataset organizations
1970s-1980sPS, PO, VSAM introductionVSAM began replacing IS for indexed data
1980s-1990sPS, PO, VSAM dominanceVSAM became the standard for business applications
1990s-2000sPS, PO, VSAM, DB2Relational databases supplemented traditional datasets
2000s-PresentPS, PO, VSAM, DB2, zFSUnix file systems and modern storage technologies

JES2 vs JES3 Considerations

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:

FeatureJES2JES3
Basic DSORG supportFull support for all DSORG typesFull support for all DSORG types
Spool datasetsJES2 spool has its own internal formatJES3 spool has its own internal format
System datasetsJES2 uses specific PDS/PDSE formats for controlJES3 uses specific PDS/PDSE formats for control

Related Concepts