//MARKA JOB (0),'ASSEMBLE',MSGLEVEL=1,CLASS=A,MSGCLASS=A //ASM EXEC PGM=IFOX00, // PARM='DECK,LOAD,TERM,TEST,SYSPARM((NOSP,NODEBUG)),XREF(SHORT)', // REGION=4096K,COND=(0,NE) //SYSLIB DD DISP=SHR,DSN=SYS1.MACLIB // DD DISP=SHR,DSN=MARK.PROD.LIB.MACROS.ASM //* DD DISP=SHR,DSN=SYS1.AMODGEN //* DD DISP=SHR,DSN=SYS1.ATSOMAC //SYSUT1 DD SPACE=(CYL,(25,5)),UNIT=3350 //SYSUT2 DD SPACE=(CYL,(25,5)),UNIT=3350 //SYSUT3 DD SPACE=(CYL,(25,5)),UNIT=3350 //SYSTERM DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSPUNCH DD SYSOUT=* //SYSGO DD DISP=(MOD,PASS,DELETE),UNIT=SYSDA, // DSN=&&OBJLIB,SPACE=(TRK,(2,2)) //SYSIN DD DATA,DLM=ZZ * --------------------------------------------------------------------- * * WTOBATCH - WRITE ALL THE CARDS IN SYSIN AS WTO MESSAGES * * * --------------------------------------------------------------------- WTOBATCH CSECT STM R14,R12,12(13) BALR R12,R0 USING *,R12 LA R15,SAVEAREA ST R15,8(R13) ST R13,4(R15) LR R13,R15 SPACE 2 BAL R4,GETJOBID GET JOBNAME INVOKING US MVI SYSINMSG,C' ' , erase sysinmsg buffer MVC SYSINMSG+1(L'SYSINMSG-1),SYSINMSG OPEN (SYSIN,(INPUT)) , open sysin file MVC SYSINMSG(8),MID0004I , default message id MVC SYSINMSG+9(8),JOBNAME , jobname for message WTOB1 GET SYSIN MVC SYSINMSG+19(60),0(R1) , allow 60 bytes of sysin line * which we store after jobname MVC SYSINWTO+8(70),SYSINMSG , put 70 bytes of card in wto * ....+....2....+....3....+....4....+....5....+....6....+- ....7....+....8' SYSINWTO WTO ' - ' , we will use a 80 byte field B WTOB1 , get next sysin line EOFSYSIN DS 0F CLOSE (SYSIN) , done with the sysin messages WTORPGMX L R13,4(R13) LM R14,R12,12(R13) SLR R15,R15 BR R14 EJECT * -------------------------------------------------------------------- * * GETJOBID - * OBTAIN THE JOBNAME OF THE JOB INVOKING US AND STORE IT IN JOBNAME * * A different method is used depending on whether we are a STC and TSU * or not. If we are a STC or TSU we assume TSO so get the userid, * if not then we are a batch job so get the jobname (STC method would * just return init which is not want we want). * * Entry: R4 contains branch back address * Exit : no changes * Data : JOBNAME field will be set correctly * * Notes: * The first block will return INIT for a batch job rather than the * batch job name, but we do the test anyway as this is a faster way * finding out if we are a batch job than the alternative of scanning * the mvs control blocks to work out if we are an STC, TSO or batch. * Also, these four lines will return the TSO userid if we are running * in TSU space which we would need to find out later if we were not a * batch job anyway. * * --------------------------------------------------------------------- GETJOBID EQU * STM R5,R6,GETJSAVE * The first block will return INIT for a batch job rather than the * batch job name, but we do the test anyway as this is a faster way of * finding out if we are a batch job than the alternative of scanning * the mvs control blocks to work out if we are an STC, TSO or batch. * Also, these four lines will return the TSO userid if we are running * in TSU space which we would need to find out later if we were not a * batch job anyway. L R5,16 , addr of CVT pointer L R5,0(R5) , addr of dispatch queue L R5,12(R5) , addr of current ASCB L R5,176(R5) , addr of jobname MVC JOBNAME(8),0(R5) , save into JOBNAME data field CLC JOBNAME(8),INITNAME , is it INIT ? BNE GETJOBIX , no, usefull so will use it * * --- jobname of INIT, so within JES. Get the real jobname --- * , ELSE yes, get batch jobname LA R5,16 , addr of CVT pointer L R6,0(R5) , addr of CVT (dispatch queue) L R5,0(R6) , addr of TCBS L R6,4(R5) , addr of 2nd TCB L R5,180(R6) , addr of JSCB L R6,260(R5) , addr of JCT prefix LA R6,24(R6) , addr of jobname in JCT MVC JOBNAME(8),0(R6) , save into JOBNAME data field GETJOBIX LM R5,R6,GETJSAVE , restore registers BR R4 EJECT * --------------------------------------------------------------------- * D A T A A R E A * --------------------------------------------------------------------- SAVEAREA DS 18F , save area for program GETJSAVE DS 2F , save registers for getjobname INITNAME DC C'INIT ' , for tests JOBNAME DC CL8' ' , store jobname SYSINMSG DS CL80 , to build wto from sysin MID0004I DC C'MID0004I' LASTCC DS F SYSIN DCB DDNAME=SYSIN,MACRF=(GL),DSORG=PS,EODAD=EOFSYSIN * SPACE 2 R0 EQU 0 R1 EQU 1 R2 EQU 2 R3 EQU 3 R4 EQU 4 R5 EQU 5 R6 EQU 6 R7 EQU 7 R8 EQU 8 R9 EQU 9 R10 EQU 10 R11 EQU 11 R12 EQU 12 R13 EQU 13 R14 EQU 14 R15 EQU 15 END ZZ //LKED1 EXEC PGM=IEWL, // PARM='XREF,LIST,LET,TEST,AC=0', // REGION=1024K,COND=(0,NE) //SYSLMOD DD DSN=SYS9.LINKLIB(WTOBATCH),DISP=SHR //SYSLIN DD DSN=&&OBJLIB,DISP=(OLD,DELETE,DELETE) //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(8,1)) //SYSPRINT DD SYSOUT=* //LKED2 EXEC PGM=IEWL, // PARM='XREF,LIST,LET,TEST,AC=0', // REGION=1024K,COND=(0,NE) //SYSLMOD DD DSN=SYS9.LINKLIB,DISP=SHR //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(8,1)) //SYSPRINT DD SYSOUT=* //SYSLIN DD * INCLUDE SYSLMOD(WTOBATCH) ENTRY WTOBATCH NAME WTOBATCH(R) /* //