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

Date fetch is different for different load module


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







PostPosted: Sat Nov 20, 2010 2:30 pm
Reply with quote

Hi,

I have a Cobol-Db2 program, which does fetch from DB.

I compile program with my compile JCL with bind parameters and load module is stored in my PDS.

Same program is staged into Endevor, and Endevor does Bind and creates load module.

Bind parameters of both are same.

But when run the program, Date if fetched differently in by two load modules:

1) With My PDS load module
Date is fetched like : 2010-11-20

2) With Endevor loadlib :
Date is fetched like : 11/20/2010

But in database date is declared as CHAR(10), and stored as CCYY-MM-DD.

So my load module picks date as it is from database but Endevor loadlib is changing the format.

Not sure how date is getting converted to mm/dd/ccyy on fetch in Endevor load module.
Back to top
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 22, 2010 6:50 am
Reply with quote

Hello and welcome to the forum,

Suggest you work with your dba to make sure that everything is actually consistent. . . And that ALTDATE has not come into play.

You might also see if this has anything to do with your issue:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/handheld/Connected/BOOKS/dsnsqj10/2.24.6

If you are not using the system standard compile jcl for "your" compile, this is quite possibly the problem. Only the system standard compile/bind jcl should be used. You should not use "your own".
Back to top
View user's profile Send private message
sushanth bobby

Senior Member


Joined: 29 Jul 2008
Posts: 1020
Location: India

PostPosted: Tue Nov 23, 2010 9:18 am
Reply with quote

Vikaspo,

Quote:
I compile program with my compile JCL with bind parameters and load module is stored in my PDS.

Same program is staged into Endevor, and Endevor does Bind and creates load module.

1) With My PDS load module
Date is fetched like : 2010-11-20

2) With Endevor loadlib :
Date is fetched like : 11/20/2010


Interesting....

Quote:
But in database date is declared as CHAR(10), and stored as CCYY-MM-DD.


Since its stored as CHAR(10), it can be any 10 characters. So, you will be fetching it exactly the same way you stored it.

I hope you know there is a DATE data type.

Thanks,
Sushanth
Back to top
View user's profile Send private message
Guest







PostPosted: Tue Nov 23, 2010 2:08 pm
Reply with quote

Thanks to all for your replies. Issue is resolved now.

The problem was with pre-compiler option.

My compile was taking DATE(ISO) as option , hence data was coming as 2010-11-22.

Endevor compiler was taking DATE(USA) as option hence date format of 11/22/2010.

No changed code to take MM/DD/CCYY as format, its working.
Back to top
Guest







PostPosted: Tue Nov 23, 2010 2:11 pm
Reply with quote

Thanks Dick .... The document which you referred had the info.

Really it was very useful.
Back to top
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Nov 23, 2010 9:47 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Load new table with Old unload - DB2 DB2 6
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts How to load to DB2 with column level ... DB2 6
No new posts Need to convert date format DFSORT/ICETOOL 20
Search our Forums:

Back to Top