View previous topic :: View next topic
|
Author |
Message |
scdinesh
New User
Joined: 06 Sep 2006 Posts: 44 Location: United States
|
|
|
|
Hi,
Please help me the syntax for Joinkeys with decimal
File1 ...length 116 FB with keys at starting position 7(Decimal 11)
File2 ...length 46 FB with keys at starting position 15(Decimal 11)
I need to match both this files on above keys and write output as ( complete records from file1(length:116) and on file2: starting position 5(Decimal 18)).
Please help with syntax. Thanks |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
It doesn't matter if the keys are decimal, it only matters that they are the same length, and the same data-type. The comparison is "match or not", the convention used to represent a value by a particular bit-setting is irrelevant.
The comparisons are effectively BI or CH, but that makes no difference to anything. Your JOINKEYS will work fine with "decimal" values as the keys. Whatever it is the "decimal" means to you. It just doesn't matter for the JOINKEYS, which just needs match or not. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2010 Location: USA
|
|
|
|
The key fields from JOINKEYS statements are considered as hexadecimal strings of the same length, since only comparison on EQUAL are performed to join keys.
"Decimal 11" fields have the length ((11 + 1) % 2) = 6 bytes
You must code
JOINKEYS ...FIELDS=(7,11,A)
JOINKEYS ...FIELDS=(15,11,A)
(Option "A" is ignored unless SORTED is specified) |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What do you mean the A is ignored unless SORTED is specified?
SORTED tells DFSORT that the data is already in sequence, so the sub-task can run a COPY operation.
Even then the A is still relevant, as unless NOSEQCK is specified, there is sequence checking, for which you need to know whether the sequence is A(scending) or D(escending).
If you don't specify SORTED, the A (or D) is 100% and utterly vital. If you are going to SORT something, you need to know the "direction". |
|
Back to top |
|
|
|