Sample JES3 exit to analyze JECL usage
This appendix includes sample code for JES3 user exit 33 that helps you detect the use of JCL or JECL statements that require reviewing and possibly replacing as part of the move to JES2.
 
Copyright license and permission to copy: This appendix contains a sample application program in source language that illustrates programming techniques. You might copy, modify, and distribute this sample program in any form without payment to IBM, for the purposes of developing, using, marketing, or distributing application programs conforming to the application programming interface for the operating platform for which the sample program is written. This example has not been thoroughly tested under all conditions. IBM, therefore, cannot guarantee or imply reliability, serviceability, or function of this program.
 
Sample JES3 user exit 33
Sample code for detecting JCL and JECL is shown in Example A-1.
Example A-1 Sample code for detecting JCL and JECL
UX33 TITLE 'JES3 CONTROL STATEMENT USER EXIT' 00010000
IATUX33 AMODE 31 00011000
IATUX33 RMODE ANY 00012000
IATYASM 00013000
*START OF SPECIFICATIONS********************************************** 00020000
* * 00021000
* MODULE-NAME = IATUX33 * 00022000
* * 00023000
* $MOD(IATUX33) PROD(JES3): * 00030000
* * 00040000
* DESCRIPTIVE NAME= * 00050000
* JES3 CONTROL STATEMENT USER EXIT * 00060000
* * 00070000
* *01* PROPRIETARY STATEMENT= * 00080000
* **PROPRIETARY_STATEMENT******************************************** 00090000
* * 00091000
* * 00100000
* LICENSED MATERIALS - PROPERTY OF IBM * 00110000
* THIS MODULE IS "RESTRICTED MATERIALS OF IBM" * 00120000
* 5694-A01 COPYRIGHT IBM CORP. 2013 * 00130000
* * 00140000
* STATUS= HJS7780 * 00150000
* * 00160000
* **END_OF_PROPRIETARY_STATEMENT************************************* 00170000
* * 00171000
* Input Registers = * 00190000
* R0 Irrelevant * 00200000
* R1 Address of current JCL statement * 00210000
* R2-R9 Irrelevant * 00220000
* R10 IATUX33 base register * 00230000
* R11 IATYFCT address * 00240000
* R12 IATYTVT address * 00250000
* R13 IATYISD input service data area * 00260000
* R14 Return address * 00270000
* R15 Entry point address * 00280000
* * 00290000
* Entry purpose = * 00300000
* IATUX33 is entered for each logical record of JCL * 00310000
* EXEC statements and for JES3 control statements * 00320000
* except DATASET/ENDDATASET. * 00330000
* * 00340000
* * 00350000
* Input = R1 points to the current JCL record * 00360000
* * 00370000
* Exit = ARETURN=0 * 00380000
* * 00390000
* *** R1 MUST NOT BE CHANGED *** * 00400000
* * 00410000
* Output = JES3 JECL statements have been tracked. * 00420000
* * 00430000
* * 00440000
*END OF SPECIFICATIONS************************************************ 01350000
* * 01370000
* Turn tracking on: SETCON TRACKING=ON * 01373000
* * 01374000
* Turn tracking off: SETCON TRACKING=OFF * 01375000
* * 01376000
* Display data: DISPLAY OPDATA,TRACKING * 01377000
* * 01378000
* Clear tracked data by turning tracking off and then on. * 01379000
* * 01380000
*************************************************************** 01381000
COPY IATYGLOB 01382000
IATUX33 START 01383000
TITLE 'JES3 General Equates' 01384000
IATYEQU 01385000
TITLE 'JES3 General Registers' 01386000
IATYREG 01387000
TITLE 'JES3 TVT' 01388000
IATYTVT 01389000
TITLE 'JES3 Job Control Table' 01390000
IATYJCT 01391000
TITLE 'JES3 Input Service Data Area' 01392000
IATYISD 01393000
TITLE 'Security Control Block' 01394000
IATYSEC 01395000
TITLE 'Tracking Facility Request Parameters' 01396000
CNZTRPL , 01397000
TITLE 'Job Data Accounting Block' 01398000
IATYJDA 01399000
TITLE 'Local DSECT for info field' 01400000
U33CNZDE DSECT 01401000
DESC1 DC CL3'' Eyecatcher = J3: 01402000
DESC2D DC CL3'' Input service day 01403000
DESC2H DC CL2'' Input service hour 01404000
DESC2M DC CL2'' Input service minute 01405000
DESC3 DC CL2'' JECL card detected and space 01406000
DESC4 DC CL8'' Job name 01407000
DESC5 DC CL8'' User ID/POE 01408000
TITLE 'JES3 Control Statement User Exit 33' 01550000
*-------------------------------------------------------------* 01551000
* IATUX33 entry point * 01552000
*-------------------------------------------------------------* 01553000
IATUX33 CSECT 01556000
LR R10,R15 Establish module base 01560000
USING IATUX33,R10 Establish using for module 01570000
USING IATISDT,R13 Input service work area 01580000
IATYMOD BR=YES Module entry point ID 01590000
SPACE 1 01600000
*-------------------------------------------------------------* 01610000
* Save statement address and zero the CNZ parm area. * 01620000
*-------------------------------------------------------------* 01630000
LR R9,R1 Save JCL statement address 01640000
LA R8,UX33WA Get work area address 01650000
USING TRPL,R8 CNZTRKR parameter list 01660000
INFO USING U33CNZDE,TRPL_Track_Info CNZTRKR info field 01670000
XC TRPL(TRPL_LEN),TRPL Clear the parm list 01680000
*-------------------------------------------------------------* 01690000
* Is current statement //*MAIN or /*MAIN * 01700000
*-------------------------------------------------------------* 01710000
CLC T33TMAN,0(R9) Check for //*MAIN 01720000
JE UX33C005 If yes, handle it 01730000
CLC 1+T33TMAN(L'T33TMAN-1),0(R9) Check for /*MAIN 01740000
JNE UX33C220 If not, continue checking 01750000
UX33C005 DS 0H 01760000
MVC INFO.DESC3,T33TMAO Indicate MAIN 01770000
J UX33T800 Go track stmt 01780000
*-------------------------------------------------------------* 01790000
* Is current statement //*PROCESS * 01800000
*-------------------------------------------------------------* 01810000
UX33C220 DS 0H 01820000
CLC T33TPRC,0(R9) Check for //*PROCESS 01830000
JE UX33C225 If yes, handle it 01840000
CLC 1+T33TPRC(L'T33TPRC-1),0(R9) Check for /*PROCESS 01850000
JNE UX33C240 If not, continue checking 01860000
UX33C225 DS 0H 01870000
MVC INFO.DESC3,T33TPRO Indicate PROCESS 01880000
J UX33T800 Go track stmt 01890000
*-------------------------------------------------------------* 01900000
* Is current statement //*ENDPROCESS * 01910000
*-------------------------------------------------------------* 01920000
UX33C240 DS 0H 01930000
CLC T33TEPR,0(R9) Check for //*ENDPROCESS 01940000
JE UX33C245 If yes, handle it 01950000
CLC 1+T33TEPR(L'T33TEPR-1),0(R9) Check for /*ENDPROCESS 01960000
JNE UX33C260 If not, continue checking 01970000
UX33C245 DS 0H 01980000
MVC INFO.DESC3,T33TEPO Indicate ENDPROCESS 01990000
J UX33T800 Go track stmt 02000000
*-------------------------------------------------------------* 02010000
* Is current statement //*FORMAT * 02020000
*-------------------------------------------------------------* 02030000
UX33C260 DS 0H 02040000
CLC T33TFRM,0(R9) Check for //*FORMAT 02050000
JE UX33C265 If yes, handle it 02060000
CLC 1+T33TFRM(L'T33TFRM-1),0(R9) Check for /*FORMAT 02070000
JNE UX33C280 If not, continue checking 02080000
UX33C265 DS 0H 02090000
MVC INFO.DESC3,T33TFRO Indicate FORMAT 02100000
J UX33T800 Go track stmt 02110000
*-------------------------------------------------------------* 02120000
* Is current statement //*NET * 02130000
*-------------------------------------------------------------* 02140000
UX33C280 DS 0H 02150000
CLC T33TNET,0(R9) Check for //*NET 02160000
JNE UX33C300 If not, continue checking 02170000
MVC INFO.DESC3,T33TNEO Indicate NET 02180000
J UX33T800 Go track stmt 02190000
*-------------------------------------------------------------* 02200000
* Is current statement //*NETACCT * 02210000
*-------------------------------------------------------------* 02220000
UX33C300 DS 0H 02230000
CLC T33TNTA,0(R9) Check for //*NETACCT 02240000
JNE UX33C320 If not, continue checking 02250000
MVC INFO.DESC3,T33TNTO Indicate NETACCT 02260000
J UX33T800 Go track stmt 02270000
*-------------------------------------------------------------* 02280000
* Is current statement //*ROUTE * 02290000
*-------------------------------------------------------------* 02300000
UX33C320 DS 0H 02310000
CLC T33TRTE,0(R9) Check for //*ROUTE 02320000
JNE UX33C340 If not, continue checking 02330000
MVC INFO.DESC3,T33TRTO Indicate ROUTE 02340000
J UX33T800 Go track stmt 02350000
*-------------------------------------------------------------* 02360000
* Is current statement //*OPERATOR * 02370000
*-------------------------------------------------------------* 02380000
UX33C340 DS 0H 02390000
CLC T33TOPR,0(R9) Check for //*OPERATOR 02400000
JE UX33C345 If yes, handle it 02410000
CLC 1+T33TOPR(L'T33TOPR-1),0(R9) Check for /*OPERATOR 02420000
JNE UX33T900 If not, done checking 02430000
UX33C345 DS 0H 02440000
MVC INFO.DESC3,T33TOPO Indicate OPERATOR 02450000
J UX33T800 Go track stmt 02460000
*-------------------------------------------------------------* 02470000
* Track JES3 JECL statement usage * 02480000
*-------------------------------------------------------------* 02490000
UX33T800 DS 0H 02500000
MVC TRPL_ACRO,=CL4'TRPL' Set parm list eye catcher 02510000
MVI TRPL_VERSION,TRPL_K_JBB7727 Set parm list version 02520000
ST R10,TRPL_VIOLATORS_ADDR Set event address 02530000
MVC INFO.DESC1,=CL3'J3:' Indicate JES3 event 02540000
*-------------------------------------------------------------* 02550000
* Include day and time the job went through input * 02560000
* service. The format is DDDHHMM where: * 02570000
* DDD = day of the year * 02580000
* HH = hour of day * 02590000
* MM = minutes * 02600000
* This uses DESC4 as a work area. * 02610000
*-------------------------------------------------------------* 02620000
L R7,JDABADDR Get JDAB 02630000
USING JDABSTRT,R7 JDABSTRT 02640000
UNPK INFO.DESC2D,IRDATON Set day 02650000
L R15,IRTIMON Get hundredths of seconds +02660000
since midnight 02670000
XR R14,R14 Clear for divide 02680000
D R14,=F'360000' Get hours 02690000
CVD R15,INFO.DESC4 Convert to packed dec 02700000
OI INFO.DESC4+7,X'0F' Turn on sign bits 02710000
UNPK INFO.DESC2H,INFO.DESC4+5(3) Make printable 02720000
LR R15,R14 Move remainder to R15 02730000
XR R14,R14 Clear for divide 02740000
D R14,=F'6000' Get number of minutes 02750000
CVD R15,INFO.DESC4 Convert to packed dec 02760000
OI INFO.DESC4+7,X'0F' Turn sign bits on 02770000
UNPK INFO.DESC2M,INFO.DESC4+5(3) Make printable 02780000
*-------------------------------------------------------------* 02790000
* Add job name and user ID * 02800000
*-------------------------------------------------------------* 02810000
MVC INFO.DESC4,JDABJNAM Indicate job name 02820000
MVC INFO.DESC5,ISTUSID Indicate user ID 02830000
DROP R7 JDABSTRT 02840000
*-------------------------------------------------------------* 02850000
* Track the event. * 02860000
*-------------------------------------------------------------* 02870000
CNZTRKR (R8) Track the event 02880000
*-------------------------------------------------------------* 02890000
* Replace user ID with port of entry (POE). * 02900000
*-------------------------------------------------------------* 02910000
MVC INFO.DESC5,ISDPOE Set port of origin 02920000
*-------------------------------------------------------------* 02930000
* Track a second time, now with POE. * 02940000
*-------------------------------------------------------------* 02950000
CNZTRKR (R8) Track the event 02960000
DROP R8 CNZTRKR parms 02970000
*-------------------------------------------------------------* 02980000
* Setup for return * 02990000
*-------------------------------------------------------------* 03000000
UX33T900 DS 0H 03010000
LR R1,R9 Restore JCL statement address 03020000
LA R15,0 Always use normal return 03030000
ARETURN Return to caller 03040000
*-------------------------------------------------------------* 03050000
* IATUX33 module work area * 03060000
*-------------------------------------------------------------* 03070000
UX33WA DC CL(TRPL_LEN)'' 03080000
*-------------------------------------------------------------* 03090000
* IATUX33 module constants * 03100000
*-------------------------------------------------------------* 03110000
T33TRTE DC CL9'//*ROUTE ' 03120000
T33TRTO DC CL2'R' 03130000
T33TFRM DC CL10'//*FORMAT ' 03140000
T33TFRO DC CL2'F' 03150000
T33TPRC DC CL11'//*PROCESS ' 03160000
T33TPRO DC CL2'P' 03170000
T33TEPR DC CL14'//*ENDPROCESS ' 03180000
T33TEPO DC CL2'E' 03190000
T33TMAN DC CL8'//*MAIN ' 03200000
T33TMAO DC CL2'M' 03210000
T33TOPR DC CL12'//*OPERATOR ' 03220000
T33TOPO DC CL2'O' 03230000
T33TNTA DC CL11'//*NETACCT ' 03240000
T33TNTO DC CL2'A' 03250000
T33TNET DC CL7'//*NET ' 03260000
T33TNEO DC CL2'N' 03270000
*-------------------------------------------------------------* 03280000
* IATUX33 epilog * 03290000
*-------------------------------------------------------------* 03300000
IATXPTCH LT Expand literals 03310000
APARNUM DC CL7' ' APAR number 99999997
PTFNUM DC CL7'&J3REL ' PTF number 99999998
END IATUX33 99999999
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset