EXPRESS VSAM MAINTAINER
THRU A DRIVER FILE is a tool to perform
maintenance on VSAM (KSDS) DATASETS through a flat (QSAM) driver file.
This tool may work Foreground and Background, and does not need any
information about the physical attributes of the DRIVER DATASET nor the
VSAM DATASET, such as DSORG, RECFM, LRECL, BLKSIZE, VSAM KEY OFFSET,
VSAM KEY LENGTH.
VSUPD EXPRESS VSAM MAINTAINER THRU A DRIVER FILE 10/30/07 20:17
DRIVER DATASET NAME : PJ3.PRIV.SOURCE(@SCTU)
VSAM DATASET NAME : PJ3.CG9.MASTER
RUN TYPE : B (F)ORE/(B)ACKGROUND. DEFAULT IS "F".
VSAM KEY for extracted records will be constructed in the following manner:
STARTING POSITION IN DRIVER OR A LITERAL NO OF BYTES ---------------------------------------- ----------- 1 16 (OPTIONAL WHEN INSERT) _____ _____ (OPTIONAL) _____ _____ (OPTIONAL) _____ _____ (OPTIONAL) _____ _____ (OPTIONAL)
Please define the Maintenance Type and Maintenance Fields through F7.
F1=HELP F3=EXIT F4=SAVE AS DEFAULT F5=EDIT DRIVER F6=EXECUTE F7=MAINT PARAMS |
F7 calls following panel
VSPARM
EXPRESS
VSAM MAINTAINER
PARAMETERS
10/30/07
20:15
UPDATE
TYPE:
U
(U)pdate,
(I)nsert, (D)elete
Driver
Dataset
VSAM
Dataset to be
maintained
STARTING
POSITION
NO OF
BYTES
STARTING
POSITION
-----------------
-----------
-----------------
45___
3____
80___
72___
8____
120__
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
_____
F1=HELP
F3=EXIT
F4=SAVE AS
DEFAULT
|
The tool operates in the following manner:
1. Reads the DRIVER DATASET; and constructs the VSAM KEY from
the
field(s) of the DRIVER DATASET record and,
optionally,
from literal(s), as specified in the PANEL.
2. Retrieves the VSAM DATASET record.
3. Performs one of the Maintenance Types on the VSAM DATASET
record,
in-place, as defined through the PANELs:
3.1. UPDATE: The field(s) of the DRIVER
DATASET record are moved
to their
positions in the VSAM DATASET record, and the VSAM
DATASET
record is rewritten.
3.2. UPDATE with VSAM KEY Change: When one
of the field positions
of the Update
Field specifications coincides with the OFFSET
and the
LENGTH of the VSAM DATASET record, the tool assumes
that the VSAM
RECORD KEY is to be changed. In this case,
a. It writes
a new VSAM record from the one retrieved after
having changed the key to the new value, and
b. Deletes
the old VSAM record.
3.3. DELETE: The VSAM record is deleted.
3.4. INSERT: The field(s) of the DRIVER
DATASET record are moved
to their
positions in the VSAM DATASET record, and a new
VSAM DATASET
record is written.
The necessary PANEL FIELDS for ALL Maintenance Types are as follows:
1. DRIVER DATASET NAME
2. VSAM DATASET NAME
3. MAINTENANCE TYPE (as UPDATE, DELETE, or INSERT)
The necessary PANEL FIELDS for each Maintenance Type are as follows:
1. UPDATE:
1.1. The VSAM KEY starting position and length in the
DRIVER
DATASET,
1.2. The starting position and length of UPDATE FIELD(S)
in the
DRIVER DATASET, along
with their corresponding starting
positions in the VSAM
record.
2. DELETE:
Only, the VSAM KEY
starting position and length in the DRIVER
DATASET.
3. INSERT:
Only, starting position
and length of UPDATE FIELD(S) in the
DRIVER DATASET, along
with their corresponding starting
positions in the VSAM
record.
If the DRIVER DATASET
records represent the full record of
the VSAM DATASET, only
one update field definition, with the
starting position of 1
and the length of the DRIVER (or VSAM)
record size is
sufficient.
Examples:
1. UPDATE
Parameters defined thru PANELS are as follows:
UPDATE TYPE: U
VSAM KEY Starting
Position in Driver : 5
VSAM KEY Number of
Positions in Driver : 19
UPDATE FIELD #1 Starting
Position in Driver : 40
UPDATE FIELD #1 Number of
Positions in Driver: 4
UPDATE FIELD #1 Starting
Position in VSAM : 120
UPDATE FIELD #2 Starting
Position in Driver : 50
UPDATE FIELD #2 Number of
Positions in Driver: 16
UPDATE FIELD #2 Starting
Position in VSAM : 430
PROCESS takes place as follows, for each record of the
DRIVER:
1. VSAM KEY is contructed
from the positions 5:19 of the
DRIVER
record.
2. VSAM record is read.
3. Positions 40:4 of the
DRIVER record is moved to
positions 120:4 of the VSAM record.
4. Positions 50:16 of the
DRIVER record is moved to
positions 430:16 of the VSAM record.
5. VSAM record is
rewritten.
2. UPDATE with VSAM KEY Change
Assume that the VSAM DATASET was created with KEY
positions 10:19.
Parameters defined thru PANELS are as follows:
UPDATE TYPE: U
VSAM KEY Starting
Position in Driver : 5
VSAM KEY Number of
Positions in Driver : 19
UPDATE FIELD #1 Starting
Position in Driver : 40
UPDATE FIELD #1 Number of
Positions in Driver: 4
UPDATE FIELD #1 Starting
Position in VSAM : 120
UPDATE FIELD #2 Starting
Position in Driver : 50
UPDATE FIELD #2 Number of
Positions in Driver: 16
UPDATE FIELD #2 Starting
Position in VSAM : 430
UPDATE FIELD #3 Starting
Position in Driver : 90
UPDATE FIELD #3 Number of
Positions in Driver: 19
UPDATE FIELD #3 Starting
Position in VSAM : 10
Due to the fact that the UPDATE FIELD #3's Number of
Positions in
Driver (19) and its Starting Position in VSAM (10)
coincides with
the VSAM DATASET's KEY length and starting position,
this is an
UPDATE with VSAM KEY Change.
PROCESS takes place as follows, for each record of the
DRIVER:
1. VSAM KEY is contructed
from the positions 5:19 of the
DRIVER
record.
2. VSAM record is read.
3. VSAM record is saved
in a memory location.
4. VSAM record is
deleted.
5. Saved record is placed
into VSAM record.
6. Positions 40:4 of the
DRIVER record is moved to
positions 120:4 of the VSAM record.
7. Positions 50:16 of the
DRIVER record is moved to
positions 430:16 of the VSAM record.
8. Positions 90:19 of the
DRIVER record is moved to
positions 10:19 of the VSAM record. (The KEY position.)
9. A new VSAM record is
written.
3. DELETE
Parameters defined thru PANELS are as follows:
UPDATE TYPE: D
VSAM KEY Starting
Position in Driver : 5
VSAM KEY Number of
Positions in Driver : 19
PROCESS takes place as follows, for each record of the
DRIVER:
1. VSAM KEY is contructed
from the positions 5:19 of the
DRIVER
record.
2. VSAM record is read.
3. VSAM record is
deleted.
4. INSERT
Parameters defined thru PANELS are as follows:
UPDATE TYPE: I
UPDATE FIELD #1 Starting
Position in Driver : 40
UPDATE FIELD #1 Number of
Positions in Driver: 4
UPDATE FIELD #1 Starting
Position in VSAM : 1
UPDATE FIELD #2 Starting
Position in Driver : 45
UPDATE FIELD #2 Number of
Positions in Driver: 300
UPDATE FIELD #2 Starting
Position in VSAM : 5
PROCESS takes place as follows, for each record of the
DRIVER:
1. An empty VSAM record
is created in memory.
2. Positions 40:4 of the
DRIVER record is moved to
positions 1:4 of the VSAM record.
3. Positions 45:300 of
the DRIVER record is moved to
positions 5:300 of the VSAM record.
4. A new VSAM record is
written.