View previous topic :: View next topic
|
Author |
Message |
baljinders
New User
Joined: 21 Aug 2006 Posts: 72
|
|
|
|
Hi All,
I am facing the below problem and not able to figure out the reason for this.
Field A of lenght starts from byte 1313
Field B of lenght 12 starts from where field A ends.
Alternate key 1 = field A
Alternate key 2 = Field A + B
when i create alternate index 1 with key field as (4,1313) , the 1st byte of the field gets truncated.
say it becomes BCD
but if i change it to (4,1312) , the field is correctly dislayed.
say ABCD
My primary key is of lenght 6 bytes and key field was defined as (6,0).
This is how the copybook fields appear when i check them in FA.
Code: |
--------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START END LENGTH
5 FILLER X(100) 22 1213 1312 100
5 Field A X(4) 23 1313 1316 4
5 Field B X(12) 24 1317 1328 12 |
what can be the problem here ? |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
When you define the key position (for both primary and alternate keys), you use the OFFSET -- which starts at zero. The 1313th byte of the file is at offset 1312. Hence your truncation. |
|
Back to top |
|
|
baljinders
New User
Joined: 21 Aug 2006 Posts: 72
|
|
|
|
Thanks Robert,
That clears my doubt. |
|
Back to top |
|
|
|