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

Problem while the COALESCE function for the CHARACTER fields


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

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Tue Jan 16, 2007 3:39 pm
Reply with quote

Hi,

I am executing the following unload jobs and every time i am facing some problem ,can any one help me out from finding the reason for following conditions:

CASE 1:

COALESCE is not working for any character fields.I want to know why this is happening?

CASE 2:

If i will unload through the DB-2 utility DB2CPROC and if i won't give any COALESCE condition for the null filelds the unload will happen proper, the only thing which we have to do in the copybook is just give one indicator field just after the null field.Then you will get the proper output.

CASE 3:

COALESCE is working very fine for the STANDARD DATA TYPES.

CASE 4:

For any character fields we can't execute the following query through unload jobs:

COALESCE(PRD_CLASS,'ABCDEF(because length is 6 bytes)'),means if null comes for the PRD_CLASS put forcefully ABCDEF into the output file.

If any one had face any problem please help me to find out the solution for the mentioned problem.

Regards
Harry
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Tue Jan 16, 2007 9:07 pm
Reply with quote

Harry,

What happens when you try to use COALESCE with Character data type? Does it give SQL error?

I use COALESCE on Char columns in unloads often.
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Wed Jan 17, 2007 12:28 pm
Reply with quote

Thanks for your reply!!

Dave,

Unload happened proper but data after the COALESE was complety wrong.I would like to mention over here that i was using the utility DB2CPROC,the same if some one will do by cobol-db2 program then it will come perfect.
Back to top
View user's profile Send private message
harry

New User


Joined: 27 Mar 2006
Posts: 31

PostPosted: Thu Jan 18, 2007 12:00 pm
Reply with quote

Hi Dave,

Could you please let me know that how you used COALESCE for the character fields.

Warm Regards
Harry
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Jan 18, 2007 8:18 pm
Reply with quote

Harry,

Code:

  COALESCE(CHAR_COLUMN,? ?)


When you say everything after the COALESCE was completely wrong, how was it wrong? Please post the Unload SQL before and after, including the COALESCE, and the output from it. Thanks

I think ?DB2CPROC? is probably an in-house procedure?
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 Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
No new posts Help on PL/I jsonPutValue function PL/I & Assembler 8
No new posts how to use Tso outtrap external function All Other Mainframe Topics 8
Search our Forums:

Back to Top