Datastage PX version 8.5 on windows(MKS installed):
I have the same scenario to implement as noted here.
Step2 in the previous post: "2. Exec command activity checking for a file pattern using a if condition. If file found print 'Found' else sleep for some seconds. "
I tried the below commands in the execute command stage. I am getting error. can anyone help me to debug this ?
[-f "Client_Export_Out_"* ]&& ECHO "file exists"||SLEEP 60
(or)
IF [-f "Client_Export_Out_"* ]; THEN ECHO "file exists" ELSE SLEEP 60
error from log:
..JobControl (@Execute_Command_0): Executed: [ -f "Client_Export_Out_"* ]&& ECHO "file exists"||SLEEP 60
Reply=0
Output from command ====>
'[' is not recognized as an internal or external command,
operable program or batch file.
Command activity checking for a file pattern
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
The Execute Command activity executes a command in the operating system, in this case Windows. To execute MKS Tookit commands, its bin directory must be named in the Windows PATH environment variable.
Another approach would be to name a UNIX shell explicitly in the command you are executing, for exampleNote also that UNIX commands are case sensitive; ECHO is not valid in UNIX.
Another approach would be to name a UNIX shell explicitly in the command you are executing, for example
Code: Select all
/bin/ksh test -f "Client_Export_Out"* && echo "file exists" || sleep 60
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.