Error in compiling batch when calling UtilityHashLookup

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
SonShe
Premium Member
Premium Member
Posts: 65
Joined: Mon Aug 09, 2004 1:48 pm

Error in compiling batch when calling UtilityHashLookup

Post by SonShe »

I am calling the routine UtilityHashLookup as below in the batch control:

RowNumber=UtilityHashLookup("HashAMERInvRowCount",1,1)

When I compile the batch I get the following error message. Please help me as to what I am doing wrong. How should I use the routine?

Thanks.

Compiling: Source = 'RT_BP205/JOB.765359288.DT.1370252918', Object = 'RT_BP205.O/JOB.765359288.DT.1370252918'
****************************************************************************************?*****
0052 RowNumber=UtilityHashLookup("HashAMERInvRowCount",1,1)
^
',' unexpected, Was expecting: '!', ')', '=', "AND", "OR", "LT", "LE",
"GT", "GE", "NE", "EQ", "MATCH"
Array 'UtilityHashLookup' never dimensioned.

2 Errors detected, No Object Code Produced.
(Batch::sbbAMERSrcToStg1Bkp)
Sainath.Srinivasan
Participant
Posts: 3337
Joined: Mon Jan 17, 2005 4:49 am
Location: United Kingdom

Post by Sainath.Srinivasan »

You need to define the funtion using deffun.
SonShe
Premium Member
Premium Member
Posts: 65
Joined: Mon Aug 09, 2004 1:48 pm

Post by SonShe »

Sainath, thanks for the reply. With the use of Deffun statement I can compile. However, When I run the batch which has only the following lines of code, it aborts with no aparent error message.

Deffun UtilityHashLookup(A1,A2,A3) Calling "DSU.UtilityHashLookup"

RowNumber = UtilityHashLookup("HashAMERInvRowCount",1,1)

If RowNumber <> 0 Then
Call DSLogInfo("Number of rows ":RowNumber,"MainBatch")
End

Please help.

Thanks.
SonShe
Premium Member
Premium Member
Posts: 65
Joined: Mon Aug 09, 2004 1:48 pm

Post by SonShe »

I looked in the forum for existing postings on this topic and was able to make it work. Hree is the code that works.

Deffun UtilityHashLookup(A1,A2,A3) Calling "DSX.UTILITYHASHLOOKUP"

RowNumber = UtilityHashLookup("HashAMERInvRowCount",1,1)

Please note the catalog is "DSX" instead of "DSU" and also the name of the function should be in uppercase.

Thanks.
Post Reply