View previous topic :: View next topic
|
Author |
Message |
zavedali85
New User
Joined: 17 Oct 2008 Posts: 10 Location: Pune
|
|
|
|
I have two files File A and File B (both have recfm VB).
The files are to be matched on hex values at position 10 (length is 6) from File A and at position 5 (length 6) from File B .If match found then extract the File A record that matches File B in a separate File C.
The File Data looks as below:
File A (Hex on):
ABCRFGFT1
F454F786A034000
78677887F00010C
File B (Hex on):
DEFR
342F034000
567400010C
Output File C:
ABCRFGFT1
F454F786A034000
78677887F00010C
Please suggest how to obtain. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Why have you chosen to call these "hex'? The data appears to simply be packed-decimal (comp-3 to cobol people).
Are both files already in sequence by this field?
What about negative values? Might there be 'F' signs as well as 'C' signs in the field(s)? |
|
Back to top |
|
|
zavedali85
New User
Joined: 17 Oct 2008 Posts: 10 Location: Pune
|
|
|
|
Hi,
The field is at position 10 in File A and at position 5 in File B.
Also the field is Positive signed Packed Decimal. |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Hi zavedali85,
I am assuming this is what your requirement
Code: |
//SORTJNF1 DD *
7çîå7ÌhÅ®.. ...
//*
//SORTJNF2 DD *
.ã.4.. ...
//*
//SORTOUT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//*
//SYSIN DD *
JOINKEYS FILES=F1,FIELDS=(10,6,A)
JOINKEYS FILES=F2,FIELDS=(5,6,A)
SORT FIELDS=COPY
REFORMAT FIELDS=(F1:1,20)
|
|
|
Back to top |
|
|
|