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
 

 

Compare two files using EASYTrieve

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
Vallabhaneni

New User


Joined: 30 Sep 2006
Posts: 4

PostPosted: Fri Jan 12, 2007 1:14 am    Post subject: Compare two files using EASYTrieve
Reply with quote

Hi,

I want to compare two files

FileA
101
202
202
302
401

FileB
101
201
401

I need output like

101
201
201
302
401

That means when I got match between Flle A, Fileb I have to move # 3 positon from B to # 3 position A, I have to retrieve all duplicates from file A.

Please see my coding below

PARM DEBUG (CLIST, DMAP, XREF, SHORT)
FILE SSAOUT
IN-DATA 1 3 A
IN-REC-TYPE 1 1 A
IN-KEY 2 1 A
IN-DATE 3 1 A
FILE SSADUMP
SSA-DATA 1 2 A
SSA-KEY 1 1 A
SSA-DATE 2 1 A
FILE SSADUMP1
SSA-DATA1 1 2 A
FILE OUTFILE
OUT-DATA 1 3 A
FILE OUTFILE1
OUT-DATA 1 4 A
OUT-REC-TYPE 1 1 A
OUT-REC 2 3 A


JOB INPUT (SSAOUT KEY IN-KEY +
SSADUMP KEY SSA-KEY)

IF DUPLICATE SSADUMP
GO TO JOB
END-IF

IF MATCHED
IF IN-REC-TYPE EQ '2'
IF IN-DATE EQ SSA-DATE
PUT OUTFILE FROM SSAOUT
ELSE
OUT-REC = IN-DATA
OUT-REC-TYPE = 'B'
PUT OUTFILE1
IN-DATE = SSA-DATE
OUT-REC = IN-DATA
OUT-REC-TYPE = 'A'
PUT OUTFILE1

PUT OUTFILE FROM SSAOUT
PUT SSADUMP1 FROM SSADUMP
END-IF
ELSE
PUT OUTFILE FROM SSAOUT
END-IF
GO TO JOB
END-IF

IF SSAOUT
PUT OUTFILE FROM SSAOUT
GO TO JOB
END-IF

IF SSADUMP
GO TO JOB
END-IF

Thank you
Val
Back to top
View user's profile Send private message

Nighthawk750

New User


Joined: 04 Nov 2006
Posts: 20
Location: Amsterdam

PostPosted: Mon Jan 15, 2007 7:22 pm    Post subject:
Reply with quote

You do not need to to use the IF duplicate option. That is only needed when you want to do something special with the duplicates. The IF MATCHED is sufficient.

Also, try avoiding GOTOs. If you code your Easytrieve well, there is no need for GOTOs, especially not when using Synchronized File Processing.
And another general piece of advice when typing in code: between IF statements (or DO-While loops of some sort), jump in 3 spaces. when reading the code it is more clear to what is happening.
E.g.: IF condition
do something
IF other condition
do something
ELSE
whatever
END-IF
END-IF
Back to top
View user's profile Send private message
Nighthawk750

New User


Joined: 04 Nov 2006
Posts: 20
Location: Amsterdam

PostPosted: Mon Jan 15, 2007 7:26 pm    Post subject:
Reply with quote

Nighthawk750 wrote:


And another general piece of advice when typing in code: between IF statements (or DO-While loops of some sort), jump in 3 spaces. when reading the code it is more clear to what is happening.
E.g.: IF condition
do something
IF other condition
do something
ELSE
whatever
END-IF
END-IF


hmmmm....it seems this form does not support SPACES very well......
my example is not outlined correctly; I looked ok when I typed it.....
forget my remark about jumping in 3 spaces icon_biggrin.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Jan 15, 2007 7:49 pm    Post subject:
Reply with quote

Nighthawk750 wrote:

Code:
E.g.:  IF condition
             do something
             IF other condition
                 do something
             ELSE
                 whatever
             END-IF
          END-IF

You managed to "quote" it, what you should have done waas to "code" it......
Back to top
View user's profile Send private message
Nighthawk750

New User


Joined: 04 Nov 2006
Posts: 20
Location: Amsterdam

PostPosted: Mon Jan 15, 2007 8:37 pm    Post subject:
Reply with quote

oops..... icon_redface.gif sorry...
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 -> 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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm


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