As Craig suggested, go into the source code of UtilityHashLookup() change the specific code and make your own routine. Here ill help you with that.
Code: Select all
*************************************************************************
* Copyright (C) 2004, 1997-2003 Ascential Software Corporation. All Rights Reserved. *
* This code may be copied on condition that this copyright *
* notice is included as is in any code derived from this source. *
*************************************************************************
*
* Executes a lookup against a hashed file using a key
*
* Input Parameters : Arg1 = Fully Qualified Path Of Hash Table
* Arg2 = Hash Key Value
* Arg3 = Column Position to return.
* If empty, return entire row in a dynamic array.
*
* Return Values: If no record found, return value is: "**RECORD NOT FOUND**".
* If hash file not found, return value is: "**TABLE NOT FOUND**"
*
* Note that the above strings may be localised.
*
RoutineName = 'myUtilityHashLookup'
Common /HashLookup/ FileHandles(100), FilesOpened
Deffun DSRMessage(A1, A2, A3) Calling "*DataStage*DSR_MESSAGE"
HashTable = Arg1
HashKey = Arg2
ColumnPosition = Arg3
PositionReturn = 0
* Determine if we are returning one column or entire row.
If Num(ColumnPosition) then
ColumnPosition = Int(ColumnPosition)
If ColumnPosition > 0 and ColumnPosition < 99999 Then
PositionReturn = 1
End
End
* Attempt to find the table name in our cache.
Locate HashTable in FilesOpened Setting POS Then
Read Rec From FileHandles(POS), HashKey Then
If PositionReturn Then Ans = Rec<ColumnPosition> Else Ans = Rec
End Else
Ans = DSRMessage("DSTAGE_TRX_I_0010" , "**RECORD NOT FOUND**", "" )
End
End Else
* Table is not in cache of opened tables, so open it.
OpenPath HashTable To FileHandles(POS) Then
FilesOpened<-1> = HashTable
Read Rec From FileHandles(POS), HashKey Else
Rec = DSRMessage("DSTAGE_TRX_I_0010" , "**RECORD NOT FOUND**", "" )
End
If PositionReturn And Rec <> DSRMessage("DSTAGE_TRX_I_0010" , "**RECORD NOT FOUND**", "" ) Then
Ans = Rec<ColumnPosition>
End Else
Ans = Rec
End
End Else
Rec = DSRMessage("DSTAGE_TRX_I_0011" , "**TABLE NOT FOUND**", "" )
Ans = Rec
End
End