SELCOPY
Examples Menu
The simplest of functions you can perform with SELCOPY are file copies. The
following is a SELCOPY program which does this:
READ A
WRITE B
The above represent the minimum elements required for a SELCOPY program.
One selection (READ) must cause input, and one selection (WRITE) must cause
output. In this case, SELCOPY will READ one logical record from file A and
then copy it to file B. The READ/WRITE cycle is repeated until all of the
records from file A are exhausted (i.e. end of file is reached) at which
point, by default, SELCOPY will automatically terminate.
In addition to the control cards shown, a link must be provided between the
filenames mentioned to SELCOPY (Files A & B in the above example) and the
physical datasets to which they refer.
These are:
- DD statements for MVS users,
- FILEDEF statements for CMS users, and
- TLBL, DLBL, EXTENT and ASSGN statements for VSE users.
Alternatively, SELCOPY will dynamically allocate files using a dataset name
provided either as a literal or from a position in its work area. e.g.
READ A DSN='SEQUENTIAL.INPUT.FILE' VOL=SYSWK1
WRITE B DSN=44 AT 1001 CAT=UCAT1 VSAM
|