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
 

 

comparison of data in two files.

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

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Mon Oct 26, 2009 11:31 pm    Post subject: comparison of data in two files.
Reply with quote

I have two files in this format

1. File 1

01101 XXXXX
01102 YYYYY
01103 BBBB

2. File 2

01102 ....................
01103 ....................

In file 2, the first 6 chars are hexadecimal.
My requirement is if that if the first 6 chars in file 1 match with file 2,
then I need to add an indicator at the last position.

Output

01101 XXXXX N
01102 YYYYY Y
01103 BBBB Y

Can someone help me on this?
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: Tue Oct 27, 2009 12:47 am    Post subject:
Reply with quote

Quote:
My requirement is if that if the first 6 chars in file 1 match with file 2, then I need to add an indicator at the last position.


It actually looks like you're adding an indicator in either case (N for no match and Y for a match) - right?

Quote:
In file 2, the first 6 chars are hexadecimal.


So in file2, are those first 6 chars are in 3 bytes (X'011101')?

In file1, are the first 6 characters actually characters (C'011101') or are they also hex?

What is the RECFM and LRECL of each input file?

What is the starting position, length and format of each field?

Can file1 have duplicates within it?

Can file2 have duplicates within it?

Can file 1 have a match value that is not in file2?

Can file2 have a match value that is not in file1?

Please show a better example of the records in each input file and what you expect for output with all possible variations.
Back to top
View user's profile Send private message
itmanand

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Tue Oct 27, 2009 1:13 am    Post subject:
Reply with quote

The length of both files is 80 bytes, FB.
1. Both file 1 and file 2 can have duplicates.
2. It's basically like this. Write file 1 to output. If the first 6 bytes in file 1 are available in file 2, then put indicator as Y, else N.

3. In file 1, the first 6 chars are decimal. In file 2, it's hexadecimal.
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: Tue Oct 27, 2009 3:23 am    Post subject:
Reply with quote

Quote:
1. Both file 1 and file 2 can have duplicates.
2. It's basically like this. Write file 1 to output. If the first 6 bytes in file 1 are available in file 2, then put indicator as Y, else N.


Just to be sure we are on the same page, I need to see an example of input and output where both files have duplicates and nonduplicates in various combinations. For example, if the input files had these records:

Code:

File 1

01101 XXXXX
01101 QQQQQ
01102 YYYYY
01103 BBBB
01104 CCCC
01104 DDDD
01105 EEEE
01108 FFFF
01108 GGGG
01108 HHHH

File 2

01102 ....................
01103 ....................
01103 ....................
01104 ....................
01104 ....................
01106 ....................
01107 ....................
01107 ....................
01108 ....................
01108 ....................


What would the expected output be?
Back to top
View user's profile Send private message
itmanand

New User


Joined: 18 Dec 2008
Posts: 24
Location: Newyork

PostPosted: Tue Oct 27, 2009 8:18 am    Post subject:
Reply with quote

The output should be file 1 with Y or N at the end.
Y - If the first 6 bytes(decimal) in file 1 matches with first 6 bytes(hexadecimal) in file 2.

N - If the first 6 bytes(decimal) in file 1 not found in file 2.
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: Tue Oct 27, 2009 7:47 pm    Post subject:
Reply with quote

Hello,

Post the actual output using the sample data provided. . .
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 Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2: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 Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts unload data from table with lob columns farhad_evan DB2 0 Sat Apr 22, 2017 1:32 pm


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