#1: DB2 Decimal to easytrieve eq'lant variable. Author: naren_ab, Posted: Mon Jan 27, 2003 11:08 am 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
#2: Author: kolusu, Location: San JosePosted: Mon Jan 27, 2003 12:37 pm 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
#3: Author: naren_ab, Posted: Thu Jan 30, 2003 5:35 pm Thanks a bunch..