Noor Jahan
4th January 2016, 09:30
Hi all,
I have code to move the input files to the back up directory.
which working fine when seesion is runned.
But not working in job mode.
The code in written in choice.cont.process only so that that job mode can also execute it.
Please help
JaapJD
4th January 2016, 14:08
Is the Continue Process your default button? Check this in Maintain Forms / Buttons ...
Other thing to check: Do you specify the absolute path in the folder names? In job mode the current working directory may differ.
bhushanchanda
4th January 2016, 15:51
Also, how are you moving the file? Did you check the file permissions?
You can create a log file for the run when its running from Job Mode using job.process variable.
e.g.
if file.moving.failed then
if job.process then
write.error.to.log.file()
endif
endif
Noor Jahan
5th January 2016, 05:57
hi All ,
Thanks for the suggestiones.
but still the issue is open.
yeah i have used the full path only.and continue is the default button
i have used
file.mv(orgin.file,bakup & "/" & file.name)
origin.file have path
orgin.file = input_path & "/" & file.name
bakup = bakup directory full path
iam not understaning what may be the fault.
all other code in the continue.process is working .
there will be no permission issues as the same folder is allowing to bakp the files for the other session within the same job
but int his session its not moving the bakup files.
please help
mark_h
5th January 2016, 16:41
Usually it is one of the two things already mentioned. Either permissions to the directories or that the path is not correct. I notice the OS says windows - so if you are using a mapped drive or something like that make sure it is available in batch mode. Also make sure that the job running(whatever user id that is) has complete access to the two directories. You can check the return value on file.mv to see if success or error. Do you have a test system to try this on?
OmeLuuk
12th January 2016, 15:15
Job runs in background without UI? Which file do you expect?
What Jaap was suggesting: where is your file located from which point of view? d: on your work station refers to your second hard drive; from the server point (where the bshell runs) it refers to the server second drive on the server. But when the job runs on an application server it refers to the second drive on the application server...
So better use absolute paths (like in UNC notation) and preferably also use file.mv.across.hosts().... Then you are also save when the files are not on the physical same computer.
Ajesh
20th January 2016, 08:42
What i would have done in this case.
Use the return flag for the file move,i.e
ret = file.mv(source_path,destination_path)
And then if the ret <0 then that means there is an error in moving of the file.
I would have used the predefined variable job.process to log that file.mv gives an error in the case of running session through a Job.
If job.process then
creat.tmp.file$
endif
This way i would have identified that atleast while running the session through a Job would create a problem. But realistically speaking,running the session through a Job should not create a problem.