sujoy.sen
4th April 2003, 18:57
We have a session that was developed by a consultant. Excerpts from code:

#pragma used dll "ottdllbw"
...
server2client("/home/"&logname$&"/jobs/joboutput/inv.txt", "c:\inv.txt", 1)

This session works great when run manually. However, when running it as part of a job, it doesn't seem to copy the file over to the C drive, and the job remains at the 'running' status. What needs to be done to make this code work in a job?

mgakhar
4th April 2003, 19:03
Sujoy,
U may try replacing the c:\ with either the i/p addr or the machine name.

Manish.

sujoy.sen
4th April 2003, 23:18
Manish,

What would be the exact syntax for machine name or ip address? I tried some combinations with machine name but couldn't get it to work.

Thanks,
Sujoy.

mgakhar
5th April 2003, 00:51
Actually the server2client code would not work when running the session through job. I believe the reason being that when the session is being run as a job, there is no client (which when running the session manually would be your pc).

You may want to try writing a shell script to ftp (http://www.baanboard.com/baanboard/showthread.php?threadid=6913&highlight=ftp) the file to the particular workstation and replacing the server2client code by calling this shell script. Or maybe you could code that if the program is being run as a job only then call the shell script else call the server2client.

MG.

sujoy.sen
5th April 2003, 01:01
We decided to take the easy way out ... in some ways similar to what you've suggested in your post. Eliminated all calls to server2client from the script. Session now runs fine in the job and creates a file in the unix directory specified. User will run an ftp script (usually in the form of a .bat file) from his PC to bring the file over. This Baan session is always run as a job and we run it only about once a month so this solution seems acceptable. Thanks for your help. Appreciate it.

m.vidyasagar
13th February 2015, 23:54
Any Solution (code) for this?

bhushanchanda
15th February 2015, 18:02
Hi,

What problem are you facing? As mentioned, you need to create your file on server if the session runs in a job.

You can detect that using

if job.process then
|* This part will be executed when session runs in a job
endif