New Feature: PDSE Library Member Generation Support
In z/OS 2.1, PDSE version 2 libraries were introduced which include support for
member generations (via the MAXGENS library data set allocation attribute).
When changes are made to member data belonging to a PDSE V2 library that supports
generations, a new generation is automatically created for the member when the data
is saved. The image of the member data before the change occurred is referenced as
relative generation number -1 and the relative generation number of each previous
image of the member data is decremented by 1.
IBM publication "z/OS DFSMS Using Data Sets" provides information on PDSE version
2 libraries and member generations.
*** Member Generation Reference ***
When processing a PDSE version 2 library which supports mamber generations,
SELCOPYi panel fields and primary commands that identify a library mamber name now
also support reference to an individual member generation.
To reference an individual member generation, SELCOPYi supports specification of
an absolute or relative generation number following the member name with a single
separating "." (dot/period) between. A member generation may be identified by its
relative or absolute generation number.
e.g.
Using a relative generation number...
EDIT NBJ.GEN25.XEC(APESUB.-5)
BROWSE NBJ.SELCI.SDO(DB2FUNC1.-1)
Using an absolute generation number...
E NBJ.GEN25.XEC(APESUB.56)
VIEW NBJ.SELCI.SDO(DB2FUNC1.7)
Note: blank characters are not permitted within a member generation
specification.
The base (or prime) generation may be identified as generation 0. In SELCOPYi,
generation 0 is treated as the relative generation value of the base generation.
Although not yet assigned to the base member generation within the PDSE structure,
SELCOPYi attributes a positive absolute generation value to the base generation.
This value corresponds to the next absolute number in the member generation
sequence.
SELCOPYi allows reference to the base generation via its relative (0) or absolute
(SELCOPYi attributed) generation number. Alternatively, the generation
specification may simply be omitted as referencing the member name only will
identify the base generation.
e.g.
Where 12 previous generations have been created for member DB2FUNC1, the base
generation may be referenced in SELCOPYi as DB2FUNC1.13. The following are
equivalent:
VIEW NBJ.SELCI.SDO(DB2FUNC1.13)
VIEW NBJ.SELCI.SDO(DB2FUNC1.0)
VIEW NBJ.SELCI.SDO(DB2FUNC1)
*** Generic Member Generation Reference ***
SELCOPYi panel fields and commands that support specification of a member name
mask to identify multiple library members now also support specification of a
member generation mask. This mask may identify multiple generations of one or
more member names.
A member generation mask is the same as a single member generation but with either:
- A null or wildcard character "*" specified in place of the
generation number. This indicates that all generations are to be selected.
- A relational operator inserted between the "." (dot/period)
and the (absolute or relative) generation number. This indicates that only
generation numbers that satisfy the numeric comparison will be selected.
Supported relational operators are:
Operator |
Description |
= |
Equal. |
<= ¬= != <> |
Not equal. |
> |
Greater than. |
<= |
Less than or equal. |
< |
Less than. |
>= |
Greater than or equal. |
Member generations that satisfy both the member mask and generation mask will be
selected.
e.g.
The following are equivalent and will open a library list of member generations
window to dispay all generations of all members:
LL NBJ.JCLLIB(*.*)
LL NBJ.JCLLIB(*.)
LL NBJ.JCLLIB(*.<*)
To list all member generations whose member name begins with CALL and whose
absolute generation number is greater than or equal to 12:
LL NBJ.JCLLIB(CALL*.>=12)
To erase all generations except the base (i.e. relative generation 0):
ERASE NBJ.JCLLIB(NBJX.<0)
To list all member generations whose member name begins with SS and whose relative
generation number is -1:
LL NBJ.JCLLIB(SS*.-1)
List all member generations whose entries match one
of the member and generation masks:
LL NBJ.JCLLIB(SS*.>=-3 ADA%%%%.>=-5 CBL*.0)
*** Utility Support for Member Generations ***
Support for PDSE version 2 library, member generation and member generation mask
specification has been implemented for SELCOPYi as follows:
** PDSE V2 Library Data Set Information **
Data Set Information panel updated to display organisation type PDSE V2 for PDSE
version 2 library data sets. (Primary command DSI or INFO, List window prefix
command "I").
** PDSE V2 Library Data Set Allocation **
Allocate NonVSAM dialog window updated to support allocation of a new PDSE version
2 library, optionally with member generations.
The dialog now includes field entries "Version>" (PDSE library version
1 or 2) and "Member Generations>" (PDSE 2 MAXGENS value). It may be
opened using primary command ALLOC with no parameters or opened automatically by
FSU or FCOPY when output is to a new DSN. Note that command ALLOC already supports
parameters DSNTYPE(LIBRARY,2) and MAXGENS.
** PDSE V2 Library Member Generation List **
Library Member Generations list window introduced to display an entry for each
generation that matches a supplied member and member generation mask. The list
has the same columns as a Library Member list but with additional GenA and GenR
columns to display absolute and relative generation numbers respectively.
The list may be opened via the following:
- Execute the LL (ListLibrary) primary command with a member generation or
member generation mask parameter specification.
i.e. LL <libname>( <mbrmask>.<genmask> ... )
- Execute prefix area command "G" against an entry in a VTOC,
Library Member or Dataset type list. All generations will be displayed for
the PDSE library or member name list entry.
** Member Generation Copy **
Member generation masks may be used to select individual generations of one or
more members to be copied from a PDSE V2 library to a target file. This target
file may be an HFS/ZFS file, a VSAM, sequential or GDG dataset, a PDS or PDSE
library or an individual library member.
Copy of member generations may be performed via the following methods:
- Execute FCOPY primary command with a member generation mask source data
object specification.
e.g.
FCOPY NBJ.JCLLIB(*.*) NBJ.JCLLIB.COPY
- Open the File Copy panel and enter a member generation mask in the Member
Mask field.
- Execute prefix area command "C" against entries in a Library Member
Generations list.
Copy of multiple member generations will be in ascending alphabetical order of
selected member name and ascending order of absolute generation number. Thus,
the oldest generation of a member is copied first.
The format of the copied data is dependent upon the organisation of the target
data object as follows:
- If copy is to a single target dataset, library member or HFS/ZFS file then
the records in each selected member generation will be appended to the
target file with optional member delimiter lines.
- If copy is to a library data set which does *not* support member generations,
then the target library will contain individual members with names matching
those in the member generation mask. Each of these members will contain
only data records from the newest member generation to match the member
generation mask.
-
If copy is to a library data set which supports member generations, then the
target library will contain an individual member generation for each
generation selected by the member generation mask.
Note that generation numbers in the target library may not match those
selected from the source library by the generation mask. The internal
management of generation numbers by the target PDSE will determine the
assignment of the next generation number used and cannot be controlled by
application programs.
Since the target library supports generations, each copy to an existing
member name will create a new generation for that member in the target
library. Because each generation is copied in ascending order, the
generation hierarchy is preserved in the target library.
This type of copy is especially useful if a library needs to be redefined
with a greater (or fewer) number of generations.
If a member generation mask has been supplied or entries have been selected for
copy from a Library Member Generation list, then the SELECT command in the FCOPY
or Library Member Copy panel will display a table of library member generations
instead of library members.
** Member Generation Delete **
Delete (Erase) may be performed for a single generation or on multiple member
generations that match a member generation mask.
Erase of member generations may be performed via the following methods:
- Execute ERASE primary command with a member generation or member generation
mask specification.
e.g.
To erase a relative generation -5 of member SSCALL:
ERASE NBJ.JCLLIB(SSCALL.-5)
To erase all generations of member SSREL other than the base member:
ERASE NBJ.JCLLIB(SSREL.<0)
To erase generations of all members that are older than relative generation
-3:
ERASE NBJ.JCLLIB(*.<-3)
- Execute prefix area command "D" (or "K" if no
confirmation prompt is required) against entries in a Library Member
Generations list. Like library member delete, by default a prompt for each
delete of a member generation will be displayed.
- Execute prefix area command "D" (or "K") against entries
in a Library Member list (see note below).
Note: When delete is performed without a member generation specification on
a member of a PDSE library that supports generations, then a prompt to
delete all generations of the member will be displayed.
** Member Generation Recovery **
A specific member generation may be recovered so that it becomes the base member
(generation 0). The relative generation number of each generation is decremented
by 1 so that the previous base member becomes generation -1, etc.
Recovery of a member generation may be performed via the following methods:
- Execute RECOVER primary command with an explicit member generation
specification.
e.g.
RECOVER NBJ.JCLLIB(SSCALL.-1)
- Enter "RECOVER" in the prefix command area
against the non-base generation entry to be
recovered in a Library Member Generations list.
** Member Generation Search **
Member generation masks are supported as input to the FSU (File Search and Update)
utility. Output to a member generation is not valid.
Data in member generations selected by the mask may be filtered, searched,
updated, copied and remapped as supported for library members.
The File Search and Update utility using member generation input may be started
via the following methods:
- Execute FSU primary command with a member generation mask on the INPUT parameter
specification.
e.g.
To report records in all generations of all members that contain the string
"Lev":
FSU INPUT("NBJ.JCLLIB(*.*)") FIND(C'Lev')
- Open the FSU (Basic or Extended) File Search panel views and enter a member
generation mask in the Member Mask field.
** Member Generation Compare **
Member generations may be used as one or both of the file specifications used as
input to the COMPFILE primary command Compare File utility.
e.g.
COMPFILE" NBJ.JCLLIB(SSREL) NBJ.JCLLIB(SSREL.-1)
** Member Generation Text Edit/View **
The Text Editor may be used to EDIT or VIEW (i.e. edit read-only) a member
generation.
The absolute and relative generation numbers of the member generation in the focus
text edit window view is displayed in the window title bar.
e.g. G=10(-1)
Edit and view of a member generation may be started via the following methods:
- Execute the EDIT or VIEW primary command with a member generation or member
generation mask specification. If a mask is specified, a list of matching
generation entries are displayed in which one entry may be selected for use
by the edit/view operation.
e.g.
EDIT NBJ.JCLLIB(SSCALL.-5)
VIEW NBJ.JCLLIB(SSREP.23)
E NBJ.JCLLIB(SSREP) (Gen=0)
- Select (position the cursor and hit Enter) an entry from a Library Member
Generations list.
- Execute prefix area command "E" or "V" against an entry
in a Library Member Generations list.
Edit of a member generation places an exclusive SYSEDIT ENQ on the member name and
so it is not possible to open for output more than 1 generation of the same member
at the same time.
When saving changes to a member generation, the prevailing value of the GENSAVE
option dictates whether a new generation is created (NEWGEN), the current
generation is updated (NOGEN) or a popup window is opened to prompt the user for
the action to be taken on save (PROMPT). PROMPT is the default.
"SAVE ( NOGEN" or "SAVE ( NEWGEN" may be executed to
specifically save the data back to the current generation or to create a new
generation respectively.
If a fileid is also specified on the SAVE, then the NOGEN/NEWGEN parameter is
ignored. If fileid is a member of a PDSE supporting generations, then NEWGEN is
used.
** Member Generation Data Edit/View **
If the library member contains data records that are mapped by a defined language
structure (SELCOPYi SDO, COBOL, PL1, HLASM, SYMNAMES), then the Data Editor may
be used to EDIT or BROWSE member generation data with or without the structure.
Like the Text Editor, the absolute and relative generation numbers are displayed
in the Data Editor window view title bar.
Data Edit and browse of a member generation may be started by executing SD EDIT or
BROWSE primary command with a member generation or member generation mask
specification. If a mask is specified, a list of matching generation entries are
displayed in which one entry may be selected for use by the edit/browse operation.
e.g.
SD EDIT NBJ.DATA(EMP.-2) USING NBJ.SDO(EMPMAP)
BROWSE NBJ.JCLLIB(SSREP.-1)
Saving changes to member generation data obeys the GENSAVE parameter as for the
Text Editor. "SAVE NOGEN" and "SAVE NEWGEN" will override
the value set for this option as appropriate.