RobertM3
13th November 2001, 01:18
Hello everyone,
I want to kick off a script that runs ba6.1 and a session name.
The catch is I want it to be in the background and called from job manager :confused: So that the steps in the job manager can continue after the shell to start the parallel process is started.
The trouble is it waits until the shelled job is finished and then continues. Here is the code script example:
#!/bin/ksh
export BAMODE=1
export BSE=/baan/test/bse
export PATH=$BSE/bin:$PATH
export BSE_TMP=$BSE/tmp
export TERM=vt100
export BSH_JOB=OLAP
ba6.1 ttaad5203m00
I want to automate this so the job manager can handle it.
Example:
step 1 - genrate
step 2 - Shell out and print
step 3 - post
Step 3 takes a while so if the printing could always run after step1 and parallel with step 3 I could be happy *maybe*:p
Thanks any help would be appreciated.
victor_cleto
13th November 2001, 08:41
Originally posted by RobertM3
#!/bin/ksh
export BAMODE=1
export BSE=/baan/test/bse
export PATH=$BSE/bin:$PATH
export BSE_TMP=$BSE/tmp
export TERM=vt100
export BSH_JOB=OLAP
ba6.1 ttaad5203m00
Use a background process start for the ba6.1, by using
ba6.1 ttaad5203m00 &
This will start the process without the script waiting for it to finish.
RobertM3
13th November 2001, 16:51
Thanks for the quick responce Victor but the ba6.1 seems to ignore the & rule and still waits....
Is there away other than the ba6.1 that will start the session.
I tried bshell6.1 with the -server option it came back but never started the session.
gfasbender
13th November 2001, 19:40
Try creating and executing a header script that contains calls to your step scripts, like:
step1.scr
step2.scr &
step3.scr
This way, step2 will run in parallel with step3.
RobertM3
13th November 2001, 19:57
We tried that one also Gordon but thanks for the quick responce.
It just hangs up on the connection to bshell until the job session finishes...
gfasbender
13th November 2001, 22:52
Robert,
I see what you're doing now. You have a job in Baan's Job Management that does the 3 steps.
You should really start the process script from cron. You can contol the scheduling as well as Baan's Job Manager.
Your cron job script would contain calls to your step scripts, which might look like:
cron.job.scr
-------------------------
step1.scr
step2.scr &
step3.scr &
...
step1.scr (calls "olap" baan job)
-------------------------
...
export BSH_JOB=OLAP
ba6.1 ttaad5203m00
step2.scr (calls print shell process?)
-------------------------
step3.scr (calls "post" baan job)
-------------------------
...
export BSH_JOB=POST
ba6.1 ttaad5203m00
The idea is, control the step execution from a cron script, not from a job in Baan's job management.
RobertM3
13th November 2001, 23:47
Thanks Gordon,
That was going to be our last option we have a Programmer in charge of Baan Jobmanager that works for us. I was tring to stay out of the Unix admins area, They want us to limit our cron jobs to a level they can control. It looks like we would have no other alternative but to do it that way.
Thanks again for all your help:cool:
tzwetan
31st August 2005, 11:15
Hello all,
I believe this thread is the right to post my question. We have got a job to be ran hourly and we use crontab to start it with rc.startjob. In Baan job tasks it is a peridical task with status set to free. My problem is when by some reason one execution is missed, then the next execution date/time goes into the past and the process stops (somebody needs to repair it).
For me is better not to scheduled task, but to start it 'asynchronously'.
My question is - is it possible with 'ba6.1 session' command to start my session and have it completed without user intervention. Actually I have to execute afs tdilc9201m00c to translate a txt file into inv transaction. After ba6.1 tdilc9201m00c I see the session open and one 'press enter' missing only.
What is best, to use job or try to dig into shell scripts?
norwim
31st August 2005, 16:14
Hi there,
I just wrote a small session which I can call exactly the way you want ... ba61. sessionname parameter1 parameter2 .....
If you have the script, it is quite easy to circumvent the actual input in the choice.section (for instance by calling read.main.table() in before.choice and then call end() or exit()).
If you don't have the source of the program you want to call I am afraid you are busted.
What I basically did was to run a job for a certain runnumber. As parameter I pass 1)'XYZZY' 2)'runnumber'.
In the init.form section I do something like
if argv$(1)="XYZZY" then
magic=tcyesno.yes
fill.fields.with.default()
runnumber=argv$(2)
execute(cont.process)
end()
endif
Somewhere deep, deep in the script, where the actual printing is done, I framed:
if not magic then
print.record(1)
endif
to prevent spool-output (and setting of spool.device).
But this, as already mentioned, assumes that you have the program source.
BTW: who knows where 'XYZZY' comes from? *g*
hth
Norbert
NPRao
31st August 2005, 23:59
Here are some answers to different Q's here.
So that the steps in the job manager can continue after the shell to start the parallel process is started.
From the tools session help you can set up multiple sessions in a single job to be executed at the same time.
Sessions by Job (ttaad5101s000)
Use this session to maintain the list of sessions linked to a job. The sequence number determines the order in which the sessions are executed.
You can change the execution order of the sessions and add sessions to a job by copying them from another job.
Session Number/Code The number that indicates the order of executing of sessions in the job when the sequence number of sessions are the same. The session number is a unique number.
Session Number/Code The package code of the session which has been added to the job.
Session Number/Code The module code of the session which has been added to the job.
Session Number/Code The code of the session which has been added to the job.
Information A short description of the session in the job.
Sequence Number This number determines the order of execution. The sessions with the lowest numbers are executed first. If two sessions have the same sequence number, they are executed in order of session number.
The following code would not work, as in job mode there is no form created by the Standard program. You can test it, running the program in debug and activating the job manually in UI mode.
In the init.form section I do something like
if argv$(1)="XYZZY" then
magic=tcyesno.yes
fill.fields.with.default()
runnumber=argv$(2)
execute(cont.process)
end()
endif
I tried bshell6.1 with the -server option it came back but never started the session.
I believe this thread is the right to post my question. We have got a job to be ran hourly and we use crontab to start it with rc.startjob. In Baan job tasks it is a peridical task with status set to free. My problem is when by some reason one execution is missed, then the next execution date/time goes into the past and the process stops (somebody needs to repair it).
For me is better not to scheduled task, but to start it 'asynchronously'.
Here is a sample code which we use on our systems.
BSE_LOG=/app/lms/${ENV}/var/logs/jobs/$COMPANY
export DS_AS=$BSHELL
export BSE BSE_LOG
PATH=$BSE/bin:$PATH
export PATH
# It turned out that the TERM variable could be unset when running in a cron
export TERM=vt100
export BAMODE=1
#Before starting the socket, make sure it is dead
$BSE/bin/bshell6.2 -server -nodebug -set BSE_COMPNR=$COMPANY
-set PACKAGE_COMB=$PACKAGE $ENDOBJECT 2>${BSE_LOG}/stop
_sock.$$ &
wait # NP - you can comment this in your case
#Start the socket server.
$BSE/bin/bshell6.2.sh -server -nodebug -set BSE_COMPNR=$COMPANY
-set PACKAGE_COMB=$PACKAGE $STARTOBJECT 2>${BSE_LOG}
/run_sock.$$ &
if [[ $? -ne 0 ]]; then
exit 3
else
exit 0
fi
#EOS - sockrun.ksh
For me is better not to scheduled task, but to start it 'asynchronously'.
Make it into a 3-GL which calls or handles the AFS and start it with
bshell6.2 -server option so that you don't have to create a job.