Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Check whether the Empno in master file not in trans file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kalaignar_S
Warnings : 1

New User


Joined: 06 Jan 2006
Posts: 21

PostPosted: Mon May 15, 2006 2:11 pm    Post subject: Check whether the Empno in master file not in trans file
Reply with quote

Hi..

I have 2 sequential files (master and transaction) having a common field (called empno).
How can i check whether the empno available in master file not in transaction file and vise-versa?

In a cobol program for a file one open and close premitted..

Please help in this regard.


Thanks
Kalaignar
Back to top
View user's profile Send private message

parikshit123

Active User


Joined: 01 Jul 2005
Posts: 269
Location: India

PostPosted: Mon May 15, 2006 2:20 pm    Post subject:
Reply with quote

Hi,
You need to write a sepearate sort step(s) in which, both the files are sorted on empno key.

Then you can write a cobol program based on key matching algorithm. With this approach, you need not open and close both the files more than once.

Thanks,
Parikshit.
Back to top
View user's profile Send private message
kalaignar_S
Warnings : 1

New User


Joined: 06 Jan 2006
Posts: 21

PostPosted: Mon May 15, 2006 2:43 pm    Post subject: Re: file comparison
Reply with quote

Please let me know the details in detail..
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Mon May 15, 2006 2:47 pm    Post subject:
Reply with quote

Hi,

Pls refer the below code for ur prob.

Code:


C300-CHECK-KEY-MATCH SECTION.
********************************************************
 THIS PARAGRAPH PERFORMS KEY COMPRASION OF MSTR
 AND TRANS FILE
********************************************************

    IF X06-TRANS-KEY  = X05-MSTR-KEY
         PERFORM C310-CHECK-DATA-MATCH
         PERFORM C100-READ-TRANS
         PERFORM C200-READ-MSTR
    ELSE
         IF X06-TRANS-KEY  < X05-MSTR-KEY
            MOVE 'B' TO X04-RECORD-MATCH
            PERFORM C400-ERROR-MSG
            PERFORM C100-READ-TRANS
         ELSE
            MOVE 'M' TO X04-RECORD-MATCH
            PERFORM C400-ERROR-MSG
            PERFORM C200-READ-MSTR
         END-IF
    END-IF
    .


Thanks,
Dipanshu G.
Back to top
View user's profile Send private message
dipanshu

New User


Joined: 16 Jan 2006
Posts: 53
Location: pune

PostPosted: Mon May 15, 2006 4:02 pm    Post subject:
Reply with quote

Hi,

This is to remind u the above code is only applicable after both the files r sorted.

Thanks,
Dipanshu G.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 0 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 7 Fri Nov 18, 2016 1:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us