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 2 files & write Indicator at last using JCL utility

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
View previous topic :: :: View next topic  
Author Message
nagendrapgupta

New User


Joined: 12 Apr 2007
Posts: 2
Location: mysore

PostPosted: Sun May 15, 2016 10:42 am    Post subject: Compare 2 files & write Indicator at last using JCL utility
Reply with quote

Hi,

Please help!!

There are two flat , fixed length files of 270 bytes InFile1 and InFile2.
The key fields are from 1 to 20 bytes.(first 20 bytes of the file)

I need to compare these two Fixed length files and produce a Output flat file of 271 bytes using IBM JCL utilities. The last byte can have values 'I', 'U' or 'D' for Insert or update or delete.

We have only SYNCSORT

Conditions:
1. If the record is in InFile1 and not in InFile2, then the out put file OutFile1 should have the record of InFile1 and at last with one byte Indicator 'I'.

2. If the record is present in both InFile1 and InFile2 but there is a change in the values then the complete record of Infile1 should be written to OutFile1 and at last with one byte Indicator 'U'

3. If the record is present in InFile1 but not present in InFile2, then the complete record of Infile1 should be written to OutFile1 and at last with one byte Indicator 'D'

4. If there is complete match of records of Infile1 and Infile2 , then skip the record.
Back to top
View user's profile Send private message

prino

Active Member


Joined: 07 Feb 2009
Posts: 982
Location: Oostende, Belgium

PostPosted: Sun May 15, 2016 1:05 pm    Post subject:
Reply with quote

And where are you stuck?

Oh, you want us to do your work for you? Be aware that most people here charge from USD/EUR 200 per hour upwards, usually with a minimum of one day.

And why the flipping 'ell do you post in a DFSORT forum if you only have Syncsort?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Sun May 15, 2016 1:06 pm    Post subject: Reply to: Compare 2 files & write Indicator at last using JCL utility
Reply with quote

Your 3 looks very similar to your 1.

Please be careful with terminology. It can be vital to know the different between a file and a record.

Can you have duplicate keys within either file? If so, how do you want those dealt with?

What version of SyncSORT do you have?
Back to top
View user's profile Send private message
nagendrapgupta

New User


Joined: 12 Apr 2007
Posts: 2
Location: mysore

PostPosted: Sun May 15, 2016 1:46 pm    Post subject: Reply to: Compare 2 files & write Indicator at last using JCL utility
Reply with quote

Hi Prino, Sorry .. Had a short deadline..my bad...


Hi Bill,

Point 3 should be...
If the record is not present in Infile1 and present in Infile2 then the output record from Infile2 should be written to Outfile1 and last byte should be 'D'...

The files will not have duplicate records..
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Sun May 15, 2016 2:00 pm    Post subject: Reply to: Compare 2 files & write Indicator at last using JCL utility
Reply with quote

Quote:
We have only SYNCSORT

if You have SYNCSORT why did You post in the IBM DFSORT section ?

topic moved
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon May 16, 2016 4:28 am    Post subject:
Reply with quote

Look for join keys and the parameter marker values and based on that you use IFTHEN WHEN condition and build with I/U/D. add OMIT condition when the value is B.
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 -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm


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