baanfin06
15th September 2006, 01:06
hello ,

I have to run a job on ecedi7201m000 every 5 minutes to generate outbound EDI messages. Here are the steps that I did

1. In ecedi7201m000, I selected "make job.." and then linked it to a job, scheduled the job to 1 minute
2. In my server I have 3 batch files. When the first file executes it calls the second batch with the Baan Job to be executed.
3. The second batch files starts the baan job
4. The first batch files checks if there are any files sent out by baan job and if there are any , calls the 3rd batch file to move them to the middleware server.

It so happens that 2nd batch file does not start the baan job at all.
What might be the problem.
We are on Windows server.

1st batch

@echo on
set ediSdir = e:\baanerp\edi\100\extnet\appl_from\

set datetime=%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%
if %datetime:~8,2% LSS 10 set datetime=%datetime:~0,8%0%datetime:~9,5%

set ediLogfile= e:\baanerp\edi\100\extnet\log\810log%datetime%.txt

:start810
(echo *** start Generate EDI Messages - ***) >> %ediLogfile%
call %bse%\edi\edibat\edi100.bat 810SOU
(echo.) >> %ediLogfile%
echo 810Start
goto end

if exist %ediSdir%edi810*.txt goto move810
goto no810files

:move810
(echo *** Move 810 files to Inovis ***) >> %ediLogfile%
call %bse%\edi\edibat\move_810_inovis.bat
(echo.) >> %ediLogfile%
goto end


:no810files
(echo *** no810files - No edi messages to be generated ***) >> %ediLogfile%
(echo.) >> %ediLogfile%
rem echo No edi files
goto end

:end
(echo *** end of program ***) >> %ediLogfile%
(echo Current date and time is & date /t & time /t) >> %ediLogfile%
rem echo This is the end
exit

2nd Batch

@echo off

if "%1" == "" goto argerror

start %bse%\bin\bw edi100.bwc -- -set BSH_JOB=%1 ttaad5203m000
goto end

:argerror
echo Usage: startjob name-of-job-to-start
goto end

:end

3rd Batch file

@echo on
set ediTdir=\\edi-server\EDI_Data\Edi\Prod\b810Prod\
set ediSdir = e:\baanerp\edi\100\extnet\appl_from\
set ediHist = e:\baanerp\edi\100\extnet\store_sent\

set datetime=%date:~10,4%%date:~4,2%%date:~7,2%%time:~0,2%%time:~3,2%%time:~6,2%
if %datetime:~8,2% LSS 10 set datetime=%datetime:~0,8%0%datetime:~9,5%


set logfile= ediLogfile= e:\baanerp\edi\100\extnet\810_process_log\log_%datetime%.txt


:checkfile
if exist %edifilesource%810*.txt goto copyfiles810
echo filenotfound >> %logfile%
goto end

:copyfiles810
echo copyfile810
copy %ediSdir%810S.txt %ediTdir%810S%datetime% >> %logfile%

:archivefile810
echo moving to store_sent >> %logfile%

move %ediSdir%810S.txt %ediHist%810_%datetime%.txt
echo moved to store_sent >> %logfile%

:end
exit

NOTE : MY MANAGER SAID THAT SOME TIME BACK WE WERE ABLE TO RUN BAAN JOBS FROM SCHEDULED TASKS, BUT THEN THEY INSTALLED A NEW BWC AND AFTER THAT IT STOPPED RUNNING.

Thanks
Vasavi

pokitlok
15th September 2006, 04:54
1. Have you had manual test run batch file 2? Does it work probably?
2. Have you had manual test run batch file 1? Does it really call batch file 2?
3. If both above are ok, setup schedule job and execute it in Baan client. The job may uphold due to not completing the previous job

Of course, u have to make sure u have enough license coz the startjob consumes at least one user license as running.

Hope help u identify the problem.

mostrightfuture
15th September 2006, 12:47
hi baanfin06,

Problem is fixed or still open? Baan is running on windows or Unix?

MRF

baanfin06
16th September 2006, 01:10
Hello,
Batch 1 runs properly.
It tries to call Batch 2
Batch 2 does not execute even individually.
I don't understand what might be the reason.

mostrightfuture
18th September 2006, 10:56
Hi

May be you can try the "Call" statement instead of "start" keyword with statment

start %bse%\bin\bw edi100.bwc -- -set BSH_JOB=%1 ttaad5203m000

in Batch 2.

MRF.