View previous topic :: View next topic
|
Author |
Message |
vimalravi83
New User
Joined: 28 Feb 2010 Posts: 21 Location: Bloomington, IL
|
|
|
|
Hello All,
I have a requirement to compare two files and extract records from File1.Details are below;
I have two files; File1 and File2.
File1, 80 length, FB
--------------------
Code: |
HDR111
0112345P88888888 XXXA
02DGG839
02KHH452
TLR111
HDR222
0183344G77777777 TTTA
02FFK839
02LPW452
TLR222
HDR333
0183921B44444444 KKKN
02GFF839
02RER452
TLR333
|
File2(Report format), 133 length,FBA
-------------------------------------------
Code: |
******************REPORT-ID**********************
*************************************************
EMP-ID DEPT-ID STATUS
------ ------- ------
77777777 83344 A
|
File1 contains blocks of data, where each block has its own header and trailer records. After comparing File1 and File2, I need to extract block of records from File1.
For eg: in this case, EMP-ID(77777777, starting at 5th position, Len=8) DEPT-ID(83344, starting at 20th position, Len=5) and STATUS(A,starting at 30th position, Len=1) is matching with second set of block data in File1(01 format data). So output file should be as below(same format as File1)
Output
-------
Code: |
HDR222
0183344 77777777 TTTA
02FFK839
02LPW452
TLR222 |
We don't have SORT JOINKEY facility installed and I tried with ICETOOL by putting them together after proper formatting and then using FIRSTDUP but didn't work since it's a block of records I need to extract. Could anyone help me?
Code'd |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
Back to top |
|
|
vimalravi83
New User
Joined: 28 Feb 2010 Posts: 21 Location: Bloomington, IL
|
|
|
|
In one of my ICETOOL joblog, I see below message ;
ICE201I 0 RECORD TYPE IS F. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Unfortunately that either means you are up-to-date or extremely old.
Since JOINKEYS does not work for you (are you sure? please post what you tried, the entire sysout) it would look like you are way out of date. And, if so, out of luck. Write a program. |
|
Back to top |
|
|
|