Infor M3 #8 -- How to debug an autojob

How to debug an auto job


What is a batch job?

A batch job is a program which runs on the batch subsystem, in Infor M3 we have multiple subsystems. Within the  M3 Business Engine system redirects the memory allocations based on the type of program initiated.

Below are the available subsystems in M3BE, we will discuss subsystems in a separate post.
  • Subsystem M (M3 API)
  • Subsystem A (M3 Auto jobs)
  • Subsystem B (M3 Batch jobs)
  • Subsystem I (M3 Interactive)
  • Subsystem D (M3 Debug)

What is an Auto job?

An auto start job is a batch job doing repetitive work or one-time initialization work. Defined autostart jobs are automatically started each time the ASJ subsystem is started. M3 contains a number of predefined autostart jobs. It is possible to run parallel autostart jobs. 
These auto jobs can be maintained using two programs
  • Subsystem. Open (MNS050)
  • Subsystem Job. Open(MNS051)
Generally, we use this auto jobs where we need to do some process continuously within the given interval.
Sometimes we may need to debug these auto jobs to find out if anything is wrong or to find out the normal flow how this job is being executed and what tables are being updated etc.,

How to debug an auto job?

  • As discussed earlier in the post, MNS050 and MNS051 plays a major role in auto jobs
  • Open MNS050, and select the subsystem in which your job is present (there can be multiple subsystems depending on your business)
  • Using related option 11(Job in sbs), open MNS051 where you can see all the jobs under the selected subsystem
MNS050:
MNS051:

  • Using the filter, select the job which you want to debug and using related option 10 (End job), end the ASJ job
  • Status of job would be changed from 20 to 10 which means the job is in the preliminary state
  • Using related option 2 (Change), go to panel E (Details) where you can configure the below details on which the ASJ should be running
    • Company
    • Division
    • System language
    • User
  • It is not mandatory to fill all of them, you can leave them blank as per your need. If you leave anything blank then the system would check the details of the subsystem in MNS050/E and the USER ID attached to it will act as the ASJ user. Properties like Company, division, language etc., of that user will be taken from MNS150
  • Once you have configured the ASJ job, go to MAK and deploy the ASJ into the sandbox
  • Make sure the user ID which you have configured in MNS051 and Debug user is same
  • Once you are ready with debugging, in MNS051 using related option 9 (Str job) you can restart the job

  • If the ASJ started successfully, upon a hit you would be able to see the ASJ thread suspended at the breakpoint in eclipse


Thank you so much Tejaswini Pharande for helping me on this post ðŸ˜Š


That's it, come back here and tell us about the before-and-after. I bet you'll have something to say!

Please let me know your thoughts in the comment section below!

If you enjoyed this post, I'd be very grateful if you'd help it spread by emailing it to a friend, or sharing it on Twitter or LinkedIn.

In our next post let us see about Aggregate functions in DB instances (Tables).

Thanks for reading!

--Saiteja Saadi





Comments

Post a Comment