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 

Problem with unload DB2 data to flat file.

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


Joined: 26 Feb 2005
Posts: 5
Topics: 5

PostPosted: Wed Jun 28, 2006 2:01 am    Post subject: Problem with unload DB2 data to flat file. Reply with quote

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
View user's profile Send private message
sriramla
Beginner


Joined: 22 Feb 2003
Posts: 74
Topics: 1

PostPosted: Wed Jun 28, 2006 8:48 am    Post subject: Reply with quote

You can use DIGITS and/or CHAR function around this calculation to get the data in simple readable numeric format.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Wed Jun 28, 2006 8:55 am    Post subject: Reply with quote

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