Page 1 of 1

Attempted WRITE with NULL record ID

Posted: Mon Oct 04, 2004 9:51 am
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

Posted: Mon Oct 04, 2004 10:10 am
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.

Posted: Mon Oct 04, 2004 10:24 am
by kishorchitra
Thanks.

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

Kishor

Posted: Mon Oct 04, 2004 10:34 am
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.

Posted: Mon Oct 04, 2004 6:57 pm
by kishorchitra
Thank you, it worked great by doing an nvl just before sending the key to the hash file.

Thanks again,
Kishor