MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

DB2 Decimal to easytrieve eq'lant variable.

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
naren_ab
Beginner


Joined: 07 Jan 2003
Posts: 32
Topics: 10

PostPosted: Mon Jan 27, 2003 11:08 am    Post subject: DB2 Decimal to easytrieve eq'lant variable. Reply with quote

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
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12370
Topics: 75
Location: San Jose

PostPosted: Mon Jan 27, 2003 12:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail Visit poster's website
naren_ab
Beginner


Joined: 07 Jan 2003
Posts: 32
Topics: 10

PostPosted: Thu Jan 30, 2003 5:35 pm    Post subject: Reply with quote

Thanks a bunch.. Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group