Hi All,
My datastage designer project folder connected to a folder A under unix
so if i write DS routine to read unix file under folder A it is opening/reading
with out any problem......
Suppose if i tried to access different file from differnt folder say
folder chcprov am not able to access......i have tried with OPENPATH
with SSelect but i could not succeeded....
could you please provde me with some exaample syntax it will be much helpful for beginner like me
i tried use command
CALL DSExecute'UNIX','cd /chcprov;ls ':Inputfil,Output,SYSRET)
but after this when am reading file still it is pointing to folder A only
please give me some help
Mahi
Reading file from different folder
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 53
- Joined: Wed Nov 05, 2003 8:36 am
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Post your code. You definitely don't need a cd command. Further, DSExecute opens a new shell (in which your cd command would be performed) - that shell closes before DSExecute returns.
Please specify exactly what you're trying to achieve. Is it, for example, to read all files in a folder? You will need to open the file using OpenSeq (which can use a pathname), or to open the folder using OpenPath and read the entire file as a single tring using Read.
But I'm not clear why there's a SSELECT statement involved (unless it's read all files in a folder). So, please post your code.
Please specify exactly what you're trying to achieve. Is it, for example, to read all files in a folder? You will need to open the file using OpenSeq (which can use a pathname), or to open the folder using OpenPath and read the entire file as a single tring using Read.
Code: Select all
OpenSeq "/chcprov":InputFil To filevariable
Then
Loop While ReadSeq Line From filevarilable
* process current line in file
Repeat
End
CloseSeq filevariable
Code: Select all
OpenPath "/chcprov" To filevariable
Then
Read FileContents From filevariable, InputFil
Then
* statements to process string
End
Else
* file could not be read
End
Close filevariable
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.