Batch Control Job issue

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
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Batch Control Job issue

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post 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.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
satheesh_color
Participant
Posts: 182
Joined: Thu Jun 16, 2005 2:05 am

Post 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
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

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