General
Domain: | Job variables |
Macro type: | Type S (standard form/C/D/E/L form) see section “The MF operand” |
In the C and D forms of the macro, a prefix (PREFIX = pre, where pre is 1..3 letters) can be specified (see section “The PREFIX operand”). | |
Default value: | PREFIX=IDJ |
Macro description
The CSWJV macro can be called at program level to set a job variable conditionally (see also the MODIFY-JV-CONDITIONALLY command).
A specified job variable is compared with the contents of a test field. If they are the same, the job variable is overwritten with the contents of another field; if they are not the same, the job variable value is transferred to the test field.
During processing by the macro, the job variable to be checked is protected against access from other jobs.
Macro call format and operand description
Operation | Operands |
|
|
jvid
Identifies the job variable to be checked or set. jvid can be:
jvname | A fully qualified path name of a permanent or temporary job variable |
*jvlink | A valid job variable link name |
start
Specifies the position of the first byte to be checked or set within the job variable value, where 1 <=
start <=
256. Default value: = 1.
length
Specifies the number of bytes of the job variable value that are to be checked or set. The sum of “start” and “length” must not exceed 257. If “length” is not specified, the values entered in the appropriate record length fields of “area1” and “area2” apply.
area1
Symbolic address of the test field in the user program.
Format
|
|
<-4 bytes->
<--1111=total length ----------------------->
The current value of the job variable “jvid” is compared with “comparison value”. If they do not match, “comparison value” is overwritten by the job variable value (return code 0456 or message JVS0456).
area2
Symbolic address of the fixed value for the job variable.
Format
|
|
<-4 bytes->
<--1111=total length ----------------------->
If the job variable value of “jvid” matches the comparison value in “area1”, the job variable value is overwritten by the fixed value.
PASS=password
Defines the password to be input for write access to the job variable (see the CATJV macro). If the job variable is protected by a password and the PASS operand is not specified, the password must be made known to the system by means of the ADD-PASSWORD command (e.g. via the CMD macro) prior to the first call of CSWJV.
MF=
PREFIX=
For a description of the MF and PREFIX operands, see "The MF operand". Their permitted values are indicated at the beginning of the macro description and in the macro call format.
VERSION=
Specifies which version of BS2000 the macro expansion is to be compatible with.
0
Default value; the macro expansion is compatible with JV <=
V8.7.
The operand MF=D/C, which generates a DSECT or CSECT respectively, is not supported by this version (see note on DSECT).
1
The macro expansion is compatible with JV >=
V10.0.
Notes concerning the DSECT
Calling the CSWJV macro with the operands MF=D and VERSION=1 generates a DSECT for the operand list of the CSWJV macro (VERSION=1).
A DSECT for the macro with VERSION=0 is generated by calling the macro IDJCS [D][,prefix].
Return information and error flags
see chapter "Messages" - "Macro level".
DSECT
CSWJV CSWJV MF=D,VERSION=1 1 *********************************************************************** 1 * VERSION 203 1 *********************************************************************** 1 * C S W J V P A R A M E T E R L I S T * 1 *********************************************************************** 1 #INTF REFTYPE=REQUEST, C 1 INTNAME=CSWJV,INTCOMP=001 1 CSWJV DSECT 1 *********************************************************************** 1 * UNIT=41, FUNCTION=5, VERSION=<PARAMETER VERSION> * 1 *********************************************************************** 1 FHDR MF=(C,IDJW) 2 DS 0A 2 IDJWFHE DS 0XL8 0 GENERAL PARAMETER AREA HEADER 2 * 2 IDJWIFID DS 0A 0 INTERFACE IDENTIFIER 2 IDJWFCTU DS AL2 0 FUNCTION UNIT NUMBER 2 * BIT 15 HEADER FLAG BIT, 2 * MUST BE RESET UNTIL FURTHER NOTICE 2 * BIT 14-12 UNUSED, MUST BE RESET 2 * BIT 11-0 REAL FUNCTION UNIT NUMBER 2 IDJWFCT DS AL1 2 FUNCTION NUMBER 2 IDJWFCTV DS AL1 3 FUNCTION INTERFACE VERSION NUMBER 2 * 2 IDJWRET DS 0A 4 GENERAL RETURN CODE 2 * 2 * GENERAL_RETURN_CODE CLEARED (X'00000000') MEANS 2 * REQUEST SUCCESSFUL PROCESSED AND NO ADDITIONAL INFORMATION 2 * 2 IDJWSRET DS 0AL2 4 SUB RETURN CODE 2 IDJWSR2 DS AL1 4 SUB RETURN CODE 2 2 * ALWAYS CLEARED (X'00') IF MAIN_RETURN_CODE IS X'FFFF' 2 * Standard subcode2 values as defined by convention: 2 IDJWR2OK EQU X'00' All correct, no additional info 2 IDJWR2NA EQU X'01' Successful, no action was necessary 2 IDJWR2WA EQU X'02' Warning, particular situation 2 IDJWSR1 DS AL1 5 SUB RETURN CODE 1 2 * 2 * GENERAL INDICATION OF ERROR CLASSES 2 * 2 * CLASS A X'00' FUNCTION WAS SUCCESSFULLY PROCESSED 2 * CLASS B X'01' - X'1F' PARAMETER SYNTAX ERROR 2 * CLASS C X'20' INTERNAL ERROR IN CALLED FUNCTION 2 * CLASS D X'40' - X'7F' NO CLASS SPECIFIC REACTION POSSIBLE 2 * CLASS E X'80' - X'82' WAIT AND RETRY 2 * 2 IDJWRFSP EQU X'00' FUNCTION SUCCESSFULLY PROCESSED 2 IDJWRPER EQU X'01' PARAMETER SYNTAX ERROR 2 * 3 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'01' - X'1F' 2 IDJWRFNS EQU X'01' CALLED FUNCTION NOT SUPPORTED 2 IDJWRFNA EQU X'02' CALLED FUNCTION NOT AVAILABLE 2 IDJWRVNA EQU X'03' INTERFACE VERSION NOT SUPPORTED 2 * 2 IDJWRAER EQU X'04' ALIGNMENT ERROR 2 IDJWRIER EQU X'20' INTERNAL ERROR 2 IDJWRCAR EQU X'40' CORRECT AND RETRY 2 * 2 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'40' - X'7F' 2 IDJWRECR EQU X'41' SUBSYSTEM (SS) MUST BE CREATED 2 * EXPLICITELY BY CREATE-SS 2 IDJWRECN EQU X'42' SS MUST BE EXPLICITELY CONNECTED 2 * 2 IDJWRWAR EQU X'80' WAIT FOR A SHORT TIME AND RETRY 2 IDJWRWLR EQU X'81' " LONG " 2 IDJWRWUR EQU X'82' WAIT TIME IS UNCALCULABLY LONG 2 * BUT RETRY IS POSSIBLE 2 * 2 GLOBALLY DEFINED ISL ERROR CODES IN CLASS X'80' - X'82' 2 IDJWRTNA EQU X'81' SS TEMPORARILY NOT AVAILABLE 2 IDJWRDH EQU X'82' SS IN DELETE / HOLD 2 * 2 IDJWMRET DS 0AL2 6 MAIN RETURN CODE 2 IDJWMR2 DS AL1 6 MAIN RETURN CODE 2 2 IDJWMR1 DS AL1 7 MAIN RETURN CODE 1 2 * 2 * SPECIAL LAYOUT OF LINKAGE_MAIN_RETURN_CODE (YYYY IN X'00XXYYYY') 2 * 2 IDJWRLNK EQU X'FFFF' LINKAGE ERROR / REQ. NOT PROCESSED 2 IDJWFHL EQU 8 8 GENERAL OPERAND LIST HEADER LENGTH 2 * 1 *********************************************************************** 1 * END OF STANDARD HEADER. START OF SPECIAL CSWJV PARAMETER LIST * 1 *********************************************************************** 1 IDJWHDRI EQU X'00290501',4 1 IDJWAREA DS A AREA 1 ADDRESS 1 IDJWARE2 DS A AREA 2 ADDRESS 1 IDJWJV DS CL54 JVNAME 1 IDJWPOS DS H SUBSTRING START POSITION 1 IDJWLEN DS H SUBSTRING LENGTH 1 DS XL2 RESERVED 1 IDJWPASS DS CL4 PASSWORD 1 DS XL12 RESERVED 1 IDJWFLAG DS X FLAGS 1 IDJWENCR EQU X'80' 7-7 0=YES, 1=NO 1 * (ENCRYPTION) 1 IDJWFGNV EQU X'00' 6-6 NOT USED (DEL. V12) 1 IDJWJVIX EQU X'20' 5-5 0=NO, 1=YES 1 * (JVID INDEXED (SUBSTRING) ) 1 IDJWFEX EQU X'10' 4-4 0=NO, 1=YES 1 * (PASSWORD GIVEN) 1 IDJWP2 EQU X'08' 3-3 0=P1 CALLER,1=P2 CALLER 1 DS XL3 RESERVED 1 IDJWJVS DS A RESERVED 1 IDJWPLLN EQU *-CSWJV LENGTH OF DSECT 1 *********************************************************************** 1 SPACE