I have a huge file containing 250000 records(File-1) also there are duplicate a/c no in this and second file containing records 2000(File-1). I have to make sure that records present in File-1 having a match with the records present in File-2 to be written into the output file. (i.e all the matched records from file-2 are to be written)
Field on which match is to be performed is :
File-1 : Position 18 - CH
File-2 : Position 18 - CH
Here are the control cards I have used :
File -1 containing records 250000 :-
Code: CTL1
INREC OVERLAY=(35:C'11')
File -2 containing 2000 records
Code: CTL2
INREC OVERLAY=(35:C'22')
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
Naraismha,
Nelson's job was missing BUILD=(1,34) on the OUTFIL statement, so I updated his post to add it. When I run his job with your input, it gives your desired output. So either "your" input is not what you showed here, or your version of Nelson's job is different than Nelson's version.
If your input is the same as you posted here, then post the complete JCL and control statements that YOU used.
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Please re-post your info using copy/paste and the "Code" tag. Many of the people who provide answers here are not permitted to download atachments. Once the material is copied/pasted into the reply editor, use the "Code" tag for readability/alignment. Use Preview to see how your post will appear to the forum rather than how it appears in the reply editor.
When you are satisfied with the how the post looks, Submit.
Screenshots should also not be used - they are deleted.
----+----1----+----2----+----3----
*********************************
.... ........ C 0000000000
.Ý ´ .......* C 00000000000
.Ý { ........ C 00000000000
.v¬² ........ C 0000000012
.vÎ. ......&. C 0000000078
..H§ .....Â.. C 0000000100
..H§ .....Â.. C 0000000100
..HÝ .....Â.. C 0000000100
..HÝ .....Â.. C 0000000100
..H´ .....Â.. C 0000000100
..H´ .....Â.. C 0000000100
..ôë .....Â.. C 0000000100
..ôë .....Â.. C 0000000100
.uÕ. ........ C 0000000123
...T .....fÃ% C 0000001234
...T .....fÃ% C 0000001234
.vɾ ....Ââ % C 0000001363
.vË{ .....ÎÎ* C 0000002284
.vÁ. ......&. C 0000002444
..¯ñ .....Ëqæ C 0000010313
..¯. ......ïð C 0000010313
..¯( ......Ç@ C 0000010313
..]~ .....bä. C 0000010313
.vËE .....bä. C 0000010313
..¯. .......* C 0000012345
..¯. .......* C 0000012345
..¯ä .......* C 0000012345
..¯¾ .......< C 0000012345
..¯A ...&...* C 0000012345
----+----1----+----2----+----3----
*********************************
.vÎ. ......&. C 0000000078
.vË{ .....ÎÎ* C 0000002284
..¯ñ .....Ëqæ C 0000010313
..¯. ......ïð C 0000010313
..¯( ......Ç@ C 0000010313
..]~ .....bä. C 0000010313
----+----1----+----2----+----3----
*********************************
.vÎ. ......&. C 0000000078
.vË{ .....ÎÎ* C 0000002284
..¯ñ .....Ëqæ C 0000010313
..¯. ......ïð C 0000010313
..¯( ......Ç@ C 0000010313
..]~ .....bä. C 0000010313
using the same input in the similar way can we get write the unmatched items to another output file
like the output file should be
Code:
----+----1----+----2----+----3----
*********************************
.... ........ C 0000000000
.Ý ´ .......* C 00000000000
.Ý { ........ C 00000000000
.v¬² ........ C 0000000012
..H§ .....Â.. C 0000000100
..H§ .....Â.. C 0000000100
..HÝ .....Â.. C 0000000100
..HÝ .....Â.. C 0000000100
..H´ .....Â.. C 0000000100
..H´ .....Â.. C 0000000100
..ôë .....Â.. C 0000000100
..ôë .....Â.. C 0000000100
.uÕ. ........ C 0000000123
...T .....fÃ% C 0000001234
...T .....fÃ% C 0000001234
.vɾ ....Ââ % C 0000001363
.vÁ. ......&. C 0000002444
..¯. .......* C 0000012345
..¯. .......* C 0000012345
..¯ä .......* C 0000012345
..¯¾ .......< C 0000012345
..¯A ...&...* C 0000012345
can this logic be written in the same job
i.e, wrting both matched and unmatched recordsto be written in output using the same input files
With the current output we got can we write the count of dulicates at the end (adding one more column for the count)
The output required :
out12
Code:
----+----1----+----2----+----3------
*********************************
.vÎ. ......&. C 0000000078
.vË{ .....ÎÎ* C 0000002284
..]~ .....bä. C 0000010313 04
out22
Code:
----+----1----+----2----+----3------
*********************************
.... ........ C 0000000000 03
.v¬² ........ C 0000000012 01
..ôë .....Â.. C 0000000100 07
.uÕ. ........ C 0000000123 01
...T .....fÃ% C 0000001234 02
.vɾ ....Ââ % C 0000001363 01
.vÁ. ......&. C 0000002444 01
..¯. .......* C 0000012345 05
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Naraismha Reddy,
Did you want to show spaces if there is only 1 record per key in OUT12? Also you have 5 records for key 0000010313 in file 1 and yet you show only 4 as duplicate count. So the first key record is not considered as dup? If that is true then Change your CTL3CNTL control cards to the following which will give you the desired results.
Thanks for the perfect control card.
It worked fine.
i have got the required output
Out12
Code:
----+----1----+----2----+----3------
*********************************
.vÎ. ......&. C 0000000078
.vË{ .....ÎÎ* C 0000002284
..]~ .....bä. C 0000010313 04
Out22
Code:
----+----1----+----2----+----3------
*********************************
.... ........ C 0000000000 03
.v¬² ........ C 0000000012 01
..ôë .....Â.. C 0000000100 07
.uÕ. ........ C 0000000123 01
...T .....fÃ% C 0000001234 02
.vɾ ....Ââ % C 0000001363 01
.vÁ. ......&. C 0000002444 01
..¯. .......* C 0000012345 05