In mainframe, physical data storages are how the z/OS organizes data:
PS
PDS
VSAM (KSDS, ESDS, RRDS)
GDG
Although z/OS manages the storages differently from the DOS or UNIX/Linux, COBOL calls these physical files.
VSAM: Virtual Storage Access Method. Database-like storage, high-speed access, used in transactional systems (CICS), record-based, not byte-based.
FIGURE OF PS STRUCTURE:
Sequential Data Set (SDS):
one physical file
from structural point of view, it is analogue with a table
appears as a folder in browsers
there are records in it, analogue with lines in a file or records in a table
it is as one long flow of records where the length of lines is fix or variable
can be read only in sequential order
the order of data is important, processing data happens in strict order, this speeds up the sequental process of dealing with millions of data
Partitioned Data Set (PDS):
one physical file
from structural point of view, it is analogue with a database
appears as a folder in browsers
there is a metadata called directory attached to it
there are separated sequential sets of data inside called members
members appear as files in browsers, analogue with tables
there are records in a member, analogue with lines in a file or records in a table
the order of the data is unimportant, processing members is possible in any order, this gives flexibility to the application
PDS(E): PDS Enhanced.
An index maintained in the metadata points to a group of individual records.
Member naming rules in PDS and PDS(E):
maximum 8 characters, can contain A..Z, 0..9, @, #, $, can not start with a number, can not be blank, can not contain space or dot
examples: MYLIB(JCL01), MYLIB(LOADMOD), MYLIB(UTIL$A)
Full reference of a member:
DATASET.NAME(MEMBER)
examples: MYUSER.JCL(PRODSTAR), SYS1.PARMLIB(IEASYS00)
Simple way to create a new data set:
right click on the root of the data sets
select Create New Data Set
a name field pops up, type the qualifiers as needed
set Partitioned Data Set: Default
select Edit Attributes
change the Allocation unit from CYL to TRK
select Allocate Data Set
Common usage:
programs
copybooks
JCLs
FIGURE OF PDS STRUCTURE:
The VSAM is a storage family:
KSDS (Key-Sequenced Data Set; records with keys, fast search)
ESDS (Entry-Sequenced Data Set; sequential, append-only)
RRDS (Relative Record Data Set; records with record numbers, fix record slots)
LDS (Linear Data Set; DB2, zFS, large binary data)
FIGURE OF VSAM KSDS STRUCTURE:
FIGURE OF VSAM ESDS STRUCTURE:
The VSAM RRDS is made from equal-sized slots where every slot carries a header and its corresponding data.
FIGURE OF VSAM RRDS STRUCTURE:
The GDG is not an independent storage type but a dataset group of PSs (and rarely PDSs and PDSEs) where the qualifier ending gives version number.
EXAMPLE FOR GDG:
COBOL handles logical files, rendering them to physical files:
COBOL interprets the logical access mode from the source code
COBOL runtime defines how the logical file should be accessed
z/OS handles the physical management