IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Matching and un matching records


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rswathi_1208

New User


Joined: 14 May 2010
Posts: 11
Location: chennai

PostPosted: Wed Jun 23, 2010 5:13 pm
Reply with quote

Hi,

I have two files. one is of length 51 and another of length 10. I am comparing these two files and I need to write the matching records in one file and un matching records in another file. Please find my code below. while executin I am getting error messasage as invalid file reference FileA

Code:
FILE FILEA                                                     
PARTA      1   10 A                                           
I-RECA     1   51 A                                           
FILE FILEB                                                     
PARTB      1   10 A                                           
FILE FILE01                                                   
O-REC1     1   51 A                                           
FILE FILE02                                                   
O-REC2     1   51 A                                           
*                                                             
RCOUNT-OUT1 W  8 N                                             
RCOUNT-OUT2 W  8 N                                             
*                                                             
JOB INPUT (FILEA KEY PARTA FILEB KEY PARTB) FINISH FINISH-PROC
IF MATCHED FILEA FILEB                                         
   MOVE ' ' TO O-REC1                                         
   MOVE I-RECA TO O-REC1                                       
   PUT FILE01                                                 
   RCOUNT-OUT1 = RCOUNT-OUT1 + 1   
ELSE                               
   IF FILEB                       
    MOVE ' ' TO O-REC2             
    MOVE I-RECA TO O-REC2         
    PUT FILE02                     
    RCOUNT-OUT2 = RCOUNT-OUT2 + 1 
END-IF                             
END-IF                             
FINISH-PROC. PROC.                 
DISPLAY ' MATCH ' RCOUNT-OUT1     
DISPLAY ' NOT MATCH ' RCOUNT-OUT2 
END-PROC                           
*     


MY ERROR MESSAGE :
23 *******A010 INVALID FILE REFERENCE - FILEA
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jun 23, 2010 8:23 pm
Reply with quote

Hello,

Are both files in sequence?

Which line of code is line 23?

What happens when there is a file a record and no matching file b record?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jun 24, 2010 1:14 am
Reply with quote

Hello,

If you are determined to "multi-post" because you don't get what you want in a topic, you may find our doors become closed. . .

The previous question were an attempt to get you to think about your process. . .

The problem is quite likely because you are moving fileA data in the fileB routine. . .
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Join multiple records using splice DFSORT/ICETOOL 5
Search our Forums:

Back to Top