Hi
I have stored some prcalculated values within a Hash file. Now I want to use the values from the Hash file from within a routine.
Is there any way I can do it? Thanks to all in advance
Reading Hash file from within a DS routine
Moderators: chulett, rschirm, roy
The commands you need to do this are in the BASIC Programmer's Guide and are OPEN, READ and CLOSE.
Example code:
Example code:
Code: Select all
OPEN '','MyHashedFileName' TO WorkFilePtr ELSE CALL DSLogFatal('Unable to open MyHashedFileName, status is "':STATUS():'".','')
READ MyRecord FROM WorkFilePtr, "HashedFileKey"
THEN
{parse the MyRecord data and process as you wish}
END
ELSE
CALL DSLogWarn('Record "HashedFileKey" not present in file.','')
END
CLOSE WorkFilePtr
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
You can also use the Trans() function - also in the DataStage BASIC manual. This may be easier if there is only a single record that needs to be accessed by the routine.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.