SETFILE related question

Make suggestions regarding the DSX site or the Forum

Moderators: chulett, rschirm, roy

Post Reply
him121
Premium Member
Premium Member
Posts: 55
Joined: Sat Aug 07, 2004 1:50 am

SETFILE related question

Post by him121 »

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

Post by ray.wurlod »

Determine the environment variable's value however you like, for example using

Code: Select all

Call DSExecute("UNIX", "echo $HASHPATH", HashDirPath, Code)
The result is in the variable called HashDirPath.

Build your SETFILE command.

Code: Select all

Command = "SETFILE " : HashDirPath : "/" : HashedFileName : " " : HashedFileName : " OVERWRITING"
Execute your command

Code: Select all

Call DSExecute("UV", Command, Output, Code)
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

Code: Select all

Call DSExecute("UNIX", "echo $HASHPATH", HashDirPath, Code)
The result is in the variable called HashDirPath.

Build the pathname of the hashed file.

Code: Select all

HashFilePath = HashDirPath : "/" : HashedFileName
Open the hashed file using OpenPath.

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.
him121
Premium Member
Premium Member
Posts: 55
Joined: Sat Aug 07, 2004 1:50 am

Post by him121 »

Hi..
Ray i try it for Windows..
but ECHO $hd is not working because command is not present..

can u please tellme for windows DS Server.

thanx...for reply
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

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