IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Declaring DB2 float variables in Easytrieve


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
gvel19

New User


Joined: 20 Jul 2008
Posts: 19
Location: Schenactady, US

PostPosted: Tue Sep 23, 2008 5:18 pm
Reply with quote

Hi,

If a DB2 TABLE has a FLOAT variable then how do we declare them in a ezytrieve to retrieve those fields.

Thanks,
Vel
Back to top
View user's profile Send private message
zero

New User


Joined: 01 Dec 2007
Posts: 21
Location: Hyderabad

PostPosted: Wed Sep 24, 2008 2:55 pm
Reply with quote

Hi Vel,
Generally floating point fields are defined in Ezt like this :

Percent W 3 P 2

here, "percent" is the field name.
"W" says that it is a working storage field. Here, "S" Can also be used.
"S" for Static.

"3" is the No. of bytes allocated for this field.
"P" says it is "Packed"
"2" is the No. of digits after Decimal Point.

if a field is of type Packed decimal, then, two digits can be stored in a Byte. that means, 4 bits are used to store a digit.

A packed decimal also stores sign (Positive or Negative) using 4 bits.

in the above example, we defined it to be 3 bytes. that means, 24 bits.
here, 4 bits are used for sign.
remaining, 20 bits are stored for Value. so, we can store 5 digits in the above field.

we mentioned 2 decimal places. So, we can store nos. like,
120.34, 987.45 and so on.

Define your field based on the Field in your table.

Hope this will help,
...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Count the number of characters in a f... CA Products 1
No new posts JCL with variables JCL & VSAM 1
No new posts File matching functionality in Easytr... DFSORT/ICETOOL 14
No new posts JCL Variables JCL & VSAM 1
No new posts reset/clear ALL application profile v... TSO/ISPF 3
Search our Forums:

Back to Top