What is divide by zero rule.

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

tanaya.deshpande@tieto.co
Participant
Posts: 94
Joined: Sun Jul 18, 2010 11:35 pm

What is divide by zero rule.

Post by tanaya.deshpande@tieto.co »

What is divide by zero rule?
Why is it implimented ?
How is it implimented?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:?

Not really any kind of explicit DataStage question, is it? So...

http://en.wikipedia.org/wiki/Division_by_zero
-craig

"You can never have too many knives" -- Logan Nine Fingers
tanaya.deshpande@tieto.co
Participant
Posts: 94
Joined: Sun Jul 18, 2010 11:35 pm

Post by tanaya.deshpande@tieto.co »

well yes it is a Datastage question ...
In the past I had implimented this ..but now I have forgotten
battaliou
Participant
Posts: 155
Joined: Mon Feb 24, 2003 7:28 am
Location: London
Contact:

Post by battaliou »

I guess in a transformer you're looking at something like:
if NullToZero(Aggregated.ITEMTOT) + 0 then 0 else Aggregated.ITEMTOT/Aggregated.ITEMTOT
3NF: Every non-key attribute must provide a fact about the key, the whole key, and nothing but the key. So help me Codd.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

tanaya.deshpande@tieto.co wrote:well yes it is a Datastage question ...
Not the way you phrased it. Add in a specific example or a DataStage error or problem you are seeing and then I'd agree. Otherwise it's just an excercise in Googling.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

In the old days of assmebler dumps, we mainframers would flinch every time we saw a SOC7 error, which usually happens when our code tries to divide by zero (It's not my fault! It's the data!)

I coworker just this morning told the story of when he asked "What's a SOC4?" His mentor didn't miss a beat, and answered "It's what you put on your foot in the morning."
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:wink:

The simplest answer to the question "What is divide by zero rule"? Don't
-craig

"You can never have too many knives" -- Logan Nine Fingers
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

And I still use my yellow card to this day...

In addition to the divide-by-zero, S0C7 also came around because of invalid packed decimal data :x . Ah, the fun of tracing subroutine calls via R14 through a DOS dump!
- james wiles


All generalizations are false, including this one - Mark Twain.
eostic
Premium Member
Premium Member
Posts: 3838
Joined: Mon Oct 17, 2005 9:34 am

Post by eostic »

We're all dating ourselves here. Aren't too many of us around who can still "read" hex, let alone do calculations on it or immediately recognize a zone decimal from a packed decimal from an integer... (and so on)... :) Sigh. A lost art.

Ernie
Ernie Ostic

blogit!
<a href="https://dsrealtime.wordpress.com/2015/0 ... ere/">Open IGC is Here!</a>
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

eostic wrote:We're all dating ourselves here. Aren't too many of us around who can still "read" hex, let alone do calculations on it or immediately recognize a zone decimal from a packed decimal from an integer... (and so on)... :) Sigh. A lost art.

Ernie
Take heart, Ernie. My IT education sources (hereafter unnamed) tell me that the larger companies with big legacy code bases are screaming for mainframe curricula to be brought back. I'm hoping for the possibility of a part-time job at a community college or small liberal arts college to keep me busy after retirement, but if not I doubt I'll lack contracts.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

First time I've encountered COBOL being described as a "liberal art". :)
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
jwiles
Premium Member
Premium Member
Posts: 1274
Joined: Sun Nov 14, 2004 8:50 pm
Contact:

Post by jwiles »

Well, it is a very wordy language, but not quite poetic
- james wiles


All generalizations are false, including this one - Mark Twain.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

:lol: Ha, Ray! My COBOL instructor way back when was the IT directory for a small book publisher. There's a "liberal" and an "art" in there for the asking.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson

Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Meanwhile, back on topic, the correct answer (mathematically) is that "division by zero is not defined". In a DataStage parallel Transformer stage it should cause an exception.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
tanaya.deshpande@tieto.co
Participant
Posts: 94
Joined: Sun Jul 18, 2010 11:35 pm

Post by tanaya.deshpande@tieto.co »

I am calculating a column like this

Column A = (Column B+Column C)/Column D

Now if suppose a zero value comes at Column D then the Datastage will through an exception ..or an error so how can I handle this..

????
Post Reply