tags:

views:

1632

answers:

2

Hi,

Here is my requirement....

I have 2 input files of 5200 length. A 7 byte key is used to compare both the files, if there is a match than it needs to be written to match file but while writing to match file i need few fields from infile1 and all other fields from infile2.

If there is no match than write to no match file.

Is it possible to do it in sort...i know it can be easily done using COBOL pgm but just want to know in sort/icetool/iceman/EZTRIEVE....

Can someone help me....

Thanks in advance, Deepu

A: 

I had used JCL about 2 years back so cannot write a code for you but here is the idea;

  1. Have 2 steps
  2. First step will have ICETOOl where you can write the matching records to matched file.
  3. Second you can write a file for mismatched by using SORT/ICETOOl or by just file operations.

again i apologize for solution without code, but i am out of touch by 2 yrs+

adbanginwar
A: 

In Eztrieve it's really easy, below is an example how you could code it:

//STEP01 EXEC PGM=EZTPA00
//FILEA DD DSN=FILEA,DISP=SHR
//FILEB DD DSN=FILEB,DISP=SHR //FILEC DD DSN=FILEC.DIF,
// DISP=(NEW,CATLG,DELETE),
// SPACE=(CYL,(100,50),RLSE),
// UNIT=PRMDA,
// DCB=(RECFM=FB,LRECL=5200,BLKSIZE=0)
//SYSOUT DD SYSOUT=*
//SRTMSG DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
FILE FILEA
FA-KEY 1 7 A
FA-REC1 8 10 A FA-REC2 18 5 A

FILE FILEB
FB-KEY 1 7 A
FB-REC1 8 10 A
FB-REC2 18 5 A

FILE FILEC

FILE FILED
FD-KEY 1 7 A
FD-REC1 8 10 A
FD-REC2 18 5 A

JOB INPUT (FILEA KEY FA-KEY FILEB KEY FB-KEY)
IF MATCHED
FD-KEY = FB-KEY
FD-REC1 = FA-REC1 FD-REC2 = FB-REC2 PUT FILED ELSE IF FILEA PUT FILEC FROM FILEA
ELSE PUT FILEC FROM FILEB END-IF
END-IF
/*

Laurindo