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
 

 

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: 8593
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: 2422
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: 2422
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 Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
No new posts I can not compile my program PL1 V3.R... Miguel Fernandez PL/I & Assembler 13 Tue Dec 06, 2016 8:30 pm
No new posts IMS BMP program causes 878 system abend Artemk IMS DB/DC 7 Tue Nov 22, 2016 8:26 pm
No new posts A sample of exit program for exit XMN... lind sh CICS 2 Mon Oct 03, 2016 5:07 pm


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