Wow, this takes me back a few years! :-)> We haven't run CMSBATCH for a long time, (we use VM:Batch). When we did run CMSBATCH, we used BATEXIT2 to handle our special 10 character accounting numbers. We kept the first character of the directory account field, then converted the first seven
characters of the user's account number to binary, (the first seven characters were always numeric), and stored them in bytes 2-5 and then moved the last three bytes of the user's account number into bytes 6-8, (the last three characters were sometimes numeric, sometimes alphabetic). We never used/needed BATEXIT1. Here is my code for BATEXIT2, (minus sequence numbers), written/revised in February of 1987! BATEXIT2 TITLE 'Documentation' *---------------------------------------------------------------------* * BATEXIT2 ASSEMBLE * * * * Module Name - * * * * BATEXIT2 * * * * Function - * * * * CMS Batch User Exit to allow installations to use the /JOB * * Card for additional installation specific information and * * to allow the /JOB Card to be altered. * * * * Attributes - * * * * Disk Resident in Relocatable Text Format; * * Executes in the CMS User Area; * * Serially Reusable. * * * * Entry Points - * * * * BATEXIT2 - Primary and only entry point. * * * * Entry Conditions - * * * * Invoked from the CMS Batch Facility (CMSBATCH), via Load. * * * * On Entry - * * * * R1 = CMS Parameter List Address. * * R13 = Address of Register Save Area provided by the Caller. * * R14 = Return Address. * * R15 = Entry Point Address. * * * * Exit Conditions - * * * * R0-R14 Unchanged. * * R15 = Return Code, Non-Zero if Batch Job is to be Flushed. * * * * Calls to other Routines - * * * * MACROs Called by this Routine are: * * (in Alpabetical Order) * * * * REGEQU - CMS Symbolic Register Equates. * * * * Programs Called by this Routine are: * * (in Alpabetical Order) * * * * None. * * * * CMS Functions Called by this Routine are: * * (in Alpabetical Order) * * * * None. * * * * External References - * * * * None. * * * * Tables/Workareas - * * * * DWORD - Double Word Work Area. * * HOLD - Used to hold and test the Accounting Type. * * JOBPARMS - DSECT used to reference the /JOB Card fields * * that were passed in Register 1. * * * * Register Usage - * * * * The Register Usage conforms to the following: * * * * R0 - Work Register * * R1 - JOBPARMS DSECT Base Register (CMS Parameters) * * R2 - Work Register * * R3 - Work Register * * R4 - Work Register * * R5 - Work Register * * R6 - Work Register * * R7 - Work Register * * R8 - Work Register * * R9 - Work Register * * R10 - Work Register * * R11 - Work Register * * R12 - Program Base Register * * R13 - Address of Register Save Area in this Program * * R14 - Return Address to Caller * * R15 - Return Code * * * * Error Messages, ABEND Codes, and Return Codes - * * * * RC=0 - Normal Return Code, no errors detected. * * RC=4 - Error in /JOB Card, Flush this Job from the Reader. * * * * Operation - * * * * The BATEXIT2 Program is invoked by the CMS Batch Facility * * during Batch Job initialization. BATEXIT2 receives control * * before the CMS routine used to process the /JOB Card, but * * after CMS has scanned the /JOB Card and built the parameter * * list. On entry to BATEXIT2, Register 1 points to the CMS * * parameter list buffer. This buffer is a series of 8-byte * * entries, one for each item on the /JOB Card. * * * * After verifying that all of the expected fields are on the * * /JOB Card, (valid fields are described in JOBPARMS DSECT), * * BATEXIT2 will pack the numeric part of the account number, * * convert it to binary and store it in ACCNT1. The alphabetic * * part of the account number will then be moved into ACCNT1 * * after the binary part. The remaining fields of the /JOB * * Card, (JOBNAME, JOBID, and FENCE), will be shifted to the * * left one field postion (8 bytes) to conform to Batch /JOB * * Card standards (as documented in the "CMS User's Guide"). * * The first byte of the ACCNT1 field, (accounting type), will * * be changed back to the correct letter from the hex code that * * was set in the ACNTGET Program. * * * * If an error is detected, BATEXIT2 will exit with a return * * code of 4, which will cause CMS Batch to flush the job. A * * return code of 0 will let the Batch job start execution. * * * * Updates - * * * * 02/27/87 (DRS) * * Revised version put into production. * *---------------------------------------------------------------------* TITLE 'Entry Linkage' BATEXIT2 CSECT , In the Beginning... USING BATEXIT2,R15 Get Temporary Addressability B PASTID Branch Around ID and Save Area SPACE 1 DC CL9'BATEXIT2' Module Name DC CL9'&SYSDATE' Date Assembled DC CL6'&SYSTIME' Time Assembled SPACE 1 SAVEAREA DC 18A(0) Our Register Save Area SPACE 1 PASTID DS 0H DROP R15 Drop Temporary Addressability STM R14,R12,12(R13) Save the Registers LR R12,R15 Load Our Base Register and USING BATEXIT2,R12 Get Permanent Addressability ST R13,SAVEAREA+4 Point Our S/A to Caller's (HSA) LR R15,R13 Save Address of Caller's S/A LA R13,SAVEAREA Point to Our Save/Area ST R13,8(R15) Point Caller's S/A to Ours (LSA) TITLE 'Validate and Reformat the CMS Batch /JOB Card' BATJOBC DS 0H USING JOBPARMS,R1 Map Job Parms in R1 to DSECT CLI USERID,X'FF' CMS Userid Present ? BE FLUSH No, Bad Job Card - Flush the Job CLI ACCNT1,X'FF' First Part of Account Present ? BE FLUSH No, Bad Job Card - Flush the Job CLI ACCNT2,X'FF' Second Part of Account Present ? BE FLUSH No, Bad Job Card - Flush the Job CLI JOBNAME,X'FF' CMS Jobname Present ? BE FLUSH No, Bad Job Card - Flush the Job CLI JOBID,X'FF' Batch JobID Present BE FLUSH No, Bad Job Card - Flush the Job PACK DWORD,ACCNT1+1(7) Pack Numeric Portion of Account CVB R4,DWORD Convert it to Binary STCM R4,B'1111',ACCNT1+1 Fill in Account Number MVC ACCNT1+5(3),ACCNT2 Move Alpha Portion of Account MVC ACCNT2(24),JOBNAME Shift Jobname, JobID and Fence TM ACCNT1,X'C0' Bit 0 or 1 On ? BNZ FLUSH Yes, Flush this Job MVC HOLD,ACCNT1 Save the Accounting Type NI ACCNT1,X'0F' Clear the Zone Portion TM HOLD,B'00110000' Was it a "F" Zone ? BO SETF Yes, Set Code for "F" Zone TM HOLD,B'00100000' Was it a "E" Zone ? BO SETE Yes, Set Code for "E" Zone TM HOLD,B'00010000' Was it a "D" Zone ? BO SETD Yes, Set Code for "D" Zone OI ACCNT1,X'C0' Put "C" Zone Back B GOOD Exit with a Good Return Code SPACE 1 SETF DS 0H OI ACCNT1,X'F0' Put "F" Zone Back B GOOD Exit with a Good Return Code SPACE 1 SETE DS 0H OI ACCNT1,X'E0' Put "E" Zone Back B GOOD Exit with a Good Return Code SPACE 1 SETD DS 0H OI ACCNT1,X'D0' Put "D" Zone Back B GOOD Exit with a Good Return Code SPACE 1 GOOD DS 0H XR R15,R15 Set Return Code to Zero B EXIT Go to Exit SPACE 1 FLUSH DS 0H LA R15,4 Set a Flush Return Code B EXIT Go to Exit TITLE 'Exit Linkage' EXIT DS 0H L R13,4(R13) Point to Caller's S/A (HSA) L R14,12(R13) Restore Register 14 LM R0,R12,20(R13) Restore the Registers BR R14 Return to Caller TITLE 'Working Storage and Data Constants' SPACE 1 DWORD DS D Double Word Work Area SPACE 1 HOLD DC C' ' Area to Hold Accounting Type SPACE 1 LTORG , Create Literal Pool REGEQU , CMS Register Equate Macro SPACE 1 *---------------------------------------------------------------------* * JOBPARMS DSECT - CMS Parameter List * *---------------------------------------------------------------------* JOBPARMS DSECT , CMS Batch Job Card Parms JOB DS CL8 Job Card Identifier USERID DS CL8 CMS Userid ACCNT1 DS CL8 First Part of Accounting Info ACCNT2 DS CL8 Second Part of Accounting Info JOBNAME DS CL8 CMS Jobname JOBID DS CL8 CMS Batch JobID FENCE DS CL8 CMS Fence SPACE 1 END BATEXIT2 That's All Folks... -- Dale R. Smith On Mon, 6 Oct 2008 15:31:38 -0500, Thomas Kern <[EMAIL PROTECTED]> wrote: >I have had to do some work recently that takes a very long time to run b ut >still needed to use my own virtual machine for other tasks. Ideal for a >batch facility. Well, we don't have a BATCH product and I haven't done much >work on the LARS/Purdue Batch Monitor and I did not want to define a special >virtual machine for this. So, I fired up the default CMSBATCH server. We >never removed it, just nologged it. It was easy to fire up and get my >process running because my process is simplistic but time consuming. > >But in looking at the documentation for CMSBATCH, I saw some information >about the two defined exits BATEXIT1 and BATEXIT2, but I cannot find any >samples supplied by IBM nor any postings on the old VMSHARE or on this list. >I would be interested in seeing any versions of BATEXIT1/BATEXIT2 that >anyone has ever used for IBM's vanilla CMSBATCH facility. > >/Tom Kern