Home SELCOPY CBLVCAT CBLi Trial/Prices CBL SiteMap
 
Multiple Information Retrieval, Manipulation & Update for IBM Mainframe, iSeries, UNIX & PC Platforms

SELCOPY Examples Menu

The following live example illustrates use from TSO's READY message, using the S CLIST (provided on the distribution tape) to invoke SELCOPY, taking its control cards from parameter 1.

Using the command 'S TERM', the CLIST allocates both SYSIN and SYSPRINT to the user's terminal. This type of invocation is ideal for one-off jobs to investigate, for instance, the layout of files, or for simple fixes as shown in the following example.

We wish to read all members of a PDS with the dataset name, 'userid.ABCD', which happens to contain JCL. Where the JCL calls the program IEWL, replace it with a call to the program XXXX. This, of course, is not a real program name but serves as an example.

 READY

s      term
 /* TO END - ENTER SELCOPY CONTROL CARDS ...
rd A dsn=abcd dirdata upd!if p any = 'IEWL'!t p @ = 'XXXX'!t upd A!t pr
 SELCOPY REL 9.8P AT CBL - Bridgend UK (Internal Only)
 -----------------------------------------------------

      1.  RD A DSN=ABCD DIRDATA UPD
                                    IF P ANY = 'IEWL'
      2.                                              T P @ = 'XXXX'
      3.                                                             T UPD A
      4.                                                                     T PR
/*


     INPUT   SEL SEL
     RECNO   TOT ID.          1         2         3         4         5         6
     -----   --- --- ....,....0....,....0....,....0....,....0....,....0....,....0..
        77     1   4 //LNK      EXEC PGM=XXXX,REGION=500K,
        76     2   4 //LNK      EXEC PGM=XXXX,REGION=500K,
        35     3   4 //LNK      EXEC PGM=XXXX,REGION=500K,
        35     4   4 //LNK      EXEC PGM=XXXX,REGION=500K,
                     ....,....0....,....0....,....0....,....0....,....0....,....0..

 SUMMARY..
  SEL-ID      SELTOT      FILE     BLKSIZE  LRECL           FSIZE   CI    DSN
  ------      ------      ----     -------  -----           -----   --    ---
     1           320 READ A         23440    80 FB              4       P390B.ABCD
     2             4
     3             4 UPD  A         23440    80 FB              4       P390B.ABCD
     4             4

          ** ** ** ** ** ** ** SELCOPY IS LICENSED BY COMPUTE (BRIDGEND) LTD  +44 (
                                                   ** EXPIRY DATE -- 12 JUN 2001 **
 READY

The above example is perfectly good for a controlled example, but has certain short-comings if we consider changing a more commonly used string.

  1. There is no check to ensure that we don't update directory records.
  2. Only the first occurence of the string within each record will be modified.

An easier and better (in that it eliminates the deficiencies above) way to achieve the same update would be to use a REXX exec called SCANPDS, which is also provided on the SELCOPY distribution tape.
It's syntax is: SCANPDS ddname string1 string2

ddname
is the ALLOC for the input PDS
string1
is the string to scan for
string2
if provided is used to overwrite string1, wherever found, and update that PDS member record.
For our example we would key in: SCANPDS abcd IEWL XXXX

Top © 2005 Compute (Bridgend) Limited
http://www.cbl.com/selcex15.html
yyyy/mm/dd HH:MM:SS