The following example shows a system attribute call
using a CALL statement.
Figure 1. Example
of an IGWASYS Call Statement .
.
CALL IGWASYS,(RC1,RS1,CODE1,LEVEL,ATTR) Test pre-DFSMS/MVS
LTR R15,R15 Test return code
BNZ BADSYS
CLC LEVEL,=F'2' Test for MVS/XA DFP Version 2
BE OLDSYS
MVC SYSNAME,UNKNAME Assume name is unknown
BL BADSYS Branch if unknown system
MVC SYSNAME,=CL12'MVS/DFP' Show we are on MVS/DFP
CLC LEVEL+12(4),=F'1' See if after MVS/DFP
BL SHOWSYS Branch if before DFSMS/MVS
CALL IGWASYS,(RC1,RS1,CODE2,LEVEL,ATTR)
LTR R15,R15 Branch if environment or
BNZ BADSYS system error
MVC SYSNAME,UNKNAME Assume unknown product name
CLC LEVEL+12(4),=F'1' Test for DFSMS/MVS code
BL OLDSYS Branch if unexpected code
MVC SYSNAME,=CL12'DFSMS/MVS' Show product name
BE SHOWSYS Branch if DFSMS/MVS
MVC SysName,=CL12'OS/390 DFSMS' Set assumed new name
CLC LEVEL+12(4),=F'3' Branch if
BL SHOWSYS OS/390
BH COPYSYS Branch if after z/OS name
MVC SysName,=CL12'z/OS DFSMS' Assume early z/OS
* On z/OS. Test for early releases.
CLC Level(8),=F'1,3' Branch if
BL ShowSys before z/OS 1.3
* On z/OS 1.3 or later. Use the name provided by the system.
CopySys L R14,16 Point to CVT
L R15,CVTDFA-CVT(,R14) Point to DFA
L R14,DFAELNMP-DFA(,R15) Point to element name
USING DFAELNM,R14
MVI SysName,C' ' Blank out name
MVC SysName+1(L'SysName-1),SysName
LH R15,DFAELNML Get name length
CH R15,MaxLen Skip one instruction if
BNH *+8 name not too long
LH R15,MaxLen Truncate to our field length
BCTR R15,0 Decrement for EX instruction
EX R15,MVCName Copy name from DFA
DROP R14
ShowSys EQU * Handle version, release and modification level
.
.
RC1 DC F'0' Return code
RS1 DC F'0' Reason code
CODE1 DC F'1' Ask for pre-DFSMS DFP level
CODE2 DC F'2' Ask for level of DFSMS, or later
LEVEL DC 4F'0' Version, release, Modification Level and code
ATTR DC 4F'0' SMS attributes
SYSNAME DC CL12'MVS/XA DFP' Name of product
UNKNAME DC (L'SYSNAME)C'?' Constant for unknown name
MaxLen DC Y(L'SysName) Our maximum allowed length of name
MVCName MVC SysName(0),DFAELTXT-DFAELNM(R14)