timb25
2nd November 2004, 16:30
This sounds like a very simple problem, but I'm having difficulty finding the solution. I have a session that is set up to write the output to $BSE/common. However when I run the session as a job or manually for a specific user, the output is actually written in the /home directory of the user. If I run the session manually as myself, it will write the output in the $BSE/common directory.
Is there anything that I'm missing.
Thanks in advance.
-Tim
mark_h
2nd November 2004, 16:38
When running a job you need to make sure it has the same paths or environment variables that you do. So it sounds like when running as a job there is something wrong with the paths.
Mark
timb25
2nd November 2004, 17:26
I verified the .profile for myself and the 'job' user.. and made sure the PATH, BSE and BSE_TMP were the same. I tried to run the job again and still the same result...output to /home directory.
mark_h
2nd November 2004, 17:44
Are you running this through cron or just a script file? Below is a test script I use to verify some of my sessions and how they react in batch. I just shell out and run it. I am not sure what exactly gets executed when using cron (.profile,.cshrc,.login) been to long since I used it.
Is this file created using a report? Just wondering if you used a ${BSE}/common for the spool.fileout?
Mark
BSE=/apps/baan/baanfour/bse
BSE_TMP=/apps/baan/baanfour/bse/tmp
export BSE BSE_TMP
PATH=$BSE/bin:$BSE/etc:$PATH
export PATH
#BSE_COMPNR=0 ;export BSE_COMPNR
TERM=vt100 ;export TERM
rc.startjob TESTMH
Nancy Mathew
2nd November 2004, 17:45
Hi,
Declare and export $BSE in the script. This is the safest way to do it, as .profile is not read when running the job through crontab if at all. Also if running the script through a BaaN job, the best way is to have the script self sufficient in terms of parameters and variables.
Nancy
timb25
2nd November 2004, 18:18
My job is run through crontab. I have a job set up in the job management session and crontab runs the following:
00 08 * * * export BSE=/baan1/bse; export TERM=vt100; $BSE/etc/rc.startjob TESTJB
I do not specify any device in the job management window. The output file is determined by a customized parameter session. Then the session I run in the job looks at the parameter session for the output path.
mark_h
2nd November 2004, 18:33
Check job user and make sure company and VRC match your user id. Not sure if this is relevant but you may want to log on as this job user and make all the directory permissions and such are correct. Then at this point I would start debugging the session that runs. You can add messages to the session to print what is actually in the variables. Something like
if job.process then
message("%s",parameter)
endif
Then print job messages to see what is actually in the messages.
Mark