IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

comparison of data in two files.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Tue Oct 27, 2009 12:47 am
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
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 Developer


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

PostPosted: Tue Oct 27, 2009 3:23 am
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
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

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Oct 27, 2009 7:47 pm
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 All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Joining files with intermittent heade... SYNCSORT 1
No new posts Format data from multiple records usi... SYNCSORT 4
No new posts INPFIL FILES, FNAMES examples SYNCSORT 7
No new posts FileAid move data from two files to o... Compuware & Other Tools 5
No new posts Structured Data and Nested Loops via ... COBOL Programming 0
Search our Forums:


Back to Top