Joinkeys with decimal

Author Message
scdinesh
Warnings : 1

New User

Joined: 06 Sep 2006
Posts: 40
Location: United States

 Posted: Fri Feb 10, 2017 4:46 am 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
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

 Posted: Fri Feb 10, 2017 6:18 am 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.
sergeyken

Active Member

Joined: 29 Apr 2008
Posts: 931
Location: Maryland

 Posted: Sat Feb 11, 2017 2:43 am 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)
Bill Woodger

Moderator Emeritus

Joined: 09 Mar 2011
Posts: 7311
Location: Inside the Matrix

 Posted: Sat Feb 11, 2017 4:34 am 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".
 View Bookmarks All times are GMT + 6 Hours

 Topic Forum Replies Similar Topics How can we simulate JOINKEYS in ICETOOL DFSORT/ICETOOL 9 HOW TO OVERLAY A Packed decimal VALUE... DFSORT/ICETOOL 5 JOINKEYS to match two input files on ... DFSORT/ICETOOL 3 To convert numeric to Packed Decimal DFSORT/ICETOOL 9 Convert a packed decimal value to zon... DB2 6
Search our Forums: