Yes It is very possible that the client request has caused the server to allocate resources and if the caller goes away while SUSPENDed - maybe by an operator CANCEL - then it is preferable to have a way that the server can be informed.
The way that I have accomplished this in the past is for the task level resource manager routine to PC-ss back into the server address space and add a "TCB gone" request block onto a special queue in the server private. This "TCB Gone" request would include the ASID and TCB of the caller so that the server can remove any outstanding requests that match and cleanup any associated resources obtained on its behalf. Rob Scott Lead Developer Rocket Software 77 Fourth Avenue . Suite 100 . Waltham . MA 02451-1468 . USA Tel: +1.781.684.2305 Email: [email protected] Web: www.rocketsoftware.com -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of [email protected] Sent: 22 May 2014 11:55 To: [email protected] Subject: Re: Program Call Vs SVC Rob Scott wrote > Task and ASID level resource manager routines to handle >both "client > gone while SUSPENDed" and "server gone >unexpectedly" situations . . Rob could you elaborate on the bullet above ... Are You suggesting that the PC Service Provider be notified when the client has abended while it (client) is suspended ?? Paul D'Angelo ---------- Original Message ---------- From: Rob Scott <[email protected]> To: [email protected] Subject: Re: Program Call Vs SVC Date: Thu, 22 May 2014 10:26:21 +0000 Peter, Maybe part of the reason that there is not a lot of example source is that a responsible PC routine provider must establish quite a bit of plumbing to ensure system and application integrity that goes beyond just using the ETDEF and LXRES macro services. This is especially true for PC space-switch routines (PC-ss) rather than simple current primary (PC-cp). I suppose a PC-cp could be written to replace a SVC routine more easily than composing a PC-ss to perform some sort of client/server application request (which is the interesting stuff!) IMHO a person embarking on writing a PC routine should be armed with at least the following : (o) Knowledge of how to safely move data between client and server without breaking system integrity. There are so many bad examples of supervisor/key0 code out there in the public domain that just copy data without any due care and attention. Just because your code is in key0 and it is easy to use MVC to return data to your caller not matter the key does not mean that you should. A decent PC routine is always transferring data to and from the caller in the execution key of the caller. In fact, I recommend a PPT entry in SCHEDxx to declare your server jobstep program to execute in a non-zero system key - key 2 and 4 are currently seen to be available in so much as there is no major z/OS system component famously using them. (1 = JES, 3 =AVM,5=DFP,6=VTAM, 7=DB2, IMS and MQ) (o) A method to issue messages, diagnostics and trace events in H<>P<>S environments and other exotic environments (o) The habit of checking the "Environment" section of any service that they call - now that your code could be running H<>P<>S or locked, some of your favourite services may no longer be available to you. (o) A method to add request blocks onto a queue in server private - for example something using PLO (there have been discussions about this on IBM-Main) (o) Familiarity with SUSPEND/RESUME services so that you caller's request can be handled asynchronously (o) Task and ASID level resource manager routines to handle both "client gone while SUSPENDed" and "server gone unexpectedly" situations (o) Decent recovery routine(s) for ESTAE, FRR and ARR environments I do not believe that it is very common these days for anyone working outside of IBM or an ISV to have the sort of skills or experience of all of the above. It is probably even rarer to find someone in a sysprog team who you can go to for local help if you are writing this stuff - things were different back in the 1980s when sysprog teams were larger and assembler knowledge widespread. If you do have a test system to play on and blessing from your employer, I would recommend that you give it a go. There are people on this list (or maybe even better on IBM-Main) who can help when you hit problems. Rob Scott Lead Developer Rocket Software 77 Fourth Avenue . Suite 100 . Waltham . MA 02451-1468 . USA Tel: +1.781.684.2305 Email: [email protected] Web: www.rocketsoftware.com -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Farley, Peter x23353 Sent: 21 May 2014 22:14 To: [email protected] Subject: Re: Program Call Vs SVC Thanks Rob, I found that one. I'll use it to start curing my ignorance. But my question still stands: Does anyone know if CBT (or any other source) has examples of programming on z hardware with PC? IMHO at least one such example ought to be in Appendix A of the POP, but I know it probably never will be. Maybe there is a redbook/redpiece? I should go look there. Peter -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Rob Scott Sent: Wednesday, May 21, 2014 9:32 AM To: [email protected] Subject: Re: Program Call Vs SVC My colleague Bob Shannon gave a "PC Routines For Dummies" presentation back in the late 1990s that contains example code and explanations of all the major components involved. Google confirms that it can still be found on the web. The presentation was written before ASID and LX reuse, so bear that in mind when reading it and composing your own code. It is well worth a read for someone starting out in this area. Rob Scott Lead Developer Rocket Software 77 Fourth Avenue . Suite 100 . Waltham . MA 02451-1468 . USA Tel: +1.781.684.2305 Email: [email protected] Web: www.rocketsoftware.com -----Original Message----- From: IBM Mainframe Assembler List [mailto:[email protected]] On Behalf Of Farley, Peter x23353 Sent: 21 May 2014 13:50 To: [email protected] Subject: Re: Program Call Vs SVC PC routines are good; OK, I can accept that. But where are the substantial examples of how to properly set up and use them, showing all of the benefits Rob Scott listed below and the other sterling attributes of PC routines which have been mentioned here in the past? I know that ISV's cannot (and should not) reveal proprietary code, but perhaps a generalized example (with set up instructions, please!) of some simple function (an adding machine example comes to mind) from experienced developers on this list would help to train the rest of us in how to use this facility correctly and effectively. The CBT index (File 001) is not entirely useful in searching for such examples. Does anyone here know if the CBT collection has a substantial example (or any example at all) of code using PC? -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
