View previous topic :: View next topic |
Author |
Message |
anilkumar_mca Beginner
Joined: 26 Feb 2005 Posts: 5 Topics: 5
|
Posted: Wed Jun 28, 2006 2:01 am Post subject: Problem with unload DB2 data to flat file. |
|
|
Hi,
I am unloading data from a DB2 table to a flat file in my JCL. In my unload query I have the following calculation.
DAYS(date1) - DAYS(date2) + 1
while writing this value to the flat file, I am getting hexa decimal values in flat file. I need this value to be displayed in Numeric format. I've defined a nemeric variable with size 4 to receive this data in my easytrieve program.
Can anybody suggest me to convert this hexadecimal value to Numeric format in EASYTRIEVE or Is there any way I can get the numeric values directly from the unload query in to the flat file.
Thanks in advance. |
|
Back to top |
|
 |
sriramla Beginner
Joined: 22 Feb 2003 Posts: 74 Topics: 1
|
Posted: Wed Jun 28, 2006 8:48 am Post subject: |
|
|
You can use DIGITS and/or CHAR function around this calculation to get the data in simple readable numeric format. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Wed Jun 28, 2006 8:55 am Post subject: |
|
|
anilkumar_mca,
Quote: |
DAYS(date1) - DAYS(date2) + 1
|
unload will yield a 5 byte field (4 bytes for the result in binary format and 1 byte null indicator at the end)
so in your easytrive define this field as
Code: |
ws-unld-fld pos 4 B 0
|
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|