Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Need help in Easytrieve program

 
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
ritnihi

New User


Joined: 30 Jul 2010
Posts: 7
Location: Bangalore

PostPosted: Fri Jul 30, 2010 11:34 am    Post subject: Need help in Easytrieve program
Reply with quote

Hi,

I am having 2 files (File-1 and File-2). File-2 is having header part on the top (system date and other info). I have to extract the header part and match both the files on customer-id. The File-1 and File-2 is coming in sorted order.

I have tried 1 logic before procedure division:

SORT FILE-2 to S-FILE-2 +
USING (FILE-2 key) +
BEFORE HDR-EXTRACT para

But as my File-2 is coming in sorted order I can't use this logic.

Please help me if you have any solution for this. icon_smile.gif
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8657
Location: Back in jolly old England

PostPosted: Fri Jul 30, 2010 11:41 am    Post subject:
Reply with quote

And since how long has Easytrieve been Mainframe COBOL.
Topic moved to correct forum.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2446
Location: Netherlands, Amstelveen

PostPosted: Fri Jul 30, 2010 11:58 am    Post subject:
Reply with quote

The header will not match, so what is the problem?
Back to top
View user's profile Send private message
ritnihi

New User


Joined: 30 Jul 2010
Posts: 7
Location: Bangalore

PostPosted: Fri Jul 30, 2010 4:55 pm    Post subject:
Reply with quote

Hi,

I have to extract the header (1st record in file-2) and match other records in both the files......but the logic i m not getting how to do this??

If u have plz share it
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Sat Jul 31, 2010 2:52 am    Post subject:
Reply with quote

Hello and welcome to the forum,

Suggest you show the code you are using to compare the 2 files.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2446
Location: Netherlands, Amstelveen

PostPosted: Sat Jul 31, 2010 10:32 am    Post subject:
Reply with quote

Try this :

Code:

JOB INPUT(FILE-1 KEY(F1KEY) FILE-2 KEY(F2KEY))
IF MATCHED
   * your matched processing goes here
END-IF
IF NOT MATCHED
   IF FILE-2 AND FILE-2:RECORD-COUNT = 1
   * your header record processing goes here
   END-IF
END-IF
Back to top
View user's profile Send private message
ritnihi

New User


Joined: 30 Jul 2010
Posts: 7
Location: Bangalore

PostPosted: Mon Aug 02, 2010 3:25 pm    Post subject:
Reply with quote

I have got the solution. I kept 2 JOB INPUT syntax inside the Procedure division.
1) First JOB INPUT will read the FILE-2 and extract the header
2) Second JOB syntax will match FILE-1 and FILE-2 on base of key. Now file-2 is having only detail records without header.


Hi Peter,
Thank you for ur solution. But i was late to read your reply. Sorry i have already done my coding and testing. Ya but I will try ur solution once.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   This topic is locked: you cannot edit posts or make replies.    IBMMAINFRAMES.com Support Forums -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Error executing Java program in OSGI ... danik56 CICS 0 Thu Apr 26, 2018 12:16 am
No new posts How to display offset thru cobol prog... tvinodkumar7 CICS 2 Sun Apr 22, 2018 8:42 pm
No new posts How do you attach a DB2 plan to a CIC... John Poulakos DB2 0 Wed Apr 18, 2018 1:49 am
No new posts VSAM file NOT Found error while proce... SumaReva CICS 5 Wed Apr 11, 2018 9:54 pm
No new posts Mantis Program Compiled? luis carlos CICS 2 Sat Apr 07, 2018 8:59 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us