Page 1 of 2

What is divide by zero rule.

Posted: Fri Mar 18, 2011 5:30 am
by tanaya.deshpande@tieto.co
What is divide by zero rule?
Why is it implimented ?
How is it implimented?

Posted: Fri Mar 18, 2011 7:19 am
by chulett
:?

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

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

Posted: Fri Mar 18, 2011 7:22 am
by tanaya.deshpande@tieto.co
well yes it is a Datastage question ...
In the past I had implimented this ..but now I have forgotten

Posted: Fri Mar 18, 2011 7:25 am
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

Posted: Fri Mar 18, 2011 7:29 am
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.

Posted: Fri Mar 18, 2011 9:06 am
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."

Posted: Fri Mar 18, 2011 9:11 am
by chulett
:wink:

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

Posted: Fri Mar 18, 2011 9:13 am
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!

Posted: Fri Mar 18, 2011 2:19 pm
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

Posted: Fri Mar 18, 2011 2:35 pm
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.

Posted: Fri Mar 18, 2011 3:48 pm
by ray.wurlod
First time I've encountered COBOL being described as a "liberal art". :)

Posted: Fri Mar 18, 2011 3:55 pm
by jwiles
Well, it is a very wordy language, but not quite poetic

Posted: Fri Mar 18, 2011 3:57 pm
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.

Posted: Fri Mar 18, 2011 8:03 pm
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.

Posted: Wed Mar 23, 2011 12:35 pm
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..

????