Generated DataStage Basic Code - how to see

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Kim Bundgaard
Participant
Posts: 16
Joined: Fri Aug 08, 2003 3:30 am
Contact:

Generated DataStage Basic Code - how to see

Post 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.
essaion
Participant
Posts: 18
Joined: Tue Nov 04, 2003 8:55 am
Contact:

Post 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
Aurelien
Kim Bundgaard
Participant
Posts: 16
Joined: Fri Aug 08, 2003 3:30 am
Contact:

Post 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.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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.
-craig

"You can never have too many knives" -- Logan Nine Fingers
essaion
Participant
Posts: 18
Joined: Tue Nov 04, 2003 8:55 am
Contact:

Post 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 :( )
Aurelien
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post 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?
-craig

"You can never have too many knives" -- Logan Nine Fingers
Kim Bundgaard
Participant
Posts: 16
Joined: Fri Aug 08, 2003 3:30 am
Contact:

I've found the Basic Code

Post 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
essaion
Participant
Posts: 18
Joined: Tue Nov 04, 2003 8:55 am
Contact:

Post 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 :)
Aurelien
peterbaun
Premium Member
Premium Member
Posts: 93
Joined: Thu Jul 10, 2003 5:27 am
Location: Denmark
Contact:

Post 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
peterbaun
Premium Member
Premium Member
Posts: 93
Joined: Thu Jul 10, 2003 5:27 am
Location: Denmark
Contact:

Post by peterbaun »

...correction

Step 5 should be

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

(no underscore)
essaion
Participant
Posts: 18
Joined: Tue Nov 04, 2003 8:55 am
Contact:

Post 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
Aurelien
Kim Bundgaard
Participant
Posts: 16
Joined: Fri Aug 08, 2003 3:30 am
Contact:

Post 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
essaion
Participant
Posts: 18
Joined: Tue Nov 04, 2003 8:55 am
Contact:

Post 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:
Aurelien
Teej
Participant
Posts: 677
Joined: Fri Aug 08, 2003 9:26 am
Location: USA

Post 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.
Developer of DataStage Parallel Engine (Orchestrate).
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply