Posted: Wed Oct 17, 2007 8:14 am Post subject: Running background tasks in MVS
Hi All
First of all if anyone feels that i am posting this in the wrong forum then please admins, please move it to the right one.
I am currently involved in a design for one of our projects where in we have an online process whcih will store some data in the database. The online program at the same time triggers a batch program which in turn triggers CA-7 which will initiate a flow of batch programs to process the DB. The batch process then sends information thru MQ to the client systems. this sending of messages takes about 30 secs. Everytime the online function isaccessed this chain of events take place and this is causing a lrge number of jobs to be submitted in the sytem which is causing huge perfomance issues.
My question here is is there any means to have a MVS 'task' which sleeps throghout the time and whenthe online trigger happens some kind of background process gets waken up and does all this processing and then it sleeps off again. The whole idea is to reduce the number os jobs runs thereby increasing perfomance.
any brainstormed ideas are welcome.
please let me know if i have put across my questions to the fullest possible extend. I am happy to share more information on the same. _________________ Thanks and Regards..
Rajesh
Joined: 03 Jan 2003 Posts: 1014 Topics: 13 Location: Atlantis
Posted: Wed Oct 17, 2007 12:22 pm Post subject:
This is one of the scenarios for which a server address space might work. That would run as a started task. The main difficulties in designing such an application are data transport (getting the request to the address space and receiving results) and authentication (insuring that requests from unauthorized users are rejected and logged). The data transport mechanism can probably be accomplished with MQ since you are using that already, or the task could wait on a TCP/IP socket or similar. MQ would, I assume, have the advantage that it already does the request queuing. The authentication problem is the trickier part. Again, MQ might be able to be used for this (I don't know MQ at all), but if it does not have built in authentication of the request origin, or if the origin can be spoofed, then you'd need to have some other means of sending data in. I think that in most cases, data transport is done through memory transfers or similar, and the request can be verified as coming through an already authenticated (logged on) user by having the receiving address space run some control blocks. This probably requires authorized code, as would the necessary SAF (RACF, ACF/2, TopSecret) calls to check on authorization. The only system I ever worked on that did this used an SVC to transfer the data but that is no longer considered good practice (if it ever was at all).
Depending on your security needs, you might be able to use a much simpler design though. Lets consider that you are already storing the data into a data base. If you are willing to guarantee that the database can only be updated by clients that have authority to start this process, then it could follow that since the server address space is going to get its data from there, then it does not have to worry about authentication because access to write the initial data was sufficient authentication. If the data base can be written by others, however, then you'd still want a means of insuring that the data being processed by the server and the request to process it both come from the same authorized user.
The server should be written so that each request is treated as if it were in an isolated environment, meaning it should reinitialize itself for each request much like CICS does (with consideration given to maintaining some files and queues open across requests for performance reasons). Additionally, you might be able to make the server multithreaded so that it can process multiple requests at once... but if you are going to do all that...
Which leads to another solution... Can the whole process be done in CICS as a series of transactions? Maybe not in the same region for performance reasons, but CICS already does everything you'd need to do if you wrote your own server. _________________ New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
I think the writing a new Terminal Controlling Address Space will be the best solution to go ahead.
yes the MQ setup we have has its own acknowledging and negotiating mechanisms so it is secure. And yes the databse is written bu authenticated programs and processes so the Address space request will be legitimate.
Now let me come to the tiughest part of the issue. How do i write a new TCAS? After i write such a Address Space i assume it needs to be initiated as a tsk by some external process. How will my online program (we use ADSO) send a request tot his address space.
Any more ideas and any reference materials on the same will be appreciated.
Once more thanks for the pointers. _________________ Thanks and Regards..
Rajesh
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
Posted: Thu Oct 18, 2007 9:02 am Post subject:
How does your online program trigger a batch job today? Can it be changed to send a message via MQ? If so, write a program that does a GET WAIT on a queue looking for the message from the online program that the database update is complete. Thus your program will be "sleeping" until a message appears.
Once a message appears and your pgm GETs it, decide how much of the former batch processing can be handled within your program. You may need to send msgs and trigger other task programs to handle parts of the process.
This would stop the requirement to submit batch jobs that spend a great deal of time initiating and terminating when run repeatedly. _________________ Regards,
Bill Dennis
Disclaimer: My comments on this foorum are my own and do not represent the opinions or suggestions of any other person or business entity.
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum