Page 1 of 2

Generated DataStage Basic Code - how to see

Posted: Mon Feb 09, 2004 4:06 am
by Kim Bundgaard
I've got a warning :
DataStage Job 412 Phantom 3044
Program "JOB.810341824.DT.1318540820.TRANS1": Line 609, Nonnumeric data when numeric required. Zero used.

How can I see the DS Basic Code generated when i compile the job. I would like to find out which field that gives the problem.
As far as I know, the transformer stage generate some DS Basic Code, and that 810341824 is where in the code I have problems.

Posted: Mon Feb 09, 2004 5:53 am
by essaion
Hello Kim,

Instead of hacking files so ugly that you really don't want to know about them, why don't you add a reject file on the faulty design ?

1. Make a backup copy of the design
2. In the Designer interface, just add a flat file stage, link the transformer to this file, then propagate to the added link the input structure that seems to be wrong
3. Fill the flat file stage's fields at your convenience
4. In the transformer, put a constraint on the output you just added : <outputLinkName>.REJECTEDCODE where <outputLinkName> is the name of the output link that gave you the error.

Compile the job, run it and the flat file will contain rejected lines. Unless each line has 100+ fields, you should quickly find which field yielded the error...

Be sure there are other ways to look for your guilty field, but i don't see one easier (although i'm sure the blinkers i wear hide at least one).

Waiting for what the DataStage Lords will surely write, what about testing this ?

Regards

Posted: Mon Feb 09, 2004 6:52 am
by Kim Bundgaard
Hello

The error arrives after the message "DSD.StageRun Active stage finishing." - so I don't get a reject in the Transformer stage.

Posted: Mon Feb 09, 2004 7:43 am
by chulett
It's not all that hard to look at the generated source, but I don't have all the gory details in my head like some of the folks around here. Following it may be another matter. :)

You'll need to know the internal 'number' of your job, which you can find with a query against DS_JOBS. A search of the Forum should turn up the syntax. Armed with that, dive into your Projects directory (under your DataStage install directory) into the project itself that holds the job in question and then look for all of the directory names that contain that number. There should be "several". One of them will contain the source... I think it will say "BP" in its name somewhere? :? Sorry, it's been awhile since I've had a need to do this.

Posted: Mon Feb 09, 2004 8:07 am
by essaion
Hello Kim,

Well, i bet i'll have to learn to read (or, more useful, to understand what i read) ;)

I just searched the forum for the sentence "Nonnumeric data when numeric required".
It seems that there is no easy way to find out which field is the guilty one... It was written that one way to get rejects is to put a transformer on the flows bringing (expected-but-non-) numeric values, then adding a constraint using the "Num()" function to test the "numeric" values.

Not sure, but i remember that NULL values aren't numeric values (in fact, they are NOTHING at all)... It could be useful to test the NULLity of the fields involved in the process to obtain supposedly-numeric values ?

Hope this helps (even though a tiny little bit :( )

Posted: Mon Feb 09, 2004 8:33 am
by chulett
As noted, I do believe that sending nulls to a Hash file key can cause this error. Any chance you are doing that in your job?

I've found the Basic Code

Posted: Mon Feb 09, 2004 8:37 am
by Kim Bundgaard
I found the Basic Code at \\blr11l\AscentialRoot\DataStage\Projects\TEST\RT_BP412, clear text (Basic Coce)

But I can't find the actual place in the code.

But after all, thank you

/Kim

Posted: Mon Feb 09, 2004 8:45 am
by essaion
I just discovered i have the same problem on one of my jobs... - sigh -

I ran into the project folder, starting a search (with the Windows Explorer) on my "JOB.xxx.DT.xxx.TRANS2" string.
What i found is a painful, horrible and terrific kind of bytecode (not really hexa, but something full of nice small squares when viewed with a text editor). Not very useful, i must add.

Then i realized i was looking in the RT_BPxx.O directory. Indeed, some kind of bytecode. But in the RT_BPxx one, i found some text files. The one finishing with "TRANS2" gave me the transformer that uses a default 0 value for non-numeric ones.
But adding an output to a flat file with a "ISNULL( myInputValue ) OR NOT( NUM( myInputValue ) )" constraint on the link filling this file didn't add a line to this file.

By the way, since there are a lot of commentaries and $INCLUDE instructions in the RT_BPxx's files, the line number specified by the DataStage job log has nothing to do with the real line number of the file...

Well. Seems like we're stuck on it, Kim :)

Posted: Mon Feb 09, 2004 8:48 am
by peterbaun
Hej Kim,

It is with most probability either a null value or - as the errorcode says - a non numeric value that it tries to handle as a numeric value.

If the error is with an environment variable and you have a lot of these it is not that easy to debug. It is however not that hard to find out via the generated basic code which environment variable (or field derivation) that is the problem.

1. Open an administrator and go to the command line interface
2. Execute the following query
select * from DS_JOBS where NAME = '<your job name';

(note - single quotes and semicolon at the edn)
3. You now have the job number - eg 123
4. Go to the project directory
5. Go to the directory RT_BP_jobnumber (in this case RT_BP_123
6. Open the file mentioned in the error message
7. Open this file in an editor that can show line numbers
8. Go to the line number mentioned

It will be a reference to an internal declared variable which you probably will find at the top of the code. You will need to spend some time getting familiarized with the generated basic code.

Hope that this helps

Regards
Peter

Posted: Mon Feb 09, 2004 8:50 am
by peterbaun
...correction

Step 5 should be

5. Go to the directory RT_BP_jobnumber (in this case RT_BP123

(no underscore)

Posted: Mon Feb 09, 2004 8:56 am
by essaion
Wow. The sun shines again.

Here is what i found (sorry, you'll have a bit of work too) :
Just make a search through the forums with the sentence "Nonnumeric data when numeric required. Zero used."

In my case, Kenneth insists in many posts that this error raises when calculations are made on non-numeric values. He's right : the developper of the job emitting the warning used the addition sign ('+') instead of the concatenation one (':').

Good luck

Posted: Mon Feb 09, 2004 9:02 am
by Kim Bundgaard
It's quite simple at all ......

THE ACTUAL LINE OF CODE :
Pin%%V0S2P37.Column%%16 = ( If V0S2.Stagevar%%10 = 1 then (Pin%%V0S2P49.Column%%10 - Pin%%V0S2P49.Column%%7 - Pin%%V0S2P49.Column%%13 + Pin%%V0S2P49.Column%%16) else 0)
Pin%%V0S2P37.Column%%17 = ( If V0S2.Stagevar%%10 = 1 then (Pin%%V0S2P49.Column%%11 - Pin%%V0S2P49.Column%%8 - Pin%%V0S2P49.Column%%14 + Pin%%V0S2P49.Column%%17) else 0)
Pin%%V0S2P37.Column%%18 = ( If V0S2.Stagevar%%10 = 1 then (Pin%%V0S2P49.Column%%12 - Pin%%V0S2P49.Column%%9 - Pin%%V0S2P49.Column%%15 + Pin%%V0S2P49.Column%%18) else 0)

AND IN THE COMMENTS, IN THE START OF THE CODE I FIND :
* V0S2.Stagevar%%10 <= GE00130TLookup
* Pin%%V0S2P37.Column%%16 <= Xo_DEB_FORHOLD_FAKT.SKYLDIG_RENTE
* Pin%%V0S2P37.Column%%17 <= Xo_DEB_FORHOLD_FAKT.SKYLDIG_GEBYR
* Pin%%V0S2P37.Column%%18 <= Xo_DEB_FORHOLD_FAKT.SKYLDIG_AFGIFT

Actually it is a lookup, that gives the error.
Thanks again

Posted: Mon Feb 09, 2004 9:15 am
by essaion
Well, in fact you're really right. The line indicated in the DataStage job's log matched the defective one into the RT_BPxx\*.TRANS2 file. :roll:

Anybody, if you know someone selling a not-to-used fully fonctional brain, please let me know. :oops:

Posted: Mon Feb 09, 2004 3:51 pm
by Teej
chulett wrote:You'll need to know the internal 'number' of your job, which you can find with a query against DS_JOBS.
Easier option: Go to the Project folder on the server, and do an ls -altr and pull the latest set of folders (or the folders with the same timestamp as when you compiled the job.) That's your number there.

-T.J.

Posted: Mon Feb 09, 2004 7:42 pm
by ray.wurlod
Teej wrote:
chulett wrote:You'll need to know the internal 'number' of your job, which you can find with a query against DS_JOBS.
Easier option: Go to the Project folder on the server, and do an ls -altr and pull the latest set of folders (or the folders with the same timestamp as when you compiled the job.) That's your number there.

-T.J.
The number's in the original error message! :lol:

Code: Select all

DataStage Job 412 Phantom 3044 
Program "JOB.810341824.DT.1318540820.TRANS1": Line 609, Nonnumeric data when numeric required. Zero used. 
Therefore it's in RT_BP412. Simple, huh?
The file name within that directory is JOB.810341824.DT.1318540820.TRANS1, which is the code generated by (possibly an implicit) Transformer stage. The name of the Transformer stage is one of the comments within the code.