Attempted WRITE with NULL record ID

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

Post Reply
kishorchitra
Participant
Posts: 6
Joined: Mon Oct 04, 2004 9:40 am

Attempted WRITE with NULL record ID

Post by kishorchitra »

Hi,

I am new to datastage. I am assigned to run a datastage job. When I run it, at the end of it, I am getting a warning -
"Attempted WRITE with NULL record ID"
and this job is being called by a unix script. The script checks for the status code of the job and fails if the status code is not equal to zero. Some how the above warning message is causing the satus code to be != zero and my script is failing.

two questions:

1. How do I fix the above warning message - ("Attempted WRITE with NULL record ID")?
2. Why would the status code be not zero, as it is just a warning?

Pls. bear with me as I am brand new to datastage.

Thanks for your replies in advance , looking forward to hear back from you all,

Kishor
kduke
Charter Member
Charter Member
Posts: 5227
Joined: Thu May 29, 2003 9:47 am
Location: Dallas, TX
Contact:

Post by kduke »

Jobs which have warnings finish with a different status code than jobs without warnings. This is so you can trap warnings and stop processing if necessary. If you add a contraint on the output link that says not(IsNUll(link.col)) then this will stop trying to write these records out therefore no more warning messages. If you have a reject link then these records can be written to this link. Jobs with rejects are also a different return status so you can trap these as well. All of this is done so you can have more control when warnings and rejects happen. It is a good thing once you get used to it.
Mamu Kim
kishorchitra
Participant
Posts: 6
Joined: Mon Oct 04, 2004 9:40 am

Post by kishorchitra »

Thanks.

But, is there anyway I can fix the warning itself rather than supressing it? Pls.let me know.

Kishor
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

You fix it by not writing records to a hash file with null keys, which is typically what generates this error. Add a constraint to either not send records with null keys to the hash or transform them to some sort of 'default' value.

FYI, DataStage jobs typically have three exit statuses:

Ran OK - status code 1 - shows 'Finished' in the Director.
Finished with Warnings - status code 2 - shows 'Finished (See log)' in the Director.
Aborted - status code 3 - shows 'Aborted' in the Director.

There are more, but these are the main three. Only the first one is considered an 'exit code of zero' when checking at the script (ie, 'dsjob') level.
-craig

"You can never have too many knives" -- Logan Nine Fingers
kishorchitra
Participant
Posts: 6
Joined: Mon Oct 04, 2004 9:40 am

Post by kishorchitra »

Thank you, it worked great by doing an nvl just before sending the key to the hash file.

Thanks again,
Kishor
Post Reply