Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

Conversion of two SAM files into one ISAM file

&pagelevel(3)&pagelevel

Input:

SAM file PERS.DPT.1 on disk
SAM file PERS.DPT.2 on disk

Output:

ISAM file PERS.DPT,RECORD-FORMAT=*FIXED,RECORD-SIZE=100 on disk
SAM file PERS.TA,RECORD-FORMAT=*VARIABLE on tape

Tracer listing:

/CREATE-FILE FILE-NAME=PERS.DPT &* ———————————————————————————————————————  (1)
/ADD-FILE-LINK -
/   FILE-NAME=PERS.DPT,-
/   RECORD-FORMAT=*FIXED,-
/   RECORD-SIZE=100,-
/   SUPPORT=*DISK,-
/   LINK-NAME=OUT1,-
/   ACCESS-METHOD=*ISAM
/CREATE-FILE - &* ————————————————————————————————————————————————————————  (2)
/   FILE-NAME=PERS.TA,-
/   SUPPORT=*TAPE(VOLUME=FK0090,DEVICE-TYPE=TAPE-C4)
/ADD-FILE-LINK -
/   FILE-NAME=PERS.TA,-
/   SUPPORT=*TAPE,-
/   LINK-NAME=OUT2,-
/   ACCESS-METHOD=*SAM
/START-PERCON &* —————————————————————————————————————————————————————————  (3)
%  PER0000 PERCON STARTED, VERSION V03.0A00
//ASSIGN-INPUT-FILE - &* —————————————————————————————————————————————————  (4)
//   FILE=*DISK-FILE(NAME=PERS.DPT.1),-
//   LINK-NAME=IN1
//ASSIGN-INPUT-FILE - &* —————————————————————————————————————————————————  (5)
//   FILE=*DISK-FILE(NAME=PERS.DPT.2),-
//   LINK-NAME=IN2
//ASSIGN-OUTPUT-FILE - &* ————————————————————————————————————————————————  (6)
//   FILE=*DISK-FILE(NAME=PERS.DPT),-
//   LINK-NAME=OUT1

(1)

The disk file PERS.DPT is assigned with its various attributes.

(2)

The tape file PERS.TA is assigned with its various attributes.

(3)

PERCON is called.

(4)

The input file PERS.DPT.1 is assigned with the link name IN1.

(5)

The input file PERS.DPT.2 is assigned with the link name IN2.

(6)

The output file PERS.DPT is assigned with the link name OUT1.

//ASSIGN-OUTPUT-FILE - &* ————————————————————————————————————————————————  (7)
//   FILE=*TAPE-FILE(NAME=PERS.TA),-
//   LINK-NAME=OUT2
//SET-RECORD-MAPPING - &* ————————————————————————————————————————————————  (8)
//   OUTPUT-LINK-NAME=OUT1,-
//   OUTPUT-FIELDS=(-
//      *RECORD-COUNTER(-
//         LINK-NAME=OUT1,-
//         OUTPUT-POSITION=1,-
//         OUTPUT-LENGTH=8,-
//         OUTPUT-FORMAT=*ZONED-DECIMAL),-
//      *FIELD(-
//         INPUT-POSITION=5,-
//         INPUT-LENGTH=68,-
//         OUTPUT-POSITION=14,-
//         OUTPUT-LENGTH=68))
//END &* —————————————————————————————————————————————————————————————————  (9)
%  DMS0DE3 TAPE WITH VSN FK0090 FOR FILE :catid:$userid.PERS.TA IS ——————— (10)
           MOUNTED ON DEVICE AF
%  DMS0DE7 SAM FILE CLOSED: FILE NAME=:catid:$userid.PERS.TA, LINKNAME=OUT2,
           BLOCK COUNT=000001 ———————————————————————————————————————————— (11) 
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='IN1' (FILE=:cati:$userid.PERS.DPT.1):                   8  (12)
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='IN2' (FILE=:cati:$userid.PERS.DPT.2):                   4
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='OUT1' (FILE=:cati:$userid.PERS.DPT):                  12
%  PER0030 NUMBER OF PROCESSED RECORDS FOR LINK='OUT2' (FILE=:cati:$userid.PERS.TA):                  12
%  PER0031 PERCON TERMINATED NORMALLY ———————————————————————————————————— (13)

(7)

The output file PERS.TA is assigned with the link name OUT2.

(8)

The values of the record counter are transferred to the output file PERS.DPT. The record counter is transferred to the output record in zoned format with a length of 8 bytes, starting at byte 1.In this way the ISAM key is created for the ISAM file PERS.DPT. 68 bytes of the input record are written to the output record, starting from byte position 14.

(9)

The END statement starts the transfer operation and terminates PERCON.

(10)

DMS message: the tape for the file PERS.DPT has been mounted.

(11)

DMS message: the SAM file PERS.TA has been closed.

(12)

PERCON messages: the number of records transferred per file is output. The files are listed with their link and file names.

(13)

PERCON was terminated normally.

Contents of output file PERS.DPT
00000000     BELL        JOHN        MANCHESTER     BOLSOVER STREET 4        DPT1                   
00000001     BOTHAM      NORMAN      MANCHESTER     TOWER AVENUE 10          DPT2                   
00000002     FINN        SUSANNA     NORWICH        ROSE STREET 11           DPT2                   
00000003     GREENE      WALTER      BURY           SINCLAIR CRESCENT 7      DPT1                   
00000004     KING        MONICA      FALMOUTH       INMAN SQUARE 61          DPT3                   
00000005     LAKER       ERICA       MANCHESTER     BANK DRIVE 8             DPT1                   
00000006     PRICE       ALFRED      MANCHESTER     THAMES ROAD 4            DPT1                   
00000007     WILSON      RICHARD     MANCHESTER     ACACIA AVENUE 24         DPT3                   
00000008     BATES       FRANK       HULL           WOOD STREET 29           DPT4                   
00000009     HARRISON    MAURICE     MANCHESTER     SINCLAIR STREET 149      DPT4                   
00000010     ROYCE       ROBERT      MANCHESTER     LION'S GATE 74           DPT4                   
00000011     SIMPSON     ELLEN       KINGS LYNN     WILLOUGHBY STREET 8      DPT4