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

Compare Two files of different LRECL


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Wed Feb 11, 2009 9:47 pm
Reply with quote

I want to compare 2 files with different LRECL. For ex: File A with 132 and File B with 4064 bytes and have to write the o/p with unique records in File C with 4064. Could anyone suggest me the betterway to do 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: Wed Feb 11, 2009 11:13 pm
Reply with quote

You haven't given enough information for anyone to help you.

Show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example. Give the starting position, length and format of all relevant fields (e.g. the field or fields you want to compare on).
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Fri Feb 13, 2009 10:55 am
Reply with quote

Hi,

My file A:

XXX#XXX#X#X#XXXXJobname1 NOEX002Owner XXX#XXX#X#XXXXX XXX 980404
YYY#YYY#Y#Y#YYYYJobname2NOEX005Owner YYY#YYY#Y#YYYY YYY 980718


File B:

Jobname1.ð....AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE FFFFFFFF .......................
Jobname2......GGGGGGGG HHHHHHHH IIIIIIII JJJJJJJJ ..............

These are my I/P files. My compare key is Jobname. If the same Jobname exist in both the files i want to filter both rows from the i/p files as shown in below:

Jobname1 XXX#XXX#X#X#XXXX NOEX002Owner XXX#XXX#X#XXXXX XXX 980404 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE FFFFFFFF .......................

Jobname2 YYY#YYY#Y#Y#YYYY NOEX005Owner YYY#YYY#Y#YYYY YYY 980718 GGGGGGGG HHHHHHHH IIIIIIII JJJJJJJJ ..............

Without Duplicates. Thanks for ur help in advance.
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: Fri Feb 13, 2009 9:27 pm
Reply with quote

You mean if both files have the same Jobname, you want to construct a new output record consisting of the Jobname, the data from file1 and the data from file2?

What is the RECFM and LRECL of the input file?

What do you want for the RECFM and LRECL of the output file?

Is the Jobname in positions 1-8 of each input file?

Can file1 have a Jobname that is not in file2? 1? Can file2 have a Jobname that is not in file1? If so, please show a better input example with those variations and what you expect for output.
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Fri Feb 13, 2009 10:44 pm
Reply with quote

File A:

RECFM: FB , LRECL: 80

Job name starts from position: 17-24

File B:

RECFM: FB , LRECL: 4064

Job name starts from position: 1-8

Yes. Both the files have match/unmatch records too. I want to filter only the records matching and also with out duplicates.
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: Fri Feb 13, 2009 11:16 pm
Reply with quote

Quote:
I want to filter only the records matching and also with out duplicates.


I'm not sure what you mean by this.

By "I want to filter only the records matching", do you mean you want the joined matching records in the output file? Or do you mean something else?

What do you mean by "and also with out duplicates"? Do you mean you don't want non-matching records in the output file? Or do you mean you something else?

To make it clear what you want, show me the output you expect for these input records (please ubb code tags):

File A:

Code:

XXX#XXX#X#X#XXXXJobname1 NOEX002Owner XXX#XXX#X#XXXXX XXX 980404
YYY#YYY#Y#Y#YYYYJobname2 NOEX005Owner YYY#YYY#Y#YYYYY YYY 980718
XXX#XXX#X#X#XXXXJobname3 NOEX006Owner XXX#XXX#X#XXXXX XXX 980404


File B:

Code:

Jobname1.ð....AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE FFFFFFFF .......................
Jobname2......GGGGGGGG HHHHHHHH IIIIIIII JJJJJJJJ ..............
Jobname4......KKKKKKK
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Mon Feb 16, 2009 12:25 pm
Reply with quote

Hi Frank,

I need only the matching records. As per your i/p, i want to get the o/p should be

jobname1 XXX#XXX#X#X#XXXX NOEX002Owner XXX#XXX#X#XXXXX XXX 980404 AAAAAAAA BBBBBBBB CCCCCCCC DDDDDDDD EEEEEEEE FFFFFFFF .......................
Jobname2 YYY#YYY#Y#Y#YYYY NOEX005Owner YYY#YYY#Y#YYYY YYY 980718 GGGGGGGG HHHHHHHH IIIIIIII JJJJJJJJ ..............
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: Mon Feb 16, 2009 11:02 pm
Reply with quote

Here's a DFSORT/ICETOOL job that will do what I think you asked for:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/80)
//IN2 DD DSN=...  input file2 (FB/4064)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/4136)
//TOOLIN DD *
COPY FROM(IN1) TO(T1) USING(CTL1)
COPY FROM(IN2) TO(T1) USING(CTL2)
SPLICE FROM(T1) TO(OUT) ON(1,8,CH) WITH(81,4056)
/*
//CTL1CNTL DD *
  INREC BUILD=(1:17,8,1,16,25,56,4136:X)
/*
//CTL2CNTL DD *
  INREC BUILD=(1:1,8,81:9,4056)
/*
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Thu Feb 19, 2009 6:15 pm
Reply with quote

Hi Frank,

Thank You So Much. It's Working Fine.

But,

1. I got some Duplicate Jobs in the o/p file.

2. At the end of file i got some jobs which is not there in 2nd file, but present in 1 file.

Other than these i got the o/p in the same format.

Thanks,
Back to top
View user's profile Send private message
Meena Chandran

New User


Joined: 28 Dec 2007
Posts: 13
Location: Chennai

PostPosted: Thu Feb 19, 2009 7:58 pm
Reply with quote

Hi Frank,

Could you help me to remove the below discrepancies also?

1. Removing Duplicates

2. At the end of file i got some jobs which is not there in 2nd file, but present in 1 file.


Thanks,
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: Thu Feb 19, 2009 10:25 pm
Reply with quote

Sigh. In my first post I said

Quote:
Show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example.


I specifically asked you to show duplicates in the example if you could have duplicates. You didn't so I gave you a solution based on that assumption. Now you come back and say you have duplicates and "it doesn't work". Well, big surprise.

So once again:

Quote:
Show an example of the records in each input file (relevant fields only) and what you expect for output. If input file1 can have duplicates within it, show that in your example. If input file2 can have duplicates within it, show that in your example.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Write line by line from two files DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts Merge two VSAM KSDS files into third ... JCL & VSAM 6
No new posts Joinkeys - 5 output files DFSORT/ICETOOL 7
Search our Forums:

Back to Top