Wrapper script for runube that waits for UBE to completed then launched in batch mode

Ryan Stolle

Member
E1 8.0/SP23_T1

I have a shell script that wraps the runube command and lunches the UBE in BATCH (not INTERACTIVE) mode. Instead of retuning immediately it monitors the F986110 and waits for the UBE to complete. What I'm doing is checking to see of ANY records with the specified template and version and are at status S,W, or P.

As you can imaging, this all falls apart if more than one instance of the template/version is running at a time. I haven't been able to come up with a way to get a PID of a process launched by one of the jdequeue processes or even the unique job ID in the F986110.

If you are wondering why I don't just run the UBE in interactive mode. It's a long story involving Oracle support and hours worth of troubleshooting. The UBE will not run in interactive mode

Anyone have any suggestions for a reliable way for the script identity the exact record of the UBE in the F986110?

Thanks
 
Re: Wrapper script for runube that waits for UBE to completed then launched in batch mode

Ryan,

Firstly, welcome to JDEList and congratulations on your first post.

Can you run your UBE from another UBE? There is a business function that launches UBE's and that will return the Job Number - you'll have to search JDEList to find out which business function does this as I can't remember.

Is the UBE template and version you are searching for in the F986110 the UBE template and version that you run via the shell script? Is this the only way the UBE template and version can be run? If the answer to both of these questions is yes, then you can prevent two or more instances of that UBE template and version running at the same time, by coding the script not to run if it is already running. If this is done all you need is the latest entry for the UBE template and version in the F986110.

Search JDEList for Print Immediate. Some of the results may gove you a few ideas.
 
Re: Wrapper script for runube that waits for UBE to completed then launched in batch mode

If you submit with runubexml instead (it only submits in B mode), after your job submission, an xml output file is written that contains the EOne job number that it submitted.
 
Re: Wrapper script for runube that waits for UBE to completed then launched in batch mode

[ QUOTE ]
E1 8.0/SP23_T1

I have a shell script that wraps the runube command and lunches the UBE in BATCH (not INTERACTIVE) mode. Instead of retuning immediately it monitors the F986110 and waits for the UBE to complete. What I'm doing is checking to see of ANY records with the specified template and version and are at status S,W, or P.

As you can imaging, this all falls apart if more than one instance of the template/version is running at a time. I haven't been able to come up with a way to get a PID of a process launched by one of the jdequeue processes or even the unique job ID in the F986110.

If you are wondering why I don't just run the UBE in interactive mode. It's a long story involving Oracle support and hours worth of troubleshooting. The UBE will not run in interactive mode

Anyone have any suggestions for a reliable way for the script identity the exact record of the UBE in the F986110?

Thanks

[/ QUOTE ]

Not sure exactly what you are looking for but here are some notes I use when troubleshooting and need to trace process id's:


The "Process ID" field (JCPROCESSID) of F986110 is the client process ID of the last executable to access the record.

Jobs are inserted into the 'W" status by the jdenet_k (UBE Kernel), and the "Process ID" for a 'W' status job is the
UBE Kernel process id. (is this the Queue kernel post ERP8?)

When the job is moved to the 'S' status by queue kernel, the process id becomes that of the Queue Kernel process.
(Not verified by F986110_history records)

When the job goes to a 'P' status, (and 'D') the process id is the process ID of the runbatch process.

If a job goes to an 'E' (Error) status, it may be the process ID of the runbatch process if, after catching the error,
the job shutdown gracefully, or it will be the process ID of the queue kernel process, if the job crashed with a severe,
unrecoverable error.


UBE Kernel (W) -> Queue Kernel (S) -> Runbatch (P)
 
Re: Wrapper script for runube that waits for UBE to completed then launched in batch mode

When you run runube with the Batch parameter, it then calls runbatch, which is what you need to be wrapping -- runube will send some parameters to runbatch, the fourth of which is the job number. So if you replace runbatch with a wrapper script that calls the real runbatch, the script can then use the job number to make sure it's waiting on the right UBE to finish.
 
Re: Wrapper script for runube that waits for UBE to completed then launched in batch mode

My first suggestion would be to use runubexml. It returns the job number(As mentioned by Segfault) in an xml file which should be easy to read.

I have used runubexml extensively for a Third Part Scheduler and it works like a charm

If you want to use runube only , assuming you are on a Unix platform (since you mentioned shell script) , you can do a
"ps -ef|grep runbatch" , which should list information about that runbatch processes including the user id who submitted and the job number


Here is what a sample line looks like from the above command

jdeb9 13547 19609 255 11:21:22 ? 24:13 runbatch DGAIL /var/tmp/jsja19609 JPD9 *ALL 8055393 /pd/peop

13457 is the PID and 8055393 is the job number. DGAIL is the E1 user ID.

So if you know the specific E1 user id that was used , you can also just do a "ps -ef|grep <E1UserID>"

Alternatively I have also been able to query the F986110 to get the job number, and here is what can help uniquely identifying the job number to an extent.

Within your script before you launch the runube command , query the F986111 table (This is a server map table , and will be in the same server map as your job master) , to get the current value for JCJOBNBR where JCEXEHOST is the server you are running the job on. So

SELECT JCJOBNBR FROM <SCHEMA>.F986111 WHERE JCEXEHOST = <E1 server Name>

This table is the job number master file and will contain the job number assigned to the last job that was submitted on that server.

Once you have gotten this job number store it in a variable(JobNumberFrom) and then launch your runube command . Once the command returns rerun the above query and store the jobnumber returned in another variable (JobNumberTo)

Now you have a definite range of job numbers to search for your specific job , which can narrow down the list greatly

So your final query would be something like this


SELECT JCJOBNBR , JCFNDFUF2 , JCJOBSTS FROM <SCHEMA>.F986110 WHERE JCEXEHOST = <E1 Server Name> AND JCJOBNBR BETWEEN <JobNumberFrom> and <JobNumberTo> and JCFNDFUF2 like '<UBE_Name>_<VersionName>%'

Hope this gives you an idea of how you can proceed.
 
Back
Top