Match records



Unicenter CA-Easytrieve Plus Report Generator: CA's information retrieval and data management tool

Match records

Postby vamsyk9 » Wed Apr 24, 2013 3:17 pm

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
vamsyk9
 
Posts: 24
Joined: Mon Nov 28, 2011 7:19 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Match records

Postby NicC » Wed Apr 24, 2013 4:57 pm

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.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3026
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Match records

Postby dick scherrer » Wed Apr 24, 2013 8:20 pm

Hello,

It looks like you have a data definition error or invalid (non-numeric) data. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Match records

Postby BillyBoyo » Wed Apr 24, 2013 9:59 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Match records

Postby dick scherrer » Wed Apr 24, 2013 11:50 pm

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 . . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6269
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Match records

Postby BillyBoyo » Wed Apr 24, 2013 11:56 pm

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.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times


Return to CA-Easytrieve

 


  • Related topics
    Replies
    Views
    Last post