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
 

 

How to Compare 2 files and write

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
anish.ibm

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Thu Jul 12, 2007 11:01 am    Post subject: How to Compare 2 files and write
Reply with quote

Hi all,

Need your help

I have 2 files ...

FILE A and FILE B . Here the data in column 36 to 40 is same in both the files for all the rows. I have to compare both the files column # 36 - 40
if it is same ,i have to pick the data from column # 45 to 50 from FILE A and write to same position i.e. 45 to 50 in FILEB .
Back to top
View user's profile Send private message

ParagChouguley

Active User


Joined: 03 Feb 2007
Posts: 175
Location: PUNE(INDIA)

PostPosted: Thu Jul 12, 2007 11:27 am    Post subject:
Reply with quote

Check this link

http://www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

--Parag
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Thu Jul 12, 2007 1:01 pm    Post subject:
Reply with quote

anish.ibm
Check for the topic Create files with matching and non-matching records, at the link suggested by ParagChouguley
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Jul 12, 2007 8:36 pm    Post subject:
Reply with quote

anish,

The Smart DFSORT Trick mentioned is a general approach for creating three different output files. While it can be adapted to othe situations, some people on this list seem to think it's the solution for every matching problem - it isn't. Simpler solutions are possible for some situations.

If you can adapt the trick yourself - fine. If you need more help, show an example of the records in each input file (relevant fields only) and what you expect for output. Give the RECFM and LRECL of your input files. If FileA can have duplicates within it, show that in your example. If FileB can have duplicate within it, show that in your example.
Back to top
View user's profile Send private message
anish.ibm

New User


Joined: 28 Jun 2007
Posts: 23
Location: Bangalore

PostPosted: Fri Jul 13, 2007 11:49 am    Post subject:
Reply with quote

Hi All ,

Thq i got the solution from the link
Back to top
View user's profile Send private message
sandy_mcs

New User


Joined: 01 Apr 2006
Posts: 17
Location: Pune

PostPosted: Fri Jul 13, 2007 12:12 pm    Post subject: FORMATTING OUTREC FIELDS-Urgent Please
Reply with quote

Hi all,
My Case : i have one file which have only one record at a time... from that record line i want 32 to 39 bytes which is a date in MMDDYYYY format...using below code(considered up till now)
OUTREC FIELDS=(1:32,2,4:34,2,7:36,4)
but the thing is i want to write this date in output file as MM-DD-YYYY
Now please suggest how could i place the '-' (hypens) in 3rd and 6th positions...
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Fri Jul 13, 2007 12:23 pm    Post subject:
Reply with quote

sandy_mcs
Change your outrec to
Code:
  OUTREC BUILD=(32,2,C'-',34,2,C'-',36,4,C'-')
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jul 13, 2007 8:38 pm    Post subject:
Reply with quote

You wouldn't want the third hypen shown. It should be:

Code:

   OUTREC BUILD=(32,2,C'-',34,2,C'-',36,4)


Another way to do it would be to use:

Code:

   OUTREC BUILD=(32,8,ZD,EDIT=(TT-TT-TTTT))
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 -> DFSORT/ICETOOL 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 Dynamic split of files under groups sril.krishy DFSORT/ICETOOL 4 Mon Apr 17, 2017 1:09 pm
No new posts Compare two files and subtract values ameetmund DFSORT/ICETOOL 7 Fri Mar 31, 2017 3:35 pm


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