View previous topic :: View next topic |
Author |
Message |
naren_ab Beginner
Joined: 07 Jan 2003 Posts: 32 Topics: 10
|
Posted: Mon Jan 27, 2003 11:08 am Post subject: DB2 Decimal to easytrieve eq'lant variable. |
|
|
Hi, can anyone tell me, what should be the datatype used for a varibale in easytrieve so that it can take decimal value from DB2 table. and also let me know, how can i suppress leading zeroes.
I tried to use N, A, in easytrieve did not help me much also i tried to mask.
still no luck.
Thanx |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Mon Jan 27, 2003 12:37 pm Post subject: |
|
|
Naren_ab,
If the column on db2 table is defined as
COL1 DECIMAL(11,02)
Then the equivalent cobol declaration is
COBOL-COL PIC S9(9)V9(2) USAGE COMP-3.
similarly the equivalent easytrieve declaration is
EZT-COL 006 P 2
S9(9)v9(2) occupies a total 6 ( 9 + 2 + 1 sign / 2)
so in easytrieve you define it as total of 6 bytes with type "P" (packed) and with 2 for decimals. if you don't have any decimals then define it as 0
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
naren_ab Beginner
Joined: 07 Jan 2003 Posts: 32 Topics: 10
|
Posted: Thu Jan 30, 2003 5:35 pm Post subject: |
|
|
Thanks a bunch.. |
|
Back to top |
|
|
|
|