hi..
folks
i have searched forum for this keyword ..but not able to get wht i want.
here is my questions..
i am storing my hash files in to the directory...different then the default..
now this directory path is stored in to Environ parameter..
so its also not fixed....means it depends upon customer to customer...
first i want to read the path for hash files from Env. parameter ..
then i want to set VOC pointer to .....this path and then i want to read data from this HASH files..through routine...
now i want to read some data from this hash files through routine...
can any one give me ..some idea to write routine for this....
thanx in advance.
SETFILE related question
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Determine the environment variable's value however you like, for example using
The result is in the variable called HashDirPath.
Build your SETFILE command.
Execute your command
Check that the value of Code is zero, which indicates success.
But...
You don't need SETFILE if you're only reading via the Routine.
Determine the environment variable's value however you like, for example using
The result is in the variable called HashDirPath.
Build the pathname of the hashed file.
Open the hashed file using OpenPath.
Code: Select all
Call DSExecute("UNIX", "echo $HASHPATH", HashDirPath, Code)
Build your SETFILE command.
Code: Select all
Command = "SETFILE " : HashDirPath : "/" : HashedFileName : " " : HashedFileName : " OVERWRITING"
Code: Select all
Call DSExecute("UV", Command, Output, Code)
But...
You don't need SETFILE if you're only reading via the Routine.
Determine the environment variable's value however you like, for example using
Code: Select all
Call DSExecute("UNIX", "echo $HASHPATH", HashDirPath, Code)
Build the pathname of the hashed file.
Code: Select all
HashFilePath = HashDirPath : "/" : HashedFileName
Code: Select all
OpenPath HashFilePath To filevariable
On Error
* code to handle fatal error on Open
End
Then
* code executed if opened OK
* (including Read statements probably)
* finishing with
Close filevariable
End
Else
* code executed if failed to open
End
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.
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
echo IS a DOS command. However, you will need "DOS" rather than "UNIX" in the DSExecute call.
What is the exact error message returned from DSExecute? (The error message is in the third argument, the exit status is in the fourth argument.)
What is the exact error message returned from DSExecute? (The error message is in the third argument, the exit status is in the fourth argument.)
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.