JV macros, without ONEVT macro
The following sample program SRC.BJV illustrates the use of certain JV macros:
Source program SRC.BJV
BJV START PRINT NOGEN BALR 3,0 USING *,3 STAJV JV.A,STA,120,OUTPUT=NEW,VERSION=4 —————————————————————— (1) DTH1 DCLJV JV.A,LINK=*LINK,VERSION=1 —————————————————————————————— (2) MVC STA,NULL2 STAJV JV.,STA,120,OUTPUT=NEW,VERSION=4 ——————————————————————— (3) DTH2 CATJV JV.A,JV.N,STATE=U,RDPASS=C'JV',VERSION=1 SETJV JV.N,SET1,PASS=C'JV',VERSION=1 GETJV JV.N,GET,30,PASS=C'JV',VERSION=1 DTH3 MVC GET,NULL1 SETJV (JV.N,3,4),SET2,PASS=C'JV',VERSION=1 ——————————————————— (4) GETJV JV.N,GET,30,PASS=C'JV',VERSION=1 DTH4 MVC GET,NULL1 SETJV JV.N,SET2,PASS=C'JV',VERSION=1 ————————————————————————— (5) GETJV JV.N,GET,30,PASS=C'JV',VERSION=1 DTH5 MVC GET,NULL1 ERAJV JV.N,VERSION=1 ————————————————————————————————————————— (6) DTH6 MVC STA,NULL2 STAJV JV.,STA,120,OUTPUT=NEW,SELADDR=SEL1,VERSION=4 —————————— (7) DTH7 ERAJV JV.N,PASS=C'JV',VERSION=1 —————————————————————————————— (8) * DTH8 TERM ************************************************ DS 0F STA DS L120 * SEL1 JVSEL MF=L,PASS=RDPASS * GET DS L50 * SET1 DC Y(SETEND1-SET1) DS CL2 DC 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' SETEND1 EQU * * SET2 DC Y(SETEND2-SET2) DS CL2 DC '34567' SETEND2 EQU * * NULL1 DS 0CL50 NULL2 DC 120X'00' END END
Points (1) to (8) in the source program are explained in the following runtime listing.
Runtime listing
/start-assembh % BLS0500 PROGRAM 'ASSEMBH', VERSION '01.2C00' OF '2002-03-06' LOADED % BLS0552 COPYRIGHT (C) FUJITSU TECHNOLOGY SOLUTIONS GMBH 2010. ALL RIGHTS RESERVED % ASS6010 V01.2C00 OF BS2000 ASSEMBH READY //compile source=src.bjv,module-lib=ass.plamlib(elem=bjv),test-support=yes % ASS6011 ASSEMBLY TIME: 430 MSEC % ASS6018 0 FLAGS, 0 PRIVILEGED FLAGS, 0 MNOTES % ASS6019 HIGHEST ERROR-WEIGHT: NO ERRORS % ASS6006 LISTING GENERATOR TIME: 59 MSEC //end % ASS6012 END OF ASSEMBH /load-exe from=(lib=ass.plamlib,elem=bjv),test-opt=*aid1 —————————————— (1) % BLS0517 MODULE 'BJV' LOADED /%insert dth1 /resume-program STOPPED AT LABEL: DTH1 , SRC_REF: 40, SOURCE: BJV , PROC: BJV /%display %15 ———————————————————————————————————————————————————————— (2) *** TID: 0001005C *** TSN: 0FFF ********************************************* CURRENT PC: 0000009C CSECT: BJV******************************************* %15 = 00000433
(1) | As of BLSSERV V2.3, the LOAD-PROGRAM command is replaced by the LOAD-EXECUTABLE-PROGRAM command |
(2) | The STAJV macro is to transfer the status of job variable JV.A to field STA. Register 15 shows: JV.A is not in the system. |
/%insert dth2 /resume-program STOPPED AT LABEL: DTH2 , SRC_REF: 92, SOURCE: BJV , PROC: BJV /%display sta SRC_REF: 92 SOURCE: BJV PROC: BJV **************************************** STA = |.JV.A.JV.DO.1.JV.E.1.JV.MON.JV.N.JV.PERM.ERROR.JV.PERM.ERROR.READ.JV.PERM.ER R| |OR2.JV.PERM.WAIT.JV.PROG...................| /%display sta%x —————————————————————————————————————————————————————— (2) CURRENT PC: 000001B4 CSECT: BJV ******************************************* V'00000868' = STA + #'00000000' 00000868 (00000000) 05D1E54B C108D1E5 4BC4D64B F107D1E5 .JV.A.JV.DO.1.JV 00000878 (00000010) 4BC54BF1 07D1E54B D4D6D505 D1E54BD5 .E.1.JV.MON.JV.N 00000888 (00000020) 0ED1E54B D7C5D9D4 4BC5D9D9 D6D913D1 .JV.PERM.ERROR.J 00000898 (00000030) E54BD7C5 D9D44BC5 D9D9D6D9 4BD9C5C1 V.PERM.ERROR.REA 000008A8 (00000040) C40FD1E5 4BD7C5D9 D44BC5D9 D9D6D9F2 D.JV.PERM.ERROR2 000008B8 (00000050) 0DD1E54B D7C5D9D4 4BE6C1C9 E308D1E5 .JV.PERM.WAIT.JV 000008C8 (00000060) 4BD7D9D6 C7000000 00000000 00000000 .PROG........... 000008D8 (00000070) 00000000 00000000 ........ /%insert dth3 /resume-program STOPPED AT LABEL: DTH3 , SRC_REF: 188, SOURCE: BJV , PROC: BJV /%display get ———————————————————————————————————————————————————————— (3) SRC_REF: 188 SOURCE: BJV PROC: BJV **************************************** GET = |.. ABCDEFGHIJKLMNOPQRSTUVWXYZ....................|
(2) | The DCLJV macro catalogs job variable JV.A and assigns the link name *LINK to it. The STAJV macro transfers the names of all job variables beginning with “JV.” in field STA. The default value LIST=OLD applies, i.e. the output does not list the catalog ID or user ID. |
(3) | JV.A is renamed JV.N and is given the read password “JV”. The user must specify this password in order to access the job variable.The SETJV macro sets JV.N to the value specified in field SET1. The GETJV macro then reads this value into the GET field. |
/%insert dth4 /resume-program STOPPED AT LABEL: DTH4 , SRC_REF: 258, SOURCE: BJV , PROC: BJV /%display get ———————————————————————————————————————————————————————— (4) SRC_REF: 258 SOURCE: BJV PROC: BJV **************************************** GET = |.. AB3456GHIJKLMNOPQRSTUVWXYZ....................| /%insert dth5 /resume-program STOPPED AT LABEL: DTH5 , SRC_REF: 328, SOURCE: BJV , PROC: BJV /%display get ——————————————————————————————————————————————————————— (5) SRC_REF: 328 SOURCE: BJV PROC: BJV **************************************** GET = |.. 34567.........................................| /%insert dth6 /resume-program STOPPED AT LABEL: DTH6 , SRC_REF: 360, SOURCE: BJV , PROC: BJV /%display %15 ———————————————————————————————————————————————————————— (6) CURRENT PC: 000006E6 CSECT: BJV ******************************************* %15 = 000004B1
(4) | Starting at byte 3, four bytes of the job variable value are overwritten with the contents of field SET2. The GET field shows the job variable value subsequent to execution of the SETJV macro. |
(5) | The job variable value is replaced completely, from the start position (=1, default value), by the contents specified in SET2. |
(6) | The job variable is to be deleted. Since the required read password has not been specified, register 15 contains the appropriate error code. |
/%insert dth7 /resume-program STOPPED AT LABEL: DTH7 , SRC_REF: 396, SOURCE: BJV , PROC: BJV /%display sta SRC_REF: 396 SOURCE: BJV PROC: BJV **************************************** STA = |.JV.N....................................................................... .| |...........................................| /%display sta%x —————————————————————————————————————————————————————— (7) CURRENT PC: 00000798 CSECT: BJV ******************************************* V'00000868' = STA + #'00000000' 00000868 (00000000) 05D1E54B D5000000 00000000 00000000 .JV.N........... 00000878 (00000010) 00000000 00000000 00000000 00000000 ................ REPEATED LINES: 4 000008C8 (00000060) 00000000 00000000 00000000 00000000 ................ 000008D8 (00000070) 00000000 00000000 ........ /%insert dth8 /resume-program STOPPED AT LABEL: DTH8 , SRC_REF: 423, SOURCE: BJV , PROC: BJV /%display %15 ——————————————————————————————————————————————————————— (8) CURRENT PC: 0000084A CSECT: BJV ******************************************* %15 = 00000000
(7) | The STAJV macro gives the names of all job variables beginning with “JV.” and protected with a read password (selection is made with the operand list generated by the JVSEL macro), in the STA field. The default value is LIST=OLD, i.e. the output is made without catid and userid. |
(8) | The read password is specified for the delete operation and the job variable is successfully deleted. |