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

SELCOPY Examples Menu

The CAT statement
Concatenation of input files is beneficial to MVS, VSE and CMS users, as any type of file may be concatenated. e.g. a sequential disk file, a VSAM file, a Card reader file, a Library Directory file, and even a VTOC file. No restrictions on record format, record length or blocksize.

CAT Example

 READ SEQDISK
  CAT DBAAAA00  DL1 SEG=DBAAAA01    * A DL1 data base.
  CAT CARD
  CAT LIB2DD  DIR                   * A PDS directory.
  CAT TAPE10                        * A magnetic tape.
  CAT ABCFILE KSDS
 WRITE BIGFIL                       * Your reqd RECFM etc.

CAT Example for VSE
An example for VSE users is to read a standard MVS labelled tape containing 2 logical data sets, processing everything (all 6 physical data sets) as data by reading the tape as unlabelled using NL, No Label. An MVS data set on tape consists of 3 sections, each one terminated by a Tape Mark which denotes physical EOF (End-of-File) for a VSE unlabelled tape.

  • The 1st section contains two 80-byte Header records for the data set, and on the 1st data set on the tape volume this section will also contain one 80-byte Volume label preceding the HDR records.
  • The 2nd section contains the data records for the data set which may be of any length up to 32760 bytes.
  • The 3rd section contains two 80-byte Trailer records for the data set.

Thus the 2 data sets constitute 6 unlabelled VSE files, which we will read as one file using the CAT statement. Note that TLBL cards are not required for unlabelled tapes.

 // ASSGN SYS010,X'280'
 // ASSGN SYS011 etc up to SYS015, all to the same drive.
 // EXEC SELCOPY

   READ TAPE10   NL                CLOSE=NORWD  B=80     RECFM U
    CAT TAPE11   NL   OPEN=NORWD   CLOSE=NORWD  B=32760  RECFM U
    CAT TAPE12   NL   OPEN=NORWD   CLOSE=NORWD  B=80     RECFM U
    CAT TAPE13   NL   OPEN=NORWD   CLOSE=NORWD  B=80     RECFM U
    CAT TAPE14   NL   OPEN=NORWD   CLOSE=NORWD  B=32760  RECFM U
    CAT TAPE15   NL   OPEN=NORWD                B=80     RECFM U

   IF LRECL = 80              * Check length of current record.
     TI P 2 = 'VOL'  !OR P 2 = 'HDR'  !OR P 2 = 'TRL'
       THEN PRINT   TYPE M            * Statistics info.
       THEN GG                        * GOTO GET if reqd.
   WRITE BIGFIL  RECFM U  LRECL 32760 * Make a Disk copy.
/*

CAT Example for MVS

An example for MVS users is to concatenate several associated files of different types. e.g. A RECFM=FB unlabelled tape file, a RECFM=VB file and a VSAM ESDS on different disk types. This mixture of files cannot be concatenated using JCL.

Assuming DD statements for TAPE1, DISK1, DISK2, SYSPRINT and SYSIN:

 READ TAPE1   RECFM=FB   L=46   INTO 11   WORKLEN 222
  CAT DISK1             * Recfm, Blksize & Lrecl known to system.
  CAT DISK2   ESDS      * Must identify as VSAM ESDS
 IF IN 1 !THEN MOVE 8 FR FNAME   TO 1   * Current filename.

 IF POS 11 = 'CUST'                     * Test pos 1 of inp rec.
   THEN LRECL = L+10                    * Allow for filename
   THEN PRINT                           * Print Customers only.

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