We have a job with a before job subroutine ExecDOS and Input value
START REPLACE \\PATH A\*.* \\PATH B /a &EXIT &
This job runs everyday as part of a scheduled batch but sometimes it fails with below error
DSD.SEQOpen Failed to open A.txt in directory PATH B
STATUS = 2.
Unknown error ocurred.
Execution of job canceled
But when we check in PATH B the file is present.
(Please note that PATH A , PATH B and A.txt are not actual paths/names of the file but just examples)
How is it possible that the job is unable to open a file,that it itself is placing in the particular place or path in the before job subroutine.
Could it be that the file is being accessed or opened before it is actually physically placed in the folder?
Thanks in advance for all your help.
Job fails due to unable to open a file error
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 5
- Joined: Wed Nov 19, 2008 11:25 pm
-
- Participant
- Posts: 5
- Joined: Wed Nov 19, 2008 11:25 pm
Thanks for your reply.
The EXIT command is just used to withdraw from the current DOS session.
I tried using The EXIT command with the replace command(I was replacing a huge file which would obviously take some time) on command prompt and it seems to me that the EXIT command is executed only after the replace command completed.
Any other suggestions?
Thanks again for all your help.
The EXIT command is just used to withdraw from the current DOS session.
I tried using The EXIT command with the replace command(I was replacing a huge file which would obviously take some time) on command prompt and it seems to me that the EXIT command is executed only after the replace command completed.
Any other suggestions?
Thanks again for all your help.
I typed "help start" in a cmd window:
Thoughts:
1) Can you try it without the START command? If you're already calling ExecDOS from DS, why do you need to launch a separate process for your REPLACE command?
2) If you do need START for some reason, try adding the /WAIT option.
HTH,
Scott
Code: Select all
Starts a separate window to run a specified program or command.
START ["title"] [/Dpath] [/I] [/MIN] [/MAX] [/SEPARATE | /SHARED]
[/LOW | /NORMAL | /HIGH | /REALTIME | /ABOVENORMAL | /BELOWNORMAL]
[/WAIT] [/B] [command/program]
[parameters]
"title" Title to display in window title bar.
path Starting directory
B Start application without creating a new window. The
application has ^C handling ignored. Unless the application
enables ^C processing, ^Break is the only way to interrupt
the application
I The new environment will be the original environment passed
to the cmd.exe and not the current environment.
MIN Start window minimized
MAX Start window maximized
SEPARATE Start 16-bit Windows program in separate memory space
SHARED Start 16-bit Windows program in shared memory space
LOW Start application in the IDLE priority class
NORMAL Start application in the NORMAL priority class
HIGH Start application in the HIGH priority class
REALTIME Start application in the REALTIME priority class
ABOVENORMAL Start application in the ABOVENORMAL priority class
BELOWNORMAL Start application in the BELOWNORMAL priority class
WAIT Start application and wait for it to terminate
command/program
If it is an internal cmd command or a batch file then
the command processor is run with the /K switch to cmd.exe.
This means that the window will remain after the command
has been run.
If it is not an internal cmd command or batch file then
it is a program and will run as either a windowed application
or a console application.
1) Can you try it without the START command? If you're already calling ExecDOS from DS, why do you need to launch a separate process for your REPLACE command?
2) If you do need START for some reason, try adding the /WAIT option.
HTH,
Scott
Some people are the Michael Jordan's of Datastage. I'm more like Muggsy Bogues