I have the two i/p files. The i/p file one contains data like this
Code:
INPUT 1(has two variables)
**********************
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 6528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511
Code:
Input 2
**********
3623170671
3163818150
The logic should write two out put file
like the matching records with type 'c' should write the succesive 'D' records in o/p
Code:
OUTPUT 1(MATCHED RECORDS)
**************
C 3623170671
D 00000001500011018
C 3163818150
D 00000003130789502
D 9892511511
Code:
OUTPUT 2(Unmatched records)
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 00000000095618996
D 00000006020170210
C 6528627877
D 00000000003365018
This is just the sample i/p files i have 150000000(i/p 1) records
to match 235000(i/p2) reords.
i didnot know how to explain this in words so given the example i/p and o/p.
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes. The job uses DFSORT's new WHEN=GROUP function available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you don't have that PTF, ask your System Programmer to install it (it's free).
FROM(T1) - Tells DFSORT that input to the splice operation is T1 dataset which contains the reformated records from file1.
KEEPNODUPS - Tells DFSORT to keep records that are not spliced.
TO - for the destination dataset
ON(83,10,CH) - 10 bytes starting from position 83 is used for matching. The first record for each matching ON field will act as the base record to which the second record is spliced.
WITH - Fields specified here would be spliced.
WITHALL - tells SPLICE to splice the first record with every other record for which the ON fields match. Without withall, only the first and last are spliced.
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
Narasimha,
I have just given a generic explanation of what the command does and not specific to your requirement. You will have to probe further to get the exact logic or wait for FRANK.
I am geting the 2 output files but they are giving the o/p
for all items that are matcing the account number with 'D' Type also
I am giving the exmaple of i/p and output here
Input (IN1)
Code:
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 6528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511
Input (IN2)
Code:
3623170671
3163818150
9892511511
9892511514
Output(OUT1 Matched)
D 9892511514
C 3623170671
C 3163818150
D 9892511511
Output(OUT2 Unmatched)
Code:
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3138299197
D 9892511521
D 00000000095618996
D 00000006020170210
D 00000001500011018
C 6528627877
D 00000000003365018
D 00000003130789502
The previous task is completed and i have been given a new task repeting the similar way.
Here is the explanation.
With the ouput i got for previous task (OUT2 i.e., the non matched items) I have to seperate the account numbers greater than 10 digit to seperate file (should not miss the pericular debits for that account )
Here is the example i/p
INPUT
Code:
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 006528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511
OUTPUT file1(WTIH ACCOUNT NUMBER <= 10DIGITS)
Code:
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 3623170671
D 00000001500011018
C 3163818150
D 00000003130789502
D 9892511511
OUTPUT file2(WTIH ACCOUNT NUMBER > 10DIGITS)
Code:
C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 006528627877
D 00000000003365018
sorry i have misplced the task. Actually i need to seperate the account numbers of lenght = 11 ( 'C' type followed by debits'D' type) into one file and other account numbers may be of lenght 10 or >11 to one file.
The above code is working fine for previously mentiond one but little confused with specific account numbers with lenght = 11
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 006528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511
C 11111111111
D 00000000000000001
C 22222222222
D 00000000000000002
D 0000000003
OUT1 would have:
Code:
C 11111111111
D 00000000000000001
C 22222222222
D 00000000000000002
D 0000000003
OUT2 would have:
Code:
C 8249032544
D 1101646578
D 00000000030256200
D 00000000300953874
C 003138299197
D 9892511514
D 9892511521
D 00000000095618996
D 00000006020170210
C 3623170671
D 00000001500011018
C 006528627877
D 00000000003365018
C 3163818150
D 00000003130789502
D 9892511511