Page 1 of 1

Match records

PostPosted: Wed Apr 24, 2013 3:17 pm
by vamsyk9
Hi,

I have a requirement to change the group number in the below line as mentioned below

I want to match the branch from file and file2 if it matches update group from file2 into file1 and write to file3, Using the below code, I am getting empty file and also below error later on.

//EASY01    EXEC PGM=EZTPA00                               
//STEPLIB   DD DSN=SW.PANPLUS.LOAD,DISP=SHR               
//SYSPRINT  DD SYSOUT=*                                   
//SYSOUT    DD SYSOUT=*                                   
//SYSUDUMP  DD SYSOUT=I                                   
//EZTVFM    DD UNIT=SYSDA,SPACE=(4096,(600,600))           
//FILE1     DD DISP=SHR,DSN=AAAAAAA.P.COPY1.YR2012         
//FILE2     DD DISP=SHR,DSN=BBBBB.OY2012.CLONE             
//FILE3     DD DISP=SHR,DSN=AAAAAAA.P.COPY1.YR2012.CLONE   
//SYSIN     DD *                                           
*                                                         

FILE FILE1                                                           
   EXT-EMPNO-REC                                       1   2025  A   
   EXT-BRANCH                                          17   4    N   
   EXT-GROUP                                           14   3    A   
   EXT-GROUP1                                          77   3    A   

FILE  FILE2                                                         
   D5-TAB-RECORD                                       1  100   A   
   D5-BRANCH-DATA                                      1   4    N   
   I-D5-GROUP                                          7   3    A   
                                                                     
FILE FILE3                                                           
   D5-OUT-REC                                          1   2025  A   

JOB INPUT (FILE1 KEY(EXT-BRANCH) +                 
           FILE2 KEY(D5-BRANCH-DATA))             
                                                   
IF MATCHED                                         
   D5-OUT-REC = EXT-EMPNO-REC                     
   MOVE I-D5-GROUP TO EXT-GROUP                   
   PUT FILE3                                       
   GOTO JOB                                       
END-IF                                             
                                                   
IF FILE1                                           
   PUT FILE3                                       
   GOTO JOB                                       
END-IF                                             
                                                   
IF FILE2                                           
   PUT FILE3                                       
   GOTO JOB                                       
END-IF                               


OPTIONS FOR THIS RUN - ABEXIT SNAP  DEBUG (STATE FLDCHK NOXREF)  LIST (PARM FILE)  PRESIZE   512       
SORT (DEVICE SYSDA  ALTSEQ NO  MSG DEFAULT  MEMORY MAX   WORK   3)  VFM (   64)                       
    15 *******A006 PROGRAM INTERRUPT - CODE 7 (DATA EXCP)                                             
INTERRUPT OCCURRED AT 0214 BLOCK   1 FROM EP CA-EASYTRIEVE PLUS 6.2 9606-24/04/13-10.44-JSN00015       
INSTRUCTION AT 01E224   IS F89954505316                                                               
FIRST  OPERAND ADDRESS 015450   CONTENTS 00000000000000000000                                         
SECOND OPERAND ADDRESS 015316   CONTENTS 00000000000000000000                                         
PSW AT INTERRUPT  07850007 E001E22A                                                                   
REGISTERS AT INTERRUPT                                     


Please let me know why this is failing

Code'd

Re: Match records

PostPosted: Wed Apr 24, 2013 4:57 pm
by NicC
If you had used the code tags as you should I might take a look but as you haven't bothered why should I? You have been around on the forum long enough to know that you should use code tags when posting code, JCL, control cards and data.

Re: Match records

PostPosted: Wed Apr 24, 2013 8:20 pm
by dick scherrer
Hello,

It looks like you have a data definition error or invalid (non-numeric) data. . .

Re: Match records

PostPosted: Wed Apr 24, 2013 9:59 pm
by BillyBoyo
The Easytrieve Plus abend handler is telling you that line 15 (on the output listing) is where the problem occured.

I'd "guess" that line 15 is the JOB statement, because you are not using numeric data anywhere except in the matching.

Either on at least one record EXT-BRANCH or D5-BRANCH-DATA (or both) contain invalid numeric data, which is "binary zeros".

I assume your records are fixed-length?

Check the positions of your fields. If that doesn't get you anywhere, write a little Easytrieve/SORT/ICETOOL to check those two fields.

D5-OUT-REC = EXT-EMPNO-REC         


The above I would write as:

MOVE FILE1 TO FILE3


   MOVE I-D5-GROUP TO EXT-GROUP   


This one I would write as:

EXT-GROUP = I-D5-GROUP


Easytrieve Plus MOVE is not like a Cobol MOVE. It does no data conversion. It'll burn you some time.

Re: Match records

PostPosted: Wed Apr 24, 2013 11:50 pm
by dick scherrer
Hello,

From looking at the code, there may be other issues than the s0c7 . . .

As in what will be in file3 on a non-match? Unless you have only posted pseudo-code . . .

Re: Match records

PostPosted: Wed Apr 24, 2013 11:56 pm
by BillyBoyo
True.
PUT FILE3 FROM FILE1

PUT FILE3 FROM FILE2


I'd get rid of the IF FILE2, because it only confuses. You've got rid of matches and file1, so there can only be file2 left.