View previous topic :: View next topic |
Author |
Message |
new user Beginner
Joined: 12 Oct 2004 Posts: 7 Topics: 3
|
Posted: Fri Oct 15, 2004 12:28 pm Post subject: populating SMALLINT |
|
|
Hi
i have a sequential file of 80 bytes (FB). i am adding a identifier field of length 1 (which takes value 1,2) at position 81 using DFSORT and finally loading the values to a DB2 table.
The hardcoded identifier field should populate a column of type SMALLINT in the table.As SMALLINT is equivalent to PIC S9(4) COMP, the hardcoded value needs to be the binary equivalent of the identifier.
In that case, the OUTREC card should look something like
OUTREC = (1:1,80,81: B'10')
but it is not giving me the desired result in the table.
Thanks
-new user |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Oct 15, 2004 1:29 pm Post subject: |
|
|
Try this
S9(04) comp is 2 bytes in length. so if you want to move 1 in that field, the following sort card gives you the desired result.
Code: |
OUTREC FIELDS=(1:1,80,81:X'0001')
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Frank Yaeger Sort Forum Moderator

Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
|
Posted: Fri Oct 15, 2004 2:22 pm Post subject: |
|
|
Here's another way to do it with DFSORT:
Code: |
OPTION COPY
OUTREC FIELDS=(1,80,81:+1,TO=BI,LENGTH=2)
|
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort |
|
Back to top |
|
 |
new user Beginner
Joined: 12 Oct 2004 Posts: 7 Topics: 3
|
Posted: Mon Oct 18, 2004 9:49 am Post subject: |
|
|
Thanks a lot Frank and Kolusu.
it really helped
Regards
-new user |
|
Back to top |
|
 |
|
|