<s>
In	O
the	O
context	O
of	O
IBM	O
mainframe	B-Architecture
computers	I-Architecture
in	O
the	O
S/360	B-Application
line	O
,	O
a	O
data	B-Application
set	I-Application
(	O
IBM	O
preferred	O
)	O
or	O
dataset	O
is	O
a	O
computer	B-Operating_System
file	I-Operating_System
having	O
a	O
record	B-Application
organization	I-Application
.	O
</s>
<s>
Use	O
of	O
this	O
term	O
began	O
with	O
,	O
e.g.	O
,	O
DOS/360	O
,	O
OS/360	B-Application
,	O
and	O
is	O
still	O
used	O
by	O
their	O
successors	O
,	O
including	O
the	O
current	O
z/OS	B-Application
.	O
</s>
<s>
Documentation	O
for	O
these	O
systems	O
historically	O
preferred	O
this	O
term	O
rather	O
than	O
file	B-Operating_System
.	O
</s>
<s>
A	O
data	B-Application
set	I-Application
is	O
typically	O
stored	O
on	O
a	O
direct	B-Application
access	I-Application
storage	I-Application
device	I-Application
(	O
DASD	B-Application
)	O
or	O
magnetic	O
tape	O
,	O
however	O
unit	O
record	O
devices	O
,	O
such	O
as	O
punch	O
card	O
readers	O
,	O
card	O
punches	O
,	O
line	O
printers	O
and	O
page	O
printers	O
can	O
provide	O
input/output	O
(	O
I/O	O
)	O
for	O
a	O
data	B-Application
set	I-Application
(	O
file	B-Operating_System
)	O
.	O
</s>
<s>
Data	B-Application
sets	I-Application
are	O
not	O
unstructured	O
streams	O
of	O
bytes	B-Application
,	O
but	O
rather	O
are	O
organized	O
in	O
various	O
logical	O
record	O
and	O
block	O
structures	O
determined	O
by	O
the	O
DSORG	B-Application
(	O
data	B-Application
set	I-Application
organization	O
)	O
,	O
RECFM	O
(	O
record	O
format	O
)	O
,	O
and	O
other	O
parameters	O
.	O
</s>
<s>
These	O
parameters	O
are	O
specified	O
at	O
the	O
time	O
of	O
the	O
data	B-Application
set	I-Application
allocation	O
(	O
creation	O
)	O
,	O
for	O
example	O
with	O
Job	B-Application
Control	I-Application
Language	I-Application
DD	O
statements	O
.	O
</s>
<s>
Within	O
a	O
running	O
program	O
they	O
are	O
stored	O
in	O
the	O
Data	B-Application
Control	I-Application
Block	I-Application
(	O
DCB	O
)	O
or	O
Access	O
Control	O
Block	O
(	O
ACB	O
)	O
,	O
which	O
are	O
data	O
structures	O
used	O
to	O
access	O
data	B-Application
sets	I-Application
using	O
access	B-Application
methods	I-Application
.	O
</s>
<s>
Records	O
in	O
a	O
data	B-Application
set	I-Application
may	O
be	O
fixed	O
,	O
variable	O
,	O
or	O
“	O
undefined	O
”	O
length	O
.	O
</s>
<s>
For	O
OS/360	B-Application
,	O
the	O
DCB	O
's	O
DSORG	B-Application
parameter	O
specifies	O
how	O
the	O
data	B-Application
set	I-Application
is	O
organized	O
.	O
</s>
<s>
Data	B-Application
sets	I-Application
on	O
tape	O
may	O
only	O
be	O
DSORG	B-Application
=	O
PS	O
.	O
</s>
<s>
Programmers	O
utilize	O
various	O
access	B-Application
methods	I-Application
(	O
such	O
as	O
QSAM	B-Application
or	O
VSAM	O
)	O
in	O
programs	O
for	O
reading	O
and	O
writing	O
data	B-Application
sets	I-Application
.	O
</s>
<s>
Access	B-Application
method	I-Application
depends	O
on	O
the	O
given	O
data	B-Application
set	I-Application
organization	O
.	O
</s>
<s>
Regardless	O
of	O
organization	O
,	O
the	O
physical	O
structure	O
of	O
each	O
record	O
is	O
essentially	O
the	O
same	O
,	O
and	O
is	O
uniform	O
throughout	O
the	O
data	B-Application
set	I-Application
.	O
</s>
<s>
V	O
records	O
when	O
stored	O
on	O
media	O
are	O
prefixed	O
by	O
a	O
Record	O
Descriptor	O
Word	O
(	O
RDW	O
)	O
containing	O
the	O
integer	O
length	O
of	O
the	O
record	O
in	O
bytes	B-Application
and	O
flag	O
bits	O
.	O
</s>
<s>
With	O
RECFM	O
=	O
FB	O
and	O
RECFM	O
=	O
VB	O
,	O
multiple	O
logical	O
records	O
are	O
grouped	O
together	O
into	O
a	O
single	O
physical	B-General_Concept
block	I-General_Concept
on	O
tape	O
or	O
DASD	B-Application
.	O
</s>
<s>
This	O
mechanism	O
eliminates	O
the	O
need	O
for	O
using	O
any	O
"	O
delimiter	O
"	O
byte	B-Application
value	O
to	O
separate	O
records	O
.	O
</s>
<s>
The	O
data	B-Application
set	I-Application
is	O
an	O
abstraction	O
of	O
a	O
collection	O
of	O
records	O
,	O
in	O
contrast	O
to	O
files	O
as	O
unstructured	O
streams	O
of	O
bytes	B-Application
.	O
</s>
<s>
is	O
a	O
data	B-Application
set	I-Application
containing	O
multiple	O
members	O
,	O
each	O
of	O
which	O
holds	O
a	O
separate	O
sub-data	O
set	O
,	O
similar	O
to	O
a	O
directory	B-Application
in	O
other	O
types	O
of	O
file	B-Application
systems	I-Application
.	O
</s>
<s>
This	O
type	O
of	O
data	B-Application
set	I-Application
is	O
often	O
used	O
to	O
hold	O
load	O
modules	O
(	O
old	O
format	O
bound	O
executable	O
programs	O
)	O
,	O
source	O
program	O
libraries	O
(	O
especially	O
Assembler	O
macro	O
definitions	O
)	O
,	O
ISPF	B-Operating_System
screen	O
definitions	O
,	O
and	O
Job	B-Application
Control	I-Application
Language	I-Application
.	O
</s>
<s>
A	O
PDS	O
may	O
be	O
compared	O
to	O
a	O
Zip	B-General_Concept
file	I-General_Concept
or	O
COM	B-Library
Structured	I-Library
Storage	I-Library
.	O
</s>
<s>
A	O
Partitioned	O
Data	B-Application
Set	I-Application
can	O
only	O
be	O
allocated	O
on	O
a	O
single	O
volume	O
and	O
have	O
a	O
maximum	O
size	O
of	O
65,535	O
tracks	O
.	O
</s>
<s>
Besides	O
members	O
,	O
a	O
PDS	O
contains	O
also	O
a	O
directory	B-Application
.	O
</s>
<s>
Each	O
member	O
can	O
be	O
accessed	O
indirectly	O
via	O
the	O
directory	B-Application
structure	O
.	O
</s>
<s>
Once	O
a	O
member	O
is	O
located	O
,	O
the	O
data	O
stored	O
in	O
that	O
member	O
are	O
handled	O
in	O
the	O
same	O
manner	O
as	O
a	O
PS	O
(	O
sequential	O
)	O
data	B-Application
set	I-Application
.	O
</s>
<s>
The	O
only	O
way	O
to	O
recover	O
“	O
dead	O
”	O
space	O
is	O
to	O
perform	O
file	B-General_Concept
compression	I-General_Concept
.	O
</s>
<s>
Compression	O
,	O
which	O
is	O
done	O
using	O
the	O
IEBCOPY	O
utility	B-Application
,	O
</s>
<s>
(	O
Note	O
that	O
in	O
modern	O
parlance	O
,	O
this	O
kind	O
of	O
operation	O
might	O
be	O
called	O
defragmentation	B-Application
or	O
garbage	B-General_Concept
collection	I-General_Concept
;	O
data	B-General_Concept
compression	I-General_Concept
nowadays	O
refers	O
to	O
a	O
different	O
,	O
more	O
complicated	O
concept	O
.	O
)	O
</s>
<s>
PDS	O
files	O
can	O
only	O
reside	O
on	O
DASD	B-Application
,	O
not	O
on	O
magnetic	O
tape	O
,	O
in	O
order	O
to	O
use	O
the	O
directory	B-Application
structure	O
to	O
access	O
individual	O
members	O
.	O
</s>
<s>
Partitioned	O
data	B-Application
sets	I-Application
are	O
most	O
often	O
used	O
for	O
storing	O
multiple	O
job	B-Application
control	I-Application
language	I-Application
files	O
,	O
utility	B-Application
control	O
statements	O
,	O
and	O
executable	O
modules	O
.	O
</s>
<s>
An	O
improvement	O
of	O
this	O
scheme	O
is	O
a	O
Partitioned	O
Data	B-Application
Set	I-Application
Extended	O
(	O
PDSE	O
or	O
PDS/E	O
,	O
sometimes	O
just	O
libraries	O
)	O
introduced	O
with	O
DFSMSdfp	O
for	O
MVS/XA	O
and	O
MVS/ESA	O
systems	O
.	O
</s>
<s>
However	O
,	O
PDS/E	O
files	O
have	O
a	O
better	O
directory	B-Application
structure	O
which	O
does	O
not	O
require	O
pre-allocation	O
of	O
directory	B-Application
blocks	O
when	O
the	O
PDS/E	O
is	O
defined	O
(	O
and	O
therefore	O
does	O
not	O
run	O
out	O
of	O
directory	B-Application
blocks	O
if	O
not	O
enough	O
were	O
specified	O
)	O
.	O
</s>
<s>
PDS/E	O
files	O
can	O
only	O
reside	O
on	O
DASD	B-Application
in	O
order	O
to	O
use	O
the	O
directory	B-Application
structure	O
to	O
access	O
individual	O
members	O
.	O
</s>
<s>
A	O
Generation	O
Data	O
Group	O
(	O
GDG	O
)	O
is	O
a	O
group	O
of	O
non-VSAM	O
data	B-Application
sets	I-Application
that	O
are	O
successive	O
generations	O
of	O
historically-related	O
data	O
stored	O
on	O
an	O
IBM	O
mainframe	B-Architecture
(	O
running	O
OS	B-Application
or	O
DOS/VSE	O
)	O
.	O
</s>
<s>
Generation	O
Data	O
Groups	O
are	O
defined	O
using	O
either	O
the	O
BLDG	O
statement	O
of	O
the	O
IEHPROGM	O
utility	B-Application
or	O
the	O
DEFINE	O
GENERATIONGROUP	O
statement	O
of	O
the	O
newer	O
IDCAMS	O
utility	B-Application
,	O
which	O
allows	O
setting	O
various	O
parameters	O
.	O
</s>
