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

Syncsort - how to deal with null values. please help


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
sonali12_9

New User


Joined: 13 Feb 2009
Posts: 20
Location: United States of america

PostPosted: Thu Dec 10, 2009 11:51 am
Reply with quote

I am running one query and some of the fields are having null values. Now my requirement is i want to sum the unit cost field depending of part number.
Unit cost field is packed decimal S9(6)v9(03) comp-3.
If i try to sum then i am getting Soc 7.
How to replace null values with 0.

I am using Syncsort
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Fri Dec 11, 2009 2:06 pm
Reply with quote

Gentlemen, the TS is using SYNCSORT as far as i could see.
Back to top
View user's profile Send private message
abhishek.sun

New User


Joined: 22 Aug 2008
Posts: 2
Location: Gurgaon

PostPosted: Fri Dec 11, 2009 2:11 pm
Reply with quote

enrico-sorichetti wrote:
Mukesh,
both ideas are just plain wrong...

they just show that You do not have the slightest idea of what You are talking about

did You ever care to look at the db2 manuals for the meaning of NULL

NULLness is a concept not a value
meditate, please... meditate
ibmmainframes.com/viewtopic.php?t=45562&highlight=null


Hey enricho,

I looked at the link you mentioned.

You explained NULL very well. by saying:

"to distinguish between low values and NULL value
every field must be defined os two tokens...
a flag and a value
the flag vill tell if the value has been assigned ( NOT NULL ) or not ( NULL)
so that You can process accordingly"

I knew the concept but it is very good for one who is learning.

Regards,
Abhishek
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Dec 11, 2009 9:42 pm
Reply with quote

Hello,

I may have gone a bit overboard, but i've changed the title to include "Syncsort" and removed most of the non-sort-related db2 replies.

On the original question, the 0c7 is due to incorrectly defined data or invalid data content.

If the data contails x'000000' and should be packed decimal, chnge it to x'00000C'.
Back to top
View user's profile Send private message
sonali12_9

New User


Joined: 13 Feb 2009
Posts: 20
Location: United States of america

PostPosted: Sat Dec 12, 2009 11:00 am
Reply with quote

Thanks for your reply.
I used COALESCE command and replaced null value with zeros
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sun Dec 13, 2009 2:55 am
Reply with quote

Hello,

Now i really am confused. . . icon_confused.gif

How did you use coalesce in Syncsort?

Maybe it will help others (and me) if you post completely/clearly what was going on and how both Syncsort and DB2 are involved. . .
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2481
Location: Netherlands, Amstelveen

PostPosted: Sun Dec 13, 2009 7:00 pm
Reply with quote

Hi Dick,

maybe a user exit in sort to trigger some DB2 processing?
Any thing is possible, seeing some requirements (?) and/or
inventions here.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Mon Dec 14, 2009 3:35 am
Reply with quote

Hi Peter,

Quote:
Any thing is possible
Yup, it surely is.

I probably should have called a halt way back (like when i read the topic start . . . After a time, it appeared that there was no real continuity in the discussion and that Syncsort was mentioned (which does 0c7 on invalid numerics). Maybe i should have just left all of the clutter alone. . .

Hopefully, Sonali will clarify. . .
Back to top
View user's profile Send private message
sonali12_9

New User


Joined: 13 Feb 2009
Posts: 20
Location: United States of america

PostPosted: Mon Dec 14, 2009 11:21 am
Reply with quote

Sorry for the confusion.

Input for my sort was coming from db2 query. Query returned null values and i was not able to sum those values.
so later i used coalesce command and replaced null values with zeros .
Now i can sum the fields.
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


Joined: 22 Apr 2006
Posts: 6250
Location: Mumbai, India

PostPosted: Mon Dec 14, 2009 3:02 pm
Reply with quote

sonali12_9 wrote:
Sorry for the confusion.

Input for my sort was coming from db2 query. Query returned null values and i was not able to sum those values.
so later i used coalesce command and replaced null values with zeros .
Now i can sum the fields.
In real it made a confusion here, your post is moved to JCL Part while it belongs to DB2...try to be clear from the start of thread. That saves time for lots of people - please let us know where do you want to keep this thread now?
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Null values are considered in Total c... DFSORT/ICETOOL 6
No new posts Converting ASCII values to COMP-3 (ZD... JCL & VSAM 2
Search our Forums:

Back to Top