|
SELCOPY
Examples Menu
CMS and VSE users may access directory and data records for generic groups
of files and MVS users may access all members of single or concatenated
PDSs, using the DIRDATA input facility.
CMS and MVS users may also Update-in-place, but for VSE an update file must
be written out and used subsequently as input to a LIBR step.
For Data records SELCOPY's INCOUNT value is reset to 1 on reading the first
data record from each library member or CMS file.
For Directory records the INCOUNT value is simply increased by 1 to reflect
the count of library members or CMS files.
Directory and Data records are distinguishable using the IF DIR/IF DATA
syntax.
MVS Summary of PDS Members
A PDS contains a large number of CLISTs and REXX procedures which
conventionally contain within the 1st 10 records a timestamp, level number
and a short description of their purpose and call parameters. We will
create a compendium of the descriptive text, spacing 2 lines between each
member.
noprint * Suppress print of ctl cards etc.
read INPDS dirdata * Read all PDS members.
if dir * If it's a Dir record.
then space 2 * Print 2 blank lines.
then pr type=m * Use Mixed print for binary recstats.
then goto get * Means go to 1st logical statement.
if incount <= 10 * Select 1st 10 DATA recs
then print * Use default TYPE=N
else flag eomemb * Force to read next member.
CMS Generic Update
An EXEC procedure becomes outdated and is replaced by another with a
different name. All other EXEC's which call this need therefore to be
updated to call the new name.
read '* EXEC *' dirdata * Read all EXEC files.
if dir * If it's a Dir record.
and pos 77 ne 'R/W' * Can't update if disk is read-only.
then flag eodisk * Indicate End of Disk
then goto get * Bypass rest of disk.
if pos any = 'EXEC ABC' * Name of old EXEC.
then pos @ = 'EXEC XYZ' * Change name
then update '* EXEC *' * and update the file.
The above could easily be improved so that it prints the name of each file
modified, and the names of the read-only files left unchanged.
VSE Library Generic Backup
This example will backup all payroll associated PROCEDURE and PHASE members
from a VSE Library to a single tape file.
read LIB1.SUB.PAY.* dirdata * Read all payroll files.
if dir * If it's a Dir record.
thenif pos any = 'PHASE' * Further selection.
or pos any = 'PROC'
then dummy * Do nothing.
else flag eomemb * Indicate End of Member.
then goto get * Will bypass data rec's.
wr TAPEFIL recfm=vb lrecl=4096 blksize=32000 * Copy to tape.
|