Page 1 of 1

Batch Control Job issue

Posted: Tue Sep 23, 2008 4:22 am
by satheesh_color
Hello,

I have a requirement in one of my batch control job to get the value from Hashed file.If the value is present in the hashed file the job should run otherwise(Record Not Found in the hashed file) the job would abort.I have tested the below code in bacth job..but noluck..can you please suggest me any other way to resolve this issue.

HashTableName="FinancialLineHash"
HashTableKey="Y"
YEAR = HashTableLookup (HashTableName,HashTableKey,1)
if IsNULL(YEAR) then (or) if len(YEAR) = 0 then

Call DSLogFatal("HashTableLookup Failed for YEAR: Batch::LoadETLFinLineMonth", "JobControl")
Abort

end


Thanks,
Satheesh

Posted: Tue Sep 23, 2008 4:27 am
by ray.wurlod
Since HashTableLookup() was written locally at your site, it is impossible for us to comment. We have no information about how this routine behaves when the supplied key is not found.

You could, as an alternative, use the SDK routine called UtilityHashLookup, or you could write your own Open and Read statements within the code, or you could even use the Trans() or XLate() function.

Posted: Tue Sep 23, 2008 5:04 am
by satheesh_color
Hi,

Sorry, i missed to mentioned about the routine functionality.

The routine(HashTableLookup) would return the value when it found in the particular hashed file.

Otherwise it would return **RECORD NOT FOUND**.

If no record found, return value is: "**RECORD NOT FOUND**".

Please suggest me on how to handle this issue in the batch control job.

Thanks,
Satheesh

Posted: Tue Sep 23, 2008 5:11 am
by ray.wurlod
So whoever "wrote" that routine stole the code from UtilityHashLookup.

Test for that particular value.

Code: Select all

If YEAR = "**RECORD NOT FOUND**"
Then
   Call DSLogFatal("HashTableLookup Failed for YEAR: Batch::LoadETLFinLineMonth", "JobControl") 
End
The Abort statement is redundant. DSLogFatal() will cause the job to abort.