Mvs Programing
Mvs Programing
IBM
SA22-7605-04
z/OS
IBM
SA22-7605-04
Note
Before using this information and the product it supports, be sure to read the general information under Notices on
page C-1.
Contents
Figures . . . . . . . . . . . . . . . . . . . . . . . . . . . xiii
Tables
. . . . . . . . . . . . . . . . . . . . . . . . . . . xvii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
xix
xix
xix
xix
xx
xx
xx
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 2-1
. 2-2
. 2-2
. 2-2
. 2-2
. 2-3
. 2-3
. 2-3
. 2-4
. 2-4
. 2-6
. 2-7
. 2-9
. 2-10
. 2-10
. 2-10
. 2-11
. 2-12
. 2-12
. 2-12
. 2-13
. 2-13
. 2-13
. 2-13
. 2-14
.
.
.
.
.
.
.
.
.
3-1
3-1
3-1
3-1
3-2
3-2
3-2
3-3
3-3
iii
iv
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 4-1
. 4-2
. 4-2
. 4-2
. 4-3
. 4-3
. 4-3
. 4-4
. 4-6
. 4-6
. 4-7
. 4-7
. 4-7
. 4-7
. 4-9
. 4-14
. 4-15
. 4-21
. 4-24
. 4-27
. 4-28
. 4-28
. 4-29
. 4-29
. 4-31
. 4-33
. 5-1
. 5-1
. 5-1
. 5-3
. 5-4
. 5-4
. 5-5
. 5-5
. 5-6
. 5-6
. 5-9
5-10
. 5-12
. 5-12
. 5-12
. 5-12
. 5-12
. 5-13
. 5-14
. 5-15
. 5-17
. 5-18
. 5-20
. 5-21
. 5-23
. 5-26
. 5-28
. 5-29
. 5-34
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 6-1
. 6-2
. 6-3
. 6-4
. 6-5
. 6-8
. 6-9
. 6-10
. 6-11
. 6-11
. 6-11
. 6-15
. . 6-16
. . 6-16
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
5-35
5-36
5-36
5-47
5-48
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
7-1
7-1
7-2
7-3
7-4
7-4
. 8-1
. 8-2
. 8-3
. 8-4
. 8-5
. 8-5
. 8-6
. 8-8
. 8-9
. 8-10
. 8-11
. 8-17
. 8-23
. 8-27
. 8-28
. 8-32
. 8-37
. 8-39
. 8-39
. 8-40
. 8-41
. 8-41
. 8-42
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 11-1
. 11-1
. 11-2
. 11-4
. 11-6
. 11-6
. 11-10
. 11-10
. 11-11
. 11-12
. 11-12
.
.
.
.
.
.
.
.
.
.
.
. 12-1
. 12-1
. 12-2
. 12-2
. 12-3
. 12-3
. 12-5
. 12-8
. 12-9
. 12-9
. 12-9
. 12-10
. 12-12
12-12
. 12-12
. 12-13
. 12-13
. 12-14
. 12-14
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
9-2
9-2
9-8
9-8
9-8
9-9
10-1
10-1
10-2
10-3
10-3
10-3
10-4
10-5
10-5
10-7
10-7
10-7
vi
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
13-4
13-4
13-6
13-6
13-6
13-9
. 14-1
. 14-1
. 14-2
. 14-3
. 14-3
. 14-3
. 14-4
. 14-4
. 14-5
. 14-6
. 14-6
. 14-6
. 14-6
. 14-7
. 14-9
. 14-14
. 14-16
. 14-17
. 14-17
. 14-18
. 14-19
. 14-20
. 14-20
. 14-20
. 14-20
. 14-21
. 14-26
. 15-1
. 15-3
. 15-3
. 15-4
. 15-5
. 15-6
. 15-6
. 15-7
. 15-7
. 15-7
. 15-8
. 15-9
. 15-9
. 15-9
. . . . . . . . . . . . . 15-10
.
.
.
.
16-1
16-1
16-1
16-2
16-2
Contents
vii
viii
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
. 17-1
. 17-1
. 17-1
. 17-1
. 17-1
. 17-2
. 17-3
. 17-6
. 17-7
. 17-7
. 17-9
. 17-10
. 17-12
. 17-13
. 17-14
. 17-15
. 17-15
. 17-16
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
17-16
17-18
17-18
17-19
.
.
.
.
.
.
.
.
.
.
18-1
18-1
18-1
18-2
18-2
18-3
18-3
18-4
18-5
18-5
18-6
. 19-1
. 19-2
. 19-2
. 19-3
. 19-3
. 19-4
. 19-5
. 19-5
. 19-6
. 19-9
. . . . . . 19-13
. . . . . . 19-14
.
.
.
.
.
.
.
.
.
.
.
.
20-1
20-2
20-2
20-3
20-3
20-4
20-5
20-6
20-7
20-8
20-9
20-9
. 21-1
. 21-1
. 21-1
. 21-2
. 21-2
. 21-4
. 21-4
. 21-6
. 21-9
. 21-9
. 21-9
. . . 21-10
. . . 21-10
Contents
ix
.
.
.
a
.
. . . . . . .
. . . . . . .
. . . . . . .
Console Is Active
. . . . . . .
. . 21-10
. . 21-11
. . 21-11
21-12
. . 21-13
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
22-1
22-3
22-3
22-3
22-4
22-4
22-6
22-7
22-7
22-8
22-11
22-11
22-12
22-12
22-13
22-14
. . . 22-15
. . . 22-16
. . . 22-17
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
23-1
23-1
23-2
23-3
23-4
23-5
23-5
23-7
23-8
23-9
23-9
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
24-1
24-1
24-2
24-3
24-3
24-4
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
25-1
25-1
25-1
25-2
25-2
25-3
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
26-2
26-3
26-3
26-4
26-9
. 27-1
. 27-1
. 27-2
. 27-4
. 27-6
. 27-7
. 27-8
. 27-8
. 27-8
. 27-9
. 27-10
. 27-10
. 27-11
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
27-13
27-14
27-15
27-17
27-18
27-20
27-20
27-21
27-22
27-23
27-23
27-32
27-34
27-39
27-40
27-41
27-45
27-46
27-47
27-49
27-54
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
A-1
A-1
A-1
A-1
A-1
A-2
A-2
A-2
A-2
A-2
A-2
A-2
Contents
xi
xii
Figures
2-1.
2-2.
2-3.
2-4.
2-5.
3-1.
4-1.
4-2.
4-3.
4-4.
4-5.
4-6.
4-7.
4-8.
4-9.
4-10.
4-11.
4-12.
4-13.
4-14.
4-15.
4-16.
4-17.
4-18.
4-19.
4-20.
5-1.
5-2.
5-3.
5-4.
5-5.
5-6.
5-7.
5-8.
5-9.
5-10.
5-11.
5-12.
5-13.
5-14.
5-15.
6-1.
6-2.
6-3.
6-4.
6-5.
6-6.
6-7.
6-8.
6-9.
6-10.
7-1.
. . 2-4
. . 2-6
. . 2-8
. . 2-14
. . 2-14
. . 3-4
. . 4-1
. . 4-4
. . 4-8
. . 4-9
. . 4-10
. . 4-11
. . 4-12
. . 4-12
. . 4-13
. . 4-14
. . 4-14
4-17
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
4-18
4-19
4-22
4-22
4-23
4-23
4-27
4-31
. 5-2
. 5-7
. 5-13
. 5-16
. 5-18
. 5-21
. 5-23
. 5-24
. 5-25
. 5-26
. 5-28
. 5-29
. 5-31
. 5-35
. 5-38
. 6-2
. 6-3
. 6-6
. 6-7
. 6-8
. 6-12
. 6-14
. 6-15
. 6-15
6-18
. 7-3
xiii
8-1.
8-2.
11-1.
11-2.
11-3.
13-1.
14-1.
14-2.
14-3.
15-1.
15-2.
15-3.
16-1.
16-2.
16-3.
16-4.
16-5.
16-6.
16-7.
16-8.
16-9.
16-10.
16-11.
17-1.
17-2.
17-3.
17-4.
17-5.
17-6.
18-1.
18-2.
18-3.
19-1.
19-2.
19-3.
19-4.
19-5.
19-6.
20-1.
20-2.
21-1.
21-2.
21-3.
22-1.
22-2.
22-3.
22-4.
22-5.
22-6.
22-7.
22-8.
22-9.
23-1.
26-1.
xiv
26-2.
27-1.
27-2.
27-3.
27-4.
27-5.
27-6.
27-7.
27-8.
27-9.
27-10.
27-11.
A-1.
A-2.
A-3.
A-4.
A-5.
A-6.
A-7.
A-8.
A-9.
A-10.
A-11.
A-12.
A-13.
A-14.
A-15.
A-16.
A-17.
A-18.
A-19.
A-20.
A-21.
A-22.
A-23.
A-24.
Figures
xv
xvi
Tables
4-1.
4-2.
5-1.
6-1.
6-2.
6-3.
8-1.
8-2.
8-3.
8-4.
8-5.
8-6.
8-7.
8-8.
8-9.
8-10.
8-11.
8-12.
9-1.
12-1.
15-1.
15-2.
16-1.
16-2.
18-1.
20-1.
21-1.
21-2.
22-1.
22-2.
22-3.
22-4.
23-1.
27-1.
27-2.
27-3.
xvii
xviii
xix
Licensed documents are available only to customers with a z/OS license. Access to
these documents requires an IBM Resource Link user ID and password, and a key
code. With your z/OS order you received a Memo to Licensees, (GI10-0671), that
includes this key code. 1
To obtain your IBM Resource Link user ID and password, log on to:
http://www.ibm.com/servers/resourcelink
or from anywhere in z/OS where you can access a TSO/E command line (for
example, TSO/E prompt, ISPF, z/OS UNIX System Services running OMVS). You
can also download code from the z/OS Collection (SK3T-4269) and the LookAt Web
site that will allow you to access LookAt from a handheld computer (Palm Pilot VIIx
suggested).
To use LookAt as a TSO/E command, you must have LookAt installed on your host
system. You can obtain the LookAt code for TSO/E from a disk on your z/OS
Collection (SK3T-4269) or from the News section on the LookAt Web site.
Some messages have information in more than one document. For those
messages, LookAt displays a list of documents in which the message appears.
|
|
|
1. z/OS.e customers received a Memo to Licensees, (GI10-0684) that includes this key code.
xx
|
|
http://www.s390.ibm.com:80/bookmgr-cgi/bookmgr.cmd/BOOKS/ZIDOCMST/CCONTENTS
|
|
This document is updated weekly and lists documentation changes before they are
incorporated into z/OS publications.
xxi
xxii
Summary of changes
Summary of changes
for SA22-7605-04
z/OS Version 1 Release 4
The document contains information previously presented in z/OS MVS
Programming: Assembler Services Guide, SA22-7605-03, which supports z/OS
Version 1 Release 3.
New information
v A new set of callable cell pool services is added, for use when running AMODE
64. See Chapter 13, Callable Cell Pool Services on page 13-1.
v Information is added to indicate this document suppors z/OS.e.
This document contains terminology, maintenance, and editorial changes. Technical
changes or additions to the text and illustrations are indicated by a vertical line to
the left of the change.
Starting with z/OS V1R2, you may notice changes in the style and structure of
some content in this documentfor example, headings that use uppercase for the
first letter of initial words only, and procedures that have a different look and format.
The changes are ongoing improvements to the consistency and retrievability of
information in our documents.
Summary of Changes
for SA22-7605-03
as updated June 2002
The document contains information previously presented in z/OS MVS
Programming: Assembler Services Guide, SA22-7605-02, which supports z/OS
Version 1 Release 3.
This document contains terminology, maintenance, and editorial changes, including
changes to improve consistency and retrievability.
Summary of changes
for SA22-7605-02
z/OS Version 1 Release 3
The document contains information previously presented in z/OS MVS
Programming: Assembler Services Guide, SA22-7605-01, which supports z/OS
Version 1 Release 2.
New information
v An appendix with z/OS product accessibility information has been added.
This document contains terminology, maintenance, and editorial changes, including
changes to improve consistency and retrievability.
Summary of changes
for SA22-7605-01
z/OS Version 1 Release 2
xxiii
xxiv
Chapter 1. Introduction
The system controls the flow of work through the computer so that all programs
obtain a fair share of the processing. To make efficient use of the system, you must
understand the services that the system provides and observe the programming
conventions for their use.
The chapters in this book discuss the following topics:
Linkage Conventions A program must follow register and save area
conventions when it is called by another program or when it calls another program.
These conventions ensure that the programs can successfully pass control to each
other while preserving the register contents and the parameter data required for
successful execution.
Subtask Creation and Control Because the system can handle small programs
easier than large ones, a large program might execute faster if you divide it into
parts, called tasks. By following the appropriate conventions, you can break your
programs into tasks that compete more efficiently for the resources of the system.
Program Management Program residence and addressing modes are
discussed in this chapter, as well as the linkage between programs. Save areas,
addressability, and conventions for passing control from one program to another are
also discussed.
Understanding 31-Bit Addressing 31-bit addressing terms are defined in this
chapter. Read this chapter before modifying existing programs to use 31-bit
addresses.
Resource Control Anything necessary for program execution, such as a table, a
storage device, or another program, can be considered a resource. If a program
depends on an event that occurs in another program, it might need to defer part of
its execution until the event, which is considered a resource, is completed. Because
many programs might need the same resource, and because some resources can
only be used by one program at a time, synchronization is often necessary.
Resource control helps to regulate access to the resources that your programs
depend on for successful execution. By using the GQSCAN macro, you can obtain
information about resources and their requestors.
Program Interruption Services The system offers many services to detect and
process abnormal conditions during system processing. Some conditions
encountered in a program cause program interruptions or program exceptions. This
topic includes how to specify user exit routines, using the SPIE or ESPIE macros,
and function performed in user exit routines.
Providing Recovery When your program encounters an error, the program
might end abnormally unless you provide recovery. To recover from errors, you can
write recovery routines that get control when the error occurs. These routines can
attempt to correct the error and allow your program to resume normal processing.
This topic explains recovery concepts and how to write recovery routines.
Dumping Virtual Storage (ABEND, SNAPX, and SNAP Macros) If your
program makes serious errors, the system terminates it. If you request it, the
system generates a dump to accompany the termination, and the resulting dump is
called an abend dump. You can also request another type of dump, called a SNAP
Copyright IBM Corp. 1988, 2002
1-1
dump. Programs can request a SNAP dump at any time, and they can specify the
source, the format, and the destination of the information in the dump.
Reporting Symptom Records (SYMRBLD and SYMREC Macros) An
application can write a symptom record for each error to the logrec data set, the
online repository where MVS collects error information. The unit of information
stored in the logrec data set is called a symptom record. The data in the symptom
record is a description of some programming failure combined with a description of
the environment where the failure occurred. An application can build and write
symptom records in the logrec data set by invoking either the SYMRBLD or
SYMREC macro.
Virtual Storage Management The system combines central storage and
auxiliary storage to make the addressable memory appear larger than it really is.
The apparent memory capacity is called virtual storage. By managing storage in this
way, the system relaxes the size limit on programs and data. The storage that the
system gives to each related group of programs is called an address space. As a
program executes, its storage requirements might vary. Conventions described in
this chapter allow a program to obtain any extra storage it might require, and to
return storage that is no longer required.
Using the 64bit Address Space As of z/OS Release 2, virtual storage
addressing is extended to allow access to chunks of virtual storage called memory
objects above 2 gigabytes. This chapter describes how to use the virtual storage
addressing above 2 gigabytes and to control the physical frames that back this
storage.
Callable Cell Pool Services Callable cell pool services manage user-obtained
areas of virtual storage efficiently, provide high performance service, and allow you
to use storage in both address spaces and data spaces. This chapter describes
callable cell pool services and helps you make the decision between using the
CPOOL macro or callable cell pool services.
Data-In-Virtual By using a simple technique that lets you create, read, or update
external storage data without the traditional GET and PUT macros, you can write
programs that use very large amounts of this type of data. The data, which is not
broken up into individual records, appears in your virtual storage all at once. This
technique also provides better performance than the traditional access methods for
many applications.
Using Access Registers If you need to access data in a data space, you need
to use the set of registers called access registers and be in the address space
control (ASC) mode called AR mode. This chapter helps you access data in data
spaces and use the system services while you are in AR mode.
Data Spaces and Hiperspaces If you need more virtual storage than a single
address space allows, and if you want to prevent other users from accessing this
storage, you can use data spaces and hiperspaces.
Window Services Window services enable assembler language programs to
access or create permanent or temporary data objects. By invoking the service
programs provided by window services, a program can:
v Read or update an existing data-in-virtual object
v Create and save a new permanent data-in-virtual object
v Create and use a temporary data-in-virtual object
1-2
1-3
Appendixes This book also contains an appendix for each of the following
topics:
v Using the Unit Verification Service
v Using the Virtual Fetch Service.
1-4
2-1
program is in primary mode at the time of the call, the target program receives
control in primary mode. After a target program receives control, it can switch its
ASC mode by issuing the Set Address Control (SAC) instruction. For more
information on ASC mode, see Chapter 15, Using Access Registers on page 15-1.
2-2
That is, if a called routine changes any fields in the FPC register other than the
IEEE exception flags and the DXC, it must save the callers values before making
the change and restore them before returning to the caller. The called routine may
change the IEEE exception flags and DXC, explicitly or by triggering exception
conditions, without saving and restoring the callers values.
Note: A program can rely on the FPC register being zero (IEEE default) ONLY
when it determines that the MVS task under which it is running is not
enabled to use the AFP and FPC registers.
The target program uses the linkage stack to save the calling programs registers. It
uses the STORAGE macro to obtain storage for its own save area. The code is in
31-bit addressing mode and is reentrant.
PGM
PGM
PGM
*
*
CSECT
AMODE 31
RMODE ANY
BAKR 14,0
SAC
LAE
512
12,0(15,0)
2-3
*
*
.
.
.
*
USING PGM,12
STORAGE OBTAIN,LENGTH=72
LAE 13,0(0,1)
MVC 4(4,13),=CF1SA
Contents
5 - 17
GPRs 0 - 12
You can save GPRs either with a store-multiple (STM) instruction or with the SAVE
macro. Use the following STM instruction to place the contents of all GPRs except
GPR 13 in the proper words of the save area:
STM 14,12,12(13)
2-4
The SAVE macro stores GPRs in the save area. Code the GPRs to be saved in the
same order as in an STM instruction. The following example of the SAVE macro
places the contents of all GPRs except GPR 13 in the proper words of the save
area.
PROGNAME
SAVE (14,12)
Later, the program can use the RETURN macro to restore GPRs and return to the
caller.
Whether or not the target program obtains its own save area for another program, it
must save the address of the calling programs save area (which it used). If the
target program is creating a save area for another program, it:
1. Stores the address of the calling programs save area (the address passed in
register 13) in the second word of its own save area.
2. Stores the address of its own save area (the address the target program will
pass to another program in register 13) in the third word of the calling programs
save area.
These steps enable the target program to find the save area when it needs it to
restore the registers, and they enable a trace from save area to save area should
one be necessary while examining a dump.
If the target program is not providing a save area for another program, it can keep
the address of the calling programs save area in GPR 13 or store it in a location in
virtual storage.
If you choose not to use the SAVE and RETURN macros, you can use the
IHASAVER macro to map the fields in the standard save area.
Example
In this example, a primary mode target program receives control from a calling
program which provided an 18-word save area pointed to by GPR 13. The calling
program can make the call through the following two instructions:
L
15,=V(PGM)
BASR 14,15
The target program saves its calling programs registers in the save area that the
calling program provides. It uses the GETMAIN macro to obtain storage for its own
save area. The code is in 31-bit addressing mode and is reentrant.
PGM
PGM
PGM
*
*
*
*
.
.
.
*
CSECT
AMODE 31
RMODE ANY
STM
14,12,12(13)
LR
12,15
USING PGM,12
GETMAIN RU,LV=72
ST
13,4(,1)
2-5
SLR
L
LM
BR
END
15,15
14,12(,13)
2,12,28(13)
14
Contents
Value of F5SA
2-3
4-5
64-bit GPR 15
6-31
32-33
34-35
36-53
The target program must create its own save area for another program. It:
1. Stores the low halves of the calling programs GPRs in the calling programs
save area (the address passed in register 13).
2. Creates its own 216-byte save area, taking care to preserve the values of the
high halves of any of the calling programs GPRs
3. Stores the address of the calling programs save area (the address passed in
register 13) in the 33rd and 34th words of its own save area.
4. Saves the string F5SA in the 2nd word of its own save area.
These steps enable the target program to find the save area when it needs it to
restore the registers, and they enable a trace backward from the most recent save
area to previous save areas should one be necessary while examining a dump.
Example
In this example, a primary mode target program receives control from calling
program which provided a 36-word doubleword-aligned save area pointed to by
GPR 13. The calling program can make the call through the following two
instructions:
2-6
L 15,=V(PGM)
BASR 14,15
The target program saves its calling programs registers in the save area that the
calling program provides. It uses the GETMAIN macro to obtain storage for its own
save area. The code is in 31-bit addressing mode and is reentrant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
PGM CSECT
PGM AMODE 31
PGM RMODE 31
SYSSTATE ARCHLVL=2
STM 14,12,SAVGRS14-SAVER(13)
*
Save callers registers in caller*
provided R13 savearea
CNOP 0,4
BRAS 12,*+8
DC
A(STATIC_DATA)
L
12,0(12,0)
Set up to address of static data
USING STATIC_DATA,12
SRLG 0,0,32
Move high half of GPR 0 into low half of GPR 0
LR
2,0
Save high half of GPR 0 in low half of GPR 2
SRLG 1,1,32
Move high half of GPR 1 into low half of GPR 1
LR
3,1
Save high half of GPR 1 in low half of GPR 3
SRLG 15,15,32
Move high half of GPR 15 into low half of GPR 15
LR
4,15
Save high half of GPR 15 in low half of GPR 4
GETMAIN RU,LV=SAVF5SA_LEN Get my reentrant savearea
STG 13,SAVF5SAPREV-SAVF5SA(,1)
*
Save callers savearea address in my
*
savearea (backward chain)
STMH 2,14,SAVF5SAG64HS2-SAVF5SA(1)
ST
2,SAVF5SAG64HS0-SAVF5SA(1)
ST
3,SAVF5SAG64HS1-SAVF5SA(1)
ST
4,SAVF5SAG64HS15-SAVF5SA(1)
MVC SAVF5SAID-SAVF5SA(4,1),=A(SAVF5SAID_VALUE)
*
Set ID into savearea
LGR 13,1
Put my savearea address in R13
* End of entry code. Begin program code here . . .
*
*
*
*
* Begin exit code
LGR 1,13
Copy my savearea address
LMH 2,14,SAVF5SAG64HS2-SAVF5SA(13)
*
Restore high halves
LG
13,SAVF5SAPREV-SAVF5SA(,13)
*
Restore callers savearea address
FREEMAIN RU,A=(1),LV=SAVF5SA_LEN Free my reentrant savearea
SLR 15,15
Set return code of zero
L
14,SAVGRS14-SAVER(,13) Restore callers R14
LM
2,12,SAVGRS2-SAVER(13) Restore callers R2-R12
BR
14 Return to caller
*
STATIC_DATA DS 0D
* Begin static data here
* ...
*
IHASAVER
PGM CSECT
LTORG ,
END
If Starting in AMODE 64
An AMODE 64 program must specify SYSSTATE AMODE64=YES.
2-7
When it receives control, the target program saves the GPRs in the 36-word
doubleword-aligned caller-provided save area pointed to by 64-bit GPR 13. The
format of this area is shown in Figure 2-3. As indicated by this figure, the contents
of each GPR, except GPR 13, must be saved in a specific location within the save
area. GPR 13 is not saved; it holds the address of the save area.
Word
Contents
Value of F4SA
2-3
4-5
64-bit GPR 15
6-31
32-33
34-35
You can save GPRs either with a store-multiple (STMG) instruction or with the
SAVE macro. Use the following STMG instruction to place the contents of all GPRs
except GPR 13 in the proper words of the save area:
STMG 14,12,8(13)
The SAVE macro stores GPRs in the save area. Code the GPRs to be saved in the
same order as in a STMG instruction. The following example of the SAVE macro
places the contents of all GPRs except GPR 13 in the proper words of the save
area.
PROGNAME SAVE (14,12)
Later, the program can use the RETURN macro to restore GPRs and return to the
caller.
Whether or not the target program obtains its own save area for another program, it
must save the address of the calling programs save area (which it used). If the
target program is creating a save area for another program, it:
1. Stores the address of the calling programs save area (the address passed in
register 13) in the 33rd and 34th words of its own save area.
2. Stores the address of its own save area (the address the target program will
pass to another program in register 13) in the 35th and 36th words of the calling
programs save area.
3. Saves the string F4SA in the 2nd word of its own save area.
These steps enable the target program to find the save area when it needs it to
restore the registers, and they enable a trace backward from the most recent save
area to previous save areas should one be necessary while examining a dump. If
the target program is not providing a save area for another program, it can keep the
address of the calling programs save area in GPR 13 or store it in a location in
virtual storage.
2-8
If you choose not to use the SAVE and RETURN macros, you can use the
IHASAVER macro to map the fields in the standard save area.
Example
In this example, a primary mode target program receives control from calling
program which provided a 36-word doubleword-aligned save area pointed to by
GPR 13. The calling program can make the call through the following two
instructions:
L 15,=V(PGM)
BASR 14,15
The target program saves its calling programs registers in the save area that the
calling program provides. It uses the GETMAIN macro to obtain storage for its own
save area. The code is in 64-bit addressing mode and is reentrant.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
||
|
|
|
|
|
|
|
|
|
|
||
||
|
|
|
|
PGM CSECT
PGM AMODE 64
PGM RMODE 31
SYSSTATE AMODE64=YES
STMG 14,12,SAVF4SAG64RS14-SAVF4SA(13)
*
Save callers registers in caller*
provided R13 save area
CNOP 0,4
BRAS 12,*+8
DC A(STATIC_DATA)
L
12,0(12,0)
Set up to address of static data
USING STATIC_DATA,12
GETMAIN RU,LV=144
Get my reentrant savearea
STG 13,SAVF4SAPREV-SAVF4SA(,1)
*
Save callers savearea address in my
*
savearea (backward chain)
STG 1,SAVF4SANEXT-SAVF4SA(,13)
*
Save my savearea address in callers
*
savearea (forward chain)
MVC SAVF4SAID-SAVF4SA(4,1),=A(SAVF4SAID_VALUE)
*
Set ID into savearea
LGR 13,1
Put my savearea address in R13
*
End of entry code. Begin program code here . . .
.
.
.
* Begin exit code
LGR 1,13
Copy my savearea address
LG 13,SAVF4SAPREV-SAVF4SA(,13)
*
Restore callers savearea address
FREEMAIN RU,A=(1),LV=144 Free my reentrant savearea
SLR 15,15
Set return code of zero
LG 14,SAVF4SAG64RS14-SAVF4SA(,13)
*
Restore callers R14
LMG 2,12,SAVF4SAG64RS2-SAVF4SA(13)
*
Restore callers R2-R12
BR
14
Return to caller
.
.
.
STATIC_DATA DS 0D
* Begin static data here
IHASAVER
END
2-9
2-10
2-11
v Place parameter information to return to the caller, if any, into GPR 0, 1, or both.
For information about passing information through a parameter list, see
Conventions for Passing Information Through a Parameter List on page 2-13.
v Load the return code, if any, into GPR 15.
v Issue the PR instruction. The PR instruction restores the callers AR/GPRs 2 - 14
from the linkage stack, removes the entry from the linkage stack, and returns
control to the caller.
A primary mode program that uses the caller-provided save area must:
v Place parameter information to return to the caller, if any, into GPR 0, 1, or both.
For information about passing information through a parameter list, see
Conventions for Passing Information Through a Parameter List on page 2-13.
v Load GPR 13 with the address of the save area that the program passed when it
made the call.
v Load the return code, if any, into GPR 15.
v Restore GPRs 2 - 12 and 14.
v Return to the calling program.
2-12
2-13
@
2 Bytes
0 to 100 Bytes
Full-Word
Boundary
Length Field
PARM Field
Half-Word
Boundary
Programs in AR Mode
If the calling program is in AR mode, all addresses that it passes, whether they are
in a GPR or in a parameter list, must be ALET-qualified. A parameter list can be in
an address space other than the calling programs primary address space or in a
data space, but it cannot be in the calling programs secondary address space.
Figure 2-5 shows one way to format addresses and ALETs in a parameter list. The
addresses passed to the called program are at the beginning of the list and their
associated ALETs follow the addresses. Notice that the third address has the high
order bit set on to indicate the size of the list.
GPR1
AR1
@A
@B
@C
ALET A
ALET
ALET B
ALET C
2-14
2-15
2-16
Priorities
This section considers three priorities: address space priorities, task priorities, and
subtask priorities.
3-1
control program will select, and alter, the priority in order to achieve the best load
balance in the system, that is, in order to make the most efficient use of processor
time and other system resources.
When the system is running in WLM compatibility mode the IEAIPSxx and
IEAICSxx definitions determine the dispatching priority assigned to the job. See
z/OS MVS Initialization and Tuning Guide for additional information. might want
some jobs to execute at a different address space priority than the default priority
assigned
When the system is running in WLM goal mode, the active WLM service policy
determines the dispatching priority assigned to the job. See z/OS MVS Planning:
Workload Management for additional information.
Task Priority
Each task in an address space has a limit priority and a dispatching priority
associated with it. The control program sets these priorities when a job step is
initiated. When you use the ATTACH or ATTACHX macro to create other tasks in
the address space, you can use the LPMOD and DPMOD parameters to give them
different limit and dispatching priorities.
The dispatching priorities of the tasks in an address space do not affect the order in
which the control program selects jobs for execution because that order is selected
on the basis of address space dispatching priority. Once the control program selects
an address space for dispatching, it selects from within the address space the
highest priority task awaiting execution. Thus, task priorities may affect processing
within an address space. Note, however, that in a multiprocessing system, task
priorities cannot guarantee the order in which the tasks will execute because more
than one task may be executing simultaneously in the same address space on
different processors. Page faults may alter the order in which the tasks execute.
Subtask Priority
When a subtask is created, the limit and dispatching priorities of the subtask are the
same as the current limit and dispatching priorities of the originating task except
when the subtask priorities are modified by the LPMOD and DPMOD parameters of
the ATTACH and ATTACHX macro. The LPMOD parameter specifies the signed
number to be subtracted from the current limit priority of the originating task. The
result of the subtraction is assigned as the limit priority of the subtask. If the result
is zero or negative, zero is assigned as the limit priority. The DPMOD parameter
specifies the signed number to be added to the current dispatching priority of the
originating task. The result of the addition is assigned as the dispatching priority of
the subtask, unless the number is greater than the limit priority or less than zero. In
that case, the limit priority or 0, respectively, is used as the dispatching priority.
3-2
be made less than the dispatching priority of another task. If this occurs and the
other task is dispatchable, it would be given control after execution of the CHAP
macro.
You can also use the CHAP macro to increase the limit priority of any of an active
tasks subtasks. An active task cannot change its own limit priority. The dispatching
priority of a subtask can be raised above its own limit priority, but not above the
limit of the originating task. When the dispatching priority of a subtask is raised
above its own limit priority, the subtasks limit priority is automatically raised to equal
its new dispatching priority.
3-3
Job
Step
Task
Task A
Task A1
Task B
Task A2
Task B1
Task A2a
Task B1a
All of the tasks in the job step compete independently for processor time; if no
constraints are provided, the tasks are performed and are terminated
asynchronously. However, since each task is performing a portion of the same job
step, some communication and constraints between tasks are required, such as
notifying each other when a subtask completes. If a predecessor task attempts to
terminate before all of its subtasks are complete, those subtasks and the
predecessor task are abnormally terminated.
Two parameters, the ECB and ETXR parameters, are provided in the ATTACH or
ATTACHX macro to assist in communication between a subtask and the originating
task. These parameters are used to indicate the normal or abnormal termination of
a subtask to the originating task. If you coded the ECB or ETXR parameter, or both,
in the ATTACH or ATTACHX macro, the task control block of the subtask is not
removed from the system when the subtask is terminated. The originating task must
remove the task control block from the system after termination of the subtask by
issuing a DETACH. If you specified the ECB parameter in the ATTACH or ATTACHX
macro, the ECB must be in storage addressable by the attaching task and control
program so that the issuer of ATTACH can wait on it (using the WAIT macro) and
the control program can post it on behalf of the terminating task. The task control
blocks for all subtasks must be removed before the originating task can terminate
normally.
The ETXR parameter specifies the address of an end-of-task exit routine in the
originating task, which is to be given control when the subtask being created is
terminated. The end-of-task routine is given control asynchronously after the
3-4
subtask has terminated and must therefore be in virtual storage when it is required.
After the control program terminates the subtask, the end-of-task routine specified is
scheduled to be executed. It competes for CPU time using the priority of the
originating task and of its address space and can receive control even though the
originating task is in the wait condition. Although the DETACH does not have to be
issued in the end-of-task routine, this is a good place for it.
The ECB parameter specifies the address of an event control block (discussed
under Task Synchronization), which is posted by the control program when the
subtask is terminated. After posting occurs, the event control block contains the
completion code specified for the subtask.
If you specified neither the ECB nor the ETXR parameter in the ATTACH or
ATTACHX macro, the task control block for the subtask is removed from the system
when the subtask terminates. Its originating task does not have to issue a DETACH.
A reference to the task control block in a CHAP or a DETACH macro in this case is
as risky as task termination. Since the originating task is not notified of subtask
termination, you may refer to a task control block that has been removed from the
system, which would cause the active task to be abnormally terminated.
Note: The originating task is abended if it attempts to normally terminate when it
has active subtasks.
3-5
3-6
31
24
The assembler places the AMODE and RMODE in the external symbol dictionary
(ESD) of the output object module for use by the linkage editor. The linkage editor
passes this information on to the control program through the directory entry for the
partitioned data set (PDS) that contains the load module and the composite external
symbol dictionary (CESD) record in the load module. You can also specify the
AMODE/RMODE attributes of a load module by using linkage editor control cards.
Chapter 5, Understanding 31-Bit Addressing on page 5-1 contains additional
information about residency and addressing mode; z/OS DFSMS Program
Management contains information about the linkage editor control cards.
4-1
specifies that the program must reside in 24-bit addressable virtual storage.
ANY
specifies that the program can reside anywhere in virtual storage because
the code has no virtual storage residency restrictions.
31
ANY
Linkage Considerations
The system supports programs that execute in either 24-bit or 31-bit addressing
mode. The following branch instructions take addressing mode into consideration:
Branch and link (BAL)
Branch and link, register form (BALR)
Branch and save (BAS)
Branch and save, register form (BASR)
Branch and set mode (BSM)
Branch and save and set mode (BASSM)
Branch and stack (BAKR)
See Principles of Operation for a complete description of how these instructions
function. The following paragraphs provide a general description of these branch
instructions.
The BAL and BALR instructions are unconditional branch instructions (to the
address in operand 2). BAL and BALR function differently depending on the
addressing mode in which you are executing. The difference is in the linkage
information passed in the link register when these instructions execute. In 31-bit
addressing mode, the link register contains the AMODE indicator (bit 0) and the
address of the next sequential instruction (bits 1-31); in 24-bit addressing mode, the
link register contains the instruction length code, condition code, program mask,
and the address of the next sequential instruction.
BAS and BASR perform the same function that BAL and BALR perform when BAL
and BALR execute in 31-bit addressing mode.
4-2
The BSM instruction provides problem programs with a way to change the AMODE
bit in the PSW. BSM is an unconditional branch instruction (to the address in
operand 2) that saves the current AMODE in the high-order bit of the link register
(operand 1), and sets the AMODE indicator in the PSW to agree with the AMODE
of the address to which you are transferring control (that is, the high order bit of
operand 2).
The BASSM instruction functions in a manner similar to the BSM instruction. In
addition to saving the current AMODE in the link register, setting the PSW AMODE
bit, and transferring control, BASSM also saves the address of the next sequential
instruction in the link register thereby providing a return address.
BASSM and BSM are used for entry and return linkage in a manner similar to
BALR and BR. The major difference from BALR and BR is that BASSM and BSM
can save and change addressing mode.
The BAKR instruction is an unconditional branch to the address in operand 2. In
addition to the branching action, it adds an entry to the linkage stack.
For more information on the linkage stack, see System-Provided Linkage Stack on
page 2-3.
Return
BAL/BALR
BR
BAS/BASR
BR
4-3
address of EP1 with the high order bit set to 1 to indicate 31-bit AMODE). This is
followed by a BASSM 14,15 instruction, which performs the following functions:
v Sets the high-order bit of the link register (register 14) to 0 (because TEST is
currently executing in 24-bit AMODE) and puts the address of the next sequential
instruction into bits 1-31.
v Sets the PSW AMODE bit to 1 to agree with bit 0 of register 15.
v Transfers to EP1 (the address in bits 1-31 of register 15).
The EP1 program executes in 31-bit AMODE. Upon completion, EP1 sets a return
code in register 15 and executes a BSM 0,14 instruction, which performs the
following functions:
v Sets the PSW AMODE bit to 0 to correspond to the high-order bit of register 14.
v Transfers control to the address following the BASSM instruction in the TEST
program.
TEST
TEST
TEST
CSECT
AMODE 24
RMODE 24
.
.
L
15,EPA
OBTAIN TRANSFER ADDRESS
BASSM 14,15
SWITCH AMODE AND TRANSFER
.
.
EXTRN EP1
EPA
DC
A(X80000000+EP1) POINTER DEFINED ENTRY POINT ADDRESS
.
.
END
____________________________________________________________
EP1
CSECT
EP1
AMODE 31
EP1
RMODE ANY
.
.
SLR
15,15
SET RETURN CODE 0
BSM
0,14
RETURN TO CALLERS AMODE AND TRANSFER
END
4-4
L16JGRS
L16JARS
L16JPSW
L16JPROCESSARS
When CSRL16J passes control to the target routine, the GPRs contain:
Register
Contents
0-15
If the L16JPROCESSARS bit is set on, when CSRL16J passes control to the target
routine the access registers (ARs) contain:
Register
Contents
0-15
If the L16JPROCESSARS bit is set off, when CSRL16J passes control to the target
routine the access registers (ARs) contain:
Register
Contents
0-1
4-5
2-13
The contents are the same as they were when the caller issued the
CSRL16J callable service.
14-15
L16JLENGTHTOFREE
L16JAREATOFREE
The system frees the storage only when the CSRL16J callable service is
successful.
Simple
Planned Overlay
Dynamic
Yes
No
Yes
No
Optional
Yes
Simple Structure
A simple structure consists of a single load module produced by the linkage editor.
The single load module contains all of the instructions required and is paged into
central storage by the control program as it is executed. The simple structure can
be the most efficient of the two structure types because the instructions it uses to
pass control do not require control-program assistance. However, you should design
your program to make most efficient use of paging.
4-6
Dynamic Structure
A dynamic structure requires more than one load module during execution. Each
required load module can operate as either a simple structure or another dynamic
structure. The advantages of a dynamic structure over a simple structure increase
as the program becomes more complex, particularly when the logical path of the
program depends on the data being processed. The load modules required in a
dynamic structure are paged into central storage when required, and can be deleted
from virtual storage when their use is completed.
4-7
Establish a parameter list and place the address of the list in register 1. The
parameter list should consist of consecutive fullwords starting on a fullword
boundary, each fullword containing an address to be passed to the called control
section. When executing in 24-bit AMODE, each address is located in the three
low-order bytes of the word. When executing in 31-bit AMODE, each address is
located in bits 1-31 the word. In both addressing modes, set the high-order bit of
the last word to 1 to indicate that it is the last word of the list. The system
convention is that the list contain addresses only. You may, of course, deviate
from this convention; however, when you deviate from any system convention,
you restrict the use of your programs to those programmers who know about
your special conventions.
v Pass the address of the save area in register 13 just as it was passed to you.
Since you have reloaded all the necessary registers, the save area that you
received on entry is now available, and should be reused by the called control
section. By passing the address of the old save area, you save the 72 bytes of
virtual storage for a second, unnecessary, save area.
Note: If you pass a new save area instead of the one received on entry, errors
could occur.
Passing Control
v Load register 15 with a V-type address constant for the name of the external
entry point, then branch to the address in register 15.
This is the common way to pass control between one control section and an
entry point in the same load module. The external entry point must have been
identified using an ENTRY instruction in the called control section if the entry
point is not the same as the control sections CSECT name.
Figure 4-3 shows an example of loading registers and passing control. In this
example, no new save area is used, so register 13 still contains the address of the
old save area. It is also assumed for this example that the control section will pass
the same parameters it received to the next entry point. First, register 14 is
reloaded with the return address. Next, register 15 is loaded with the address of the
external entry point NEXT, using the V-type address constant at the location
NEXTADDR. Registers 0-12 are reloaded, and control is passed by a branch
instruction using register 15. The control section to which control is passed contains
an ENTRY instruction identifying the entry point NEXT.
.
.
L
L
LM
BR
.
.
NEXTADDR DC
14,12(13)
15,NEXTADDR
0,12,20(13)
15
V(NEXT)
Figure 4-4 shows an example of passing a parameter list to an entry point with the
same addressing mode. Early in the routine the contents of register 1 (that is, the
address of the fullword containing the PARM field address) were stored at the
fullword PARMADDR. Register 13 is loaded with the address of the old save area,
4-8
which had been saved in word 2 of the new save area. The contents of register 14
are restored, and register 15 is loaded with the entry address.
EARLY
PARMLIST
DCBADDRS
PARMADDR
NEXTADDR
.
.
USING
ST
.
.
L
L
L
L
LA
OI
LM
BR
.
.
DS
DC
DC
DC
DC
*,12
1,PARMADDR
Establish addressability
Save parameter address
13,4(13)
0,20(13)
14,12(13)
15,NEXTADDR
1,PARMLIST
PARMADDR,X80
2,12,28(13)
15
0A
A(INDCB)
A(OUTDCB)
A(0)
V(NEXT)
The address of the list of parameters is loaded into register 1. These parameters
include the addresses of two data control blocks (DCBs) and the original register 1
contents. The high-order bit in the last address parameter (PARMADDR) is set to 1
using an OR-immediate instruction. The contents of registers 2-12 are restored.
(Since one of these registers was the base register, restoring the registers earlier
would have made the parameter list unaddressable.) A branch register instruction
using register 15 passes control to entry point NEXT.
4-9
Note that the same save area can be reused after control is returned by the
called control section. One new save area is ordinarily all you will require
regardless of the number of control sections called.
Passing Control
You may use two standard methods for passing control to another control section
and providing for return of control. One is an extension of the method used to pass
control without a return, and requires a V-type address constant and a branch, a
branch and link, or a branch and save instruction provided both programs execute
in the same addressing mode. If the addressing mode changes, use a branch and
save and set mode instruction. The other method uses the CALL macro to provide
a parameter list and establish the entry and return addresses. With either method,
you must identify the entry point by an ENTRY instruction in the called control
section if the entry name is not the same as the control section CSECT name.
Figure 4-5 and Figure 4-6 illustrate the two methods of passing control; in each
example, assume that register 13 already contains the address of a new save area.
Figure 4-5 also shows the use of an inline parameter list and an answer area. The
address of the external entry point is loaded into register 15 in the usual manner. A
branch and link instruction is then used to branch around the parameter list and to
load register 1 with the address of the parameter list. An inline parameter list, such
as the one shown in Figure 4-5, is convenient when you are debugging because the
parameters involved are located in the listing (or the dump) at the point they are
used, instead of at the end of the listing or dump. Note that the high-order bit of the
last address parameter (ANSWERAD) is set to 1 to indicate the end of the list. The
area pointed to by the address in the ANSWERAD parameter is an area to be used
by the called control section to pass parameters back to the calling control section.
This is a possible method to use when a called control section must pass
parameters back to the calling control section. Parameters are passed back in this
manner so that no additional registers are involved. The area used in this example
is twelve words. The size of the area for any specific application depends on the
requirements of the two control sections involved.
.
.
L
CNOP
BAL
PARMLIST DS
DCBADDRS DC
DC
ANSWERAD DC
15,NEXTADDR
0,4
1,GOOUT
0A
A(INDCB)
A(OUTDCB)
A(AREA+X80000000)
NEXTADDR DC
GOOUT
BALR
V(NEXT)
14,15
RETURNPT ...
AREA
DC
12F0
Note: This example assumes that you are passing control to a program that
executes in the same addressing mode as your program. See Linkage
Considerations on page 4-2 for information on how to handle branches
between programs that execute in different addressing modes.
Figure 4-5. Passing Control With Return
4-10
RETURNPT
AREA
CALL
...
DC
NEXT,(INDCB,OUTDCB,AREA),VL
12F0
Note: If you are using the CALL macro to pass control to a program that executes
in a different addressing mode, you must include the LINKINST=BASSM
parameter.
Figure 4-6. Passing Control With CALL
The CALL macro in Figure 4-6 provides the same functions as the instructions in
Figure 4-5. When the CALL macro is expanded, the parameters cause the following
results:
NEXT - A V-type address constant is created for NEXT, and the address is
loaded into register 15.
(INDCB,OUTDCB,AREA) - A-type address constants are created for the three
parameters coded within parentheses, and the address of the first A-type
address constant is placed in register 1.
VL - The high-order bit of the last A-type address constant is set to 1.
Control is passed to NEXT using a branch and link instruction. (Optionally, you can
specify either a BASR or BASSM instruction, with the LINKINST= parameter.) The
address of the instruction following the CALL macro is loaded into register 14 before
control is passed.
In addition to the results described above, the V-type address constant generated
by the CALL macro requires the load module with the entry point NEXT to be link
edited into the same load module as the control section containing the CALL macro.
The z/OS DFSMS Program Management publication tells more about this service.
The parameter list constructed from the CALL macro in Figure 4-6, contains only
A-type address constants. A variation on this type of parameter list results from the
following coding:
CALL
NEXT,(INDCB,(6),(7)),VL
In the above CALL macro, two of the parameters to be passed are coded as
registers rather than symbolic addresses. The expansion of this macro again results
in a three-word parameter list; in this example, however, the expansion also
contains instructions that store the contents of registers 6 and 7 in the second and
third words, respectively, of the parameter list. The high-order bit in the third word is
set to 1 after register 7 is stored. You can specify as many address parameters as
you need, and you can use symbolic addresses or register contents as you see fit.
4-11
frequently uses this method to indicate the results of the requests you make using
system macros; an example of the type of return codes the control program
provides is shown in the description of the IDENTIFY macro.
The meaning of each of the codes to be returned must be agreed upon in advance.
In some cases, either a good or bad indication (zero or nonzero) will be sufficient
for you to decide your next action. If this is true, the coding in Figure 4-7 could be
used to analyze the results. Many times, however, the results and the alternatives
are more complicated, and a branching table, such as shown in Figure 4-8 could be
used to pass control to the proper routine.
Note: Explicit tests are required to ensure that the return code value does not
exceed the branch table size.
RETURNPT
LTR
BNZ
.
.
15,15
ERRORTN
B RETTAB(15)
B NORMAL
B COND1
B COND2
B GIVEUP
.
.
Branch
Branch
Branch
Branch
Branch
to
to
to
to
to
4-12
control section returns to the calling control section, which bases its next action on
the number of out-of-tolerance conditions encountered. The coding shown in
Figure 4-9 loads register 14 with the return address. The contents of register 15 are
set to zero, and the value at the address STATUSBY (the number of errors) is
placed in the low-order eight bits of the register. The contents of register 15 are
shifted to the left two places to make the value a multiple of four. Registers 2-12 are
reloaded, and control is returned to the address in register 14.
.
.
L
L
SR
IC
SLA
LM
BR
.
.
STATUSBY DC
13,4(13)
14,12(13)
15,15
15,STATUSBY
15,2
2,12,28(13)
14
X00
Note: This example assumes that you are returning to a program with the same
AMODE. If not, use the BSM instruction to transfer control.
Figure 4-9. Establishing a Return Code
The RETURN macro saves coding time. The expansion of the RETURN macro
provides instructions that restore a designated range of registers, load a return code
in register 15, and branch to the address in register 14. If T is specified, the
RETURN macro flags the save area used by the returning control section (that is,
the save area supplied by the calling routine). It does this by setting the low-order
bit of word four of the save area to one after the registers have been restored. The
flag indicates that the control section that used the save area has returned to the
calling control section. The flag is useful when tracing the flow of your program in a
dump. For a complete record of program flow, a separate save area must be
provided by each control section each time control is passed.
You must restore the contents of register 13 before issuing the RETURN macro.
Code the registers to be reloaded in the same order as they would have been
designated for a load-multiple (LM) instruction. You can load register 15 with the
return code before you write the RETURN macro, you can specify the return code
in the RETURN macro, or you can reload register 15 from the save area.
The coding shown in Figure 4-10 provides the same result as the coding shown in
Figure 4-9. Registers 13 and 14 are reloaded, and the return code is loaded in
register 15. The RETURN macro reloads registers 2-12 and passes control to the
address in register 14. The save area used is not flagged. The RC=(15) parameter
indicates that register 15 already contains the return code, and the contents of
register 15 are not to be altered.
4-13
.
.
L
L
SR
IC
SLA
RETURN
.
.
STATUSBY DC
13,4(13)
14,12(13)
15,15
15,STATUSBY
15,2
(2,12),RC=(15)
X00
Note: You cannot use the RETURN macro to pass control to a program that
executes in a different addressing mode.
Figure 4-10. Using the RETURN Macro
Figure 4-11 illustrates another use of the RETURN macro. The correct save area
address is again established, and then the RETURN macro is issued. In this
example, registers 14 and 0-12 are reloaded, a return code of 8 is placed in register
15, the save area is flagged, and control is returned. Specifying a return code
overrides the request to restore register 15 even though register 15 is within the
designated range of registers.
.
.
L
RETURN
13,4(13)
(14,12),T,RC=8
4-14
4-15
B did not specify a unique task library for task C, its own task library (LIB2) is
propagated to task C and is the first library searched when task C requests that
a module be brought into virtual storage.
Task A
Task B
ATTACH EP=B,TASKLIB=LIB2
ATTACH EP=C
DD DSNAME=PDS1,...
DD DSNAME=PDS2,...
DD DSNAME=PDS3...
The three data sets (PDS1, PDS2, PDS3) are processed as one, and are said to be
concatenated. Concatenation and the use of partitioned data sets is discussed in
more detail in z/OS DFSMS: Using Data Sets.
Some of the load modules from the link library may already be in virtual storage in
an area called the link pack area. The contents of these areas are determined
during the nucleus initialization process and will vary depending on the
requirements of your installation. The link pack area contains all reenterable load
modules from the LPA library, along with installation selected modules. These load
modules can be used by any job step in any job.
With the exception of those load modules contained in this area, copies of all of the
reenterable load modules you request are brought into your area of virtual storage
and are available to any task in your job step. The portion of your area containing
the copies of the load modules is called the job pack area. Any program loaded by
a particular task is also represented within that tasks load list.
4-16
The EP, EPLOC, or DE parameter specifies the name of the entry point in the load
module. Code one of the three every time you use a LINK, LINKX, LOAD, XCTL,
XCTLX, ATTACH, or ATTACHX macro. The optional DCB parameter indicates the
address of the data control block for the library containing the load module. Omitting
the DCB parameter or using the DCB parameter with an address of zero specifies
that the system is to do its normal search. If you specified TASKLIB and if the DCB
parameter contains the address of the data control block for the link library, the
control program searches no other library.
To avoid using system copies of modules resident in LPA and LINKLIB, you can
specifically limit the search for the load module to the load list and the job pack
area and the first library on the normal search sequence by specifying the
LSEARCH parameter on the LINK, LOAD, or XCTL macro with the DCB for the
library to be used.
The following paragraphs discuss the order of the search when the entry name
used is a member name.
The EP and EPLOC parameters require the least effort on your part; you provide
only the entry name, and the control program searches for a load module having
that entry name. Figure 4-12 shows the order of the search when EP or EPLOC is
coded, and the DCB parameter is omitted or DCB=0 is coded.
When used without the DCB parameter, the EP and EPLOC parameters provide the
easiest method of requesting a load module from the link, job, or step library. The
control program searches the task libraries before the job or step library, beginning
with the task library of the task that issued the request and continuing through the
task libraries of all its antecedent tasks. It then searches the job or step library,
followed by the link library.
A job, step, or link library or a data set in one of these libraries can be used to hold
one version of a load module, while another can be used to hold another version
with the same entry name. If one version is in the link library, you can ensure that
the other will be found first by including it in the job or step library. However, if both
versions are in the job or step library, you must define the data set that contains the
version you want to use before the data set that contains the other version. For
example, if the wanted version is in PDS1 and the unwanted version is in PDS2, a
step library consisting of these data sets should be defined as follows:
//STEPLIB
//
DD DSNAME=PDS1,...
DD DSNAME=PDS2,...
Chapter 4. Program Management
4-17
Use extreme caution when specifying duplicate module names. Even if you code
the DCB parameter, the wrong module can still receive control. For example,
suppose there are two modules with the same name you want to invoke, one after
the other. To distinguish between them in this example they are called PROG2 and
PROG2. PROG1 issues a LOAD for PROG2 and BALRs to it. PROG2 issues a
LINK specifying a DCB for the library with the other copy of PROG2 (which we are
calling PROG2). The LINK will find a useable copy of PROG2 in the Job Pack Area
and invoke it again, regardless of the DCB parameter. PROG2 again issues a LINK
for PROG2. This time the copy of PROG2 in the Job Pack Area is marked not
reusable and PROG2 is loaded using the DCB parameter and given control.
The problem encountered in the example above could be avoided by any one of the
following sequences:
v PROG1 links to PROG2 and PROG2 links to PROG2
v PROG1 loads and branches to PROG2. PROG2 loads and branches to PROG2
v PROG1 links to PROG2 and PROG2 loads and branches to PROG2
Once a module has been loaded from a task library, step library, or job library, the
module name is known to all tasks in the address space and may be used as long
as the module is considered usable. Generally speaking, reenterable modules are
always usable. Serially reusable modules are usable when they are currently in use.
Non-reentrant, non-serially reusable modules are considered usable for LOAD if the
use count is zero. A module is considered usable for ATTACH, LINK, or XCTL if it
has not been marked NOT REUSABLE by a previous ATTACH, LINK, or XCTL. The
use count is not considered.
If you know that the load module you are requesting is a member of one of the
private libraries, you can still use the EP or EPLOC parameter, this time in
conjunction with the DCB parameter. Specify the address of the data control block
for the private library in the DCB parameter. The order of the search for EP or
EPLOC with the DCB parameter (when the DCB parameter is not 0) is shown in
Figure 4-13.
Searching a job or step library slows the retrieval of load modules from the link
library; to speed this retrieval, you should limit the size of the job and step libraries.
You can best do this by eliminating the job library altogether and providing step
libraries where required. You can limit each step library to the data sets required by
a single step. Some steps (such as compilation) do not require a step library and
therefore do not require searching and retrieving modules from the link library. For
maximum efficiency, you should define a job library only when a step library would
be required for every step, and every step library would be the same.
The DE parameter requires more work than the EP and EPLOC parameters, but it
can reduce the amount of time spent searching for a load module. Before you can
4-18
use this parameter, you must use the BLDL macro to obtain the directory entry for
the module. The directory entry is part of the library that contains the module. See
z/OS DFSMS Macro Instructions for Data Sets for more information about the BLDL
macro.
To save time, the BLDL macro must obtain directory entries for more than one entry
name. Specify the names of the load modules and the address of the data control
block for the library when using the BLDL macro; the control program places a copy
of the directory entry for each entry name requested in a designated location in
virtual storage. If you specify the link library and the job or step library by specifying
DCB=0, the directory information indicates from which library the directory entry was
taken. The directory entry always indicates the relative track and block location of
the load module in the library. If the load module is not located on the library you
indicate, a return code is given. You can then issue another BLDL macro specifying
a different library.
To use the DE parameter, provide the address of the directory entry and code or
omit the DCB parameter to indicate the same library specified in the BLDL macro.
The task using the DE parameter should be the same as the one which issued the
BLDL or one which has the same job, step, and task library structure as the task
issuing the BLDL. The order of the search when the DE parameter is used is shown
in Figure 4-14 for the link, job, step, and private libraries.
The preceding discussion of the search is based on the premise that the entry
name you specified is the member name. The control program checks for an alias
entry point name when the load module is found in a library. If the name is an alias,
the control program obtains the corresponding member name from the library
directory, and then searches to determine if a usable copy of the load module exists
in the job pack area. If a usable copy does not exist in a pack area, a new copy is
brought into the job pack area. Otherwise, the existing copy is used, conserving
virtual storage and eliminating the loading time.
Directory Entry Indicates Link Library and DCB=0 or DCB Parameter Omitted.
1.
2.
3.
4.
The
The
The
The
Directory Entry Indicates Job, Step, or Task Library and DCB=0 or DCB Parameter
Omitted.
1. The job pack area is searched for an available copy.
2. The module is obtained from the task library designated by the Z byte of the
DE operand.
DCB Parameter Indicates Private Library
1. The job pack area is searched for an available copy.
2. The module is obtained from the specified private library.
Figure 4-14. Search for Module Using DE Parameter
As the discussion of the search indicates, you should choose the parameters for the
macro that provide the shortest search time. The search of a library actually
involves a search of the directory, followed by copying the directory entry into virtual
storage, followed by loading the load module into virtual storage. If you know the
Chapter 4. Program Management
4-19
location of the load module, you should use the parameters that eliminate as many
of these unnecessary searches as possible, as indicated in Figure 4-12,
Figure 4-13, and Figure 4-14. Examples of the use of these figures are shown in the
following discussion of passing control.
If a copy of the specified load module is not already in the link pack area, use the
LOAD macro to place a copy in the address space. When you issue a LOAD
macro, the control program searches for the load module as discussed previously
and brings a copy of the load module into the address space if required. Normally,
you should use the LOAD macro only for a reenterable or serially reusable load
module, because the load module is retained even though it is not in use.
|
|
|
|
|
The control program places the copy of the load module in subpool 244 or subpool
251, unless the following three conditions are true:
v The module is reentrant
v The library is authorized
v You are not running under TSO/E test
4-20
|
|
|
|
|
In this case, the control program places the module in subpool 252. When choosing
between subpools 244 and 251. the control program uses:
v subpool 244 only when within a task that was created by ATTACHX with the
KEY=NINE parameter
v subpool 251 in all other cases.
|
|
|
Subpool 244 is not fetch protected and has a storage key equal to your PSW key.
Subpool 251 is fetch protected and has a storage key equal to your PSW key.
Subpool 252 is not fetch protected and has storage key 0.
The use count for the copy is lowered by one when you issue a DELETE macro
during the task which was active when the LOAD macro was issued. When a task
is terminated, the count is lowered by the number of LOAD macros issued for the
copy when the task was active minus the number of deletions. When the use count
for a copy in a job pack area reaches zero, the virtual storage area containing the
copy is made available.
4-21
The return address in your control section is always the instruction following the
LINK or LINKX; that is not, however, the address that the called load module
receives in register 14. The control program saves the address of the location in
your program in its own save area, and places in register 14 the address of a
routine within the control program that will receive control. Because control was
passed using the control program, return must also be made using the control
program. The control program also handles all switching of addressing mode when
processing the LINK or LINKX macro.
Note: A program that is LINKed to will get control with the callers Floating Point
Registers and Floating Point Control register. The S/390 linkage convention
applies. For more information, see Chapter 2, Linkage Conventions.
The control program establishes a use count for a load module when control is
passed using the LINK or LINKX macro. This is a separate use count from the
count established for LOAD macros, but it is used in the same manner. The count
is increased by one when a LINK or LINKX macro is issued and decreased by one
when return is made to the control program or when the called load module issues
an XCTL or XCTLX macro.
Figure 4-15 and Figure 4-16 show the coding of a LINK or LINKX macro used to
pass control to an entry point in a load module. In Figure 4-15, the load module is
from the link, job, or step library; in Figure 4-16, the module is from a private library.
Except for the method used to pass control, this example is similar to Figures 10
and 11. A problem program parameter list containing the addresses INDCB,
OUTDCB, and AREA is passed to the called load module; the return point is the
instruction following the LINK or LINKX macro. A V-type address constant is not
generated, because the load module containing the entry point NEXT is not to be
edited into the calling load module. Note that the EP parameter is chosen, since the
search begins with the job pack area and the appropriate library as shown in
Figure 4-12.
RETURNPT
AREA
LINK
...
DC
EP=NEXT,PARAM=(INDCB,OUTDCB,AREA),VL=1
12F0
Figure 4-15. Use of the LINK Macro with the Job or Link Library
PVTLIB
OPEN
.
.
LINK
.
.
DCB
(PVTLIB)
EP=NEXT,DCB=PVTLIB,PARAM=(INDCB,OUTDCB,AREA),VL=1
DDNAME=PVTLIBDD,DSORG=PO,MACRF=(R)
Figure 4-17 and Figure 4-18 show the use of the BLDL and LINK macros to pass
control. Assuming that control is to be passed to an entry point in a load module
from the link library, a BLDL macro is issued to bring the directory entry for the
member into virtual storage. (Remember, however, that time is saved only if more
than one directory entry is requested in a BLDL macro. Only one is requested here
for simplicity.)
4-22
LISTADDR
NAMEADDR
BLDL
.
.
DS
DC
DC
DC
DS
0,LISTADDR
0H
H01
H60
CL8NEXT
26H
The first parameter of the BLDL macro is a zero, which indicates that the directory
entry is on the link, job, step, or task library. The second parameter is the address
in virtual storage of the list description field for the directory entry. The second two
bytes at LISTADDR indicate the length of each entry. A character constant is
established to contain the directory information to be placed there by the control
program as a result of the BLDL macro. The LINK macro in Figure 4-18 can now be
written. Note that the DE parameter refers to the name field, not the list description
field, of the directory entry.
LINK
DE=NAMEADDR,DCB=0,PARAM=(INDCB,OUTDCB,AREA),VL=1
4-23
attributes. You must always know what the reusability attribute of the load module
is. If you do not know, you should not attempt to pass control yourself.
If the load module is reenterable, one copy of the load module is all that is ever
required for a job step. You do not have to determine the status of the copy; it can
always be used. You can pass control by using a CALL macro, a branch, a branch
and link instruction, a branch and save instruction, or a branch and save and set
mode instruction (BASSM). Use BASSM (or the CALL macro with the
LINKINST=BASSM parameter specified) only if there is to be an addressing mode
switch.
If the load module is serially reusable, one use of the copy must be completed
before the next use begins. If your job step consists of only one task, make sure
that the logic of your program does not require a second use of the same load
module before completion of the first use. This prevents simultaneous use of the
same copy. An exit routine must not require the use of a serially reusable load
module also required in the main program.
Preventing simultaneous use of the same copy when you have more than one task
in the job step requires more effort on your part. You must still be sure that the logic
of the program for each task does not require a second use of the same load
module before completion of the first use. You must also be sure that no more than
one task requires the use of the same copy of the load module at one time. You
can use the ENQ macro for this purpose. Properly used, the ENQ macro prevents
the use of a serially reusable resource, in this case a load module, by more than
one task at a time. For information on the ENQ macro, see Chapter 6, Resource
Control on page 6-1 You can also use a conditional ENQ macro to check for
simultaneous use of a serially reusable resource within one task.
If the load module is non-reusable, each copy can only be used once; you must be
sure that you use a new copy each time you require the load module. You can
ensure that you always get a new copy by using a LINK macro or by doing the
following:
1. Issue a LOAD macro before you pass control.
2. Pass control using a branch, branch and link, branch and save, branch and
save and set mode instruction, or a CALL macro.
3. Issue a DELETE macro as soon as you are through with the copy.
4-24
However, when you pass control in this manner, you must ensure that multiple uses
of non-reusable or serially reusable modules does not occur. The following
paragraphs discuss the requirements for passing control without return in each
case.
4-25
list. The control program loads a copy of the target load module, if necessary, loads
the entry address in register 15, saves the address passed in register 14, and
passes control to the address in register 15. The control program adds one to the
use count for the copy of the target load module and subtracts one from the use
count for the current load module. The current load module in this case is the load
module last given control using the control program in the performance of the active
task. If you have been passing control between load modules without using the
control program, chances are the use count will be lowered for the wrong load
module copy. And remember, when the use count of a copy reaches zero, that copy
may be deleted, causing unpredictable results if you try to return control to it.
Figure 4-19 shows how this could happen. Control is given to load module A, which
passes control to the load module B (step 1) using a LOAD macro and a branch
and link instruction. Register 14 at this time contains the address of the instruction
following the branch and link. Load module B then executes, independently of how
control was passed, and issues an XCTL or XCTLX macro when it is finished (step
2) to pass control to target load module C. The control program knowing only of
load module A, lowers the use count of A by one, resulting in its deletion. Load
module C is executed and returns to the address which used to follow the branch
and link instruction. Step 3 of Figure 4-19 indicates the result.
4-26
Control Program
A
Step 1
B
LOAD B
BALR B
Control
Program
Control
Program
A
BALR
Step 2
XCTL C
Control
Program
B
C
Step 3
XCTL C
RETURN
To routine which
last issued a BALR
instruction.
Two methods are available for ensuring that the proper use count is lowered. One
way is to always use the control program to pass control with or without return. The
other method is to use only LOAD and DELETE macros to determine whether or
not a copy of a load module should remain in virtual storage.
Note: The control program abnormally terminates the task if the XCTL issuer
added entries to the linkage stack and did not remove them before issuing
the XCTL.
4-27
4-28
4-29
address of your MIPR. You can pass 16 bytes of information to the MIPR using the
USERDATA parameter. Information could include register contents, parameter list
addresses, or other information your MIPR requires. CSVINFO places your user
data into the CSVMODI data area.
References
The CSVMODI data area serves as the interface between the CSVINFO
service and the MIPR. For more information about the CSVMODI mapping
macro, see z/OS MVS Data Areas, Vol 1 (ABEP-DALT).
z/OS MVS IPCS Commands explains how to verify the correct use of the
CSVINFO macro in an IPCS exit. See the TRAPON, TRAPOFF, and
TRAPLIST subcommand descriptions.
z/OS MVS IPCS Customization provides information about writing IPCS exits.
Figure 4-20 on page 4-31 shows the processing that occurs when your program or
exit issues the CSVINFO macro. The numbered steps are explained below:
1. The application or IPCS exit invokes the CSVINFO macro.
2. CSVINFO retrieves the module information you want.
3. CSVINFO places the information into the CSVMODI data area.
4. CSVINFO passes control to your MIPR.
5. The MIPR reads the information that is in the CSVMODI data area.
6. The MIPR places the information into your storage or otherwise processes the
information.
7. The MIPR sets a return code for CSVINFO:
v A return code of zero to request information about another loaded module
v A nonzero return code to indicate that no more information is needed.
8. The MIPR returns control to CSVINFO.
9. Steps 2 through 8 are repeated until the MIPR indicates to CSVINFO that no
more information is needed, or CSVINFO indicates to the MIPR that all
information has been retrieved.
10. CSVINFO sets a return code and returns control to your program when the
MIPR passes CSVINFO a return code indicating that no more information is
needed, or when CSVINFO has passed all the information to the MIPR.
11. The application or IPCS exit continues processing.
4-30
Application or
IPCS Exit Code
Some processing
CSVINFO
1. Call CSVINFO
2. Retrieve requested
information
3. Place information
into CSVMODI
data area
4. Pass control to the
MIPR
MIPR
5. Obtain information
from CSVMODI
data area
6. Process the
information from
CSVMODI
9. Repeat steps 2
through 8 until the
MIPR indicates no
more information
is needed or all
information has
been passed to
the MIPR.
11. Check the
return code
and continue
processing
Figure 4-20. Processing Flow for the CSVINFO Macro and the Callers MIPR
Serialization
Information about loaded modules in common storage is serialized by the LOCAL
and CMS locks. Information about other loaded modules is serialized by the LOCAL
lock. When the CSVINFO service runs with serialization, you are guaranteed that
the information CSVINFO obtains is not in the process of being updated.
If your program runs in problem state and invokes the CSVINFO macro, your
program cannot hold the appropriate locks and the CSVINFO service does not
obtain them. Thus, the CSVINFO service retrieves information without serializing on
it. If you are requesting information about loaded modules in common storage or if
multi-tasking is taking place in your address space, the module information you
request might be changing while the CSVINFO service is retrieving information. In
rare instances, the CSVINFO service could return incorrect information or end
abnormally.
If your program runs in supervisor state and invokes the CSVINFO macro, the
CSVINFO service obtains the appropriate locks if your program does not already
hold them.
4-31
MIPR Environment
The MIPR receives control running under the unit of work that invoked the
CSVINFO macro, in the following environment:
Minimum authorization:
Dispatchable unit mode:
Cross memory mode:
AMODE:
ASC mode:
Interrupt status:
Control parameters:
Caller State/Key
Recovery Provided
ENV=MVS
Supervisor state
Problem state
ENV=IPCS
Entry Specifications
The MIPR gets control through standard branch entry linkage. Input to the MIPR is
the address of the CSVMODI data area, containing information from the CSVINFO
service.
Registers at Entry
When the MIPR receives control, the general purpose registers (GPRs) contain the
following information:
GPR
Contents
2 - 12
13
14
15
Return Specifications
Upon return from MIPR processing, you must ensure that the register contents are
as follows:
Registers at Exit
GPR
4-32
Contents
0-1
The MIPR does not have to place any information into these
registers, and does not have to restore their contents to what they
were when the MIPR received control.
2-13
The MIPR must restore the register contents to what they were
when the MIPR received control.
14
15
Note: The CSVINFO service continues processing until either of the following
occurs:
v It receives a non-zero return code from the MIPR.
v It has returned all available data
When CSVINFO receives a non-zero return code, it returns control to the program
that invoked the CSVINFO macro.
4-33
4-34
Virtual Storage
In the MVS virtual storage map:
v Each address space has its own two gigabytes of virtual storage.
v Each private area has a portion below 16 megabytes and an extended portion
above 16 megabytes but, logically, these areas can be thought of as one area.
Figure 5-1 shows the virtual storage map.
5-1
alias. These attributes are the programmers specification of the addressing mode in
which the program is expected to get control and where the program is expected to
reside in virtual storage.
AMODE defines the addressing mode (24, 31, or ANY) in which a program expects
to receive control. Addressing mode refers to the address length that a program is
prepared to handle on entry: 24-bit addresses, 31-bit addresses, or both (ANY).
Programs with an addressing mode of ANY have been designed to receive control
in either 24- or 31-bit addressing mode.
2 gigabytes
ELSQA/ESWA 229/230
Extended
Private
ECSA
Extended
EPLPA/EFLPA/EMLPA
Common
ESQA
Extended Nucleus
31-Bit
Addressing
Range
Nucleus
SQA
Common
PLPA/FLPA/MLPA/BLDL
CSA
LSQA/SWA/229/230
24-Bit
Addressing
Range
Private
Common
PSA
0
A 370-XA or 370-ESA processor can operate with either 24-bit addresses (16
megabytes of addressability) or 31-bit addresses (2 gigabytes of addressability).
This ability of the processor to permit the execution of programs in 24-bit
addressing mode as well as programs in 31-bit addressing mode is called bimodal
operation. A programs AMODE attribute determines whether the program is to
receive control with 24-bit or 31-bit addresses. Once a program gets control, the
program can change the AMODE if necessary.
In 24-bit addressing mode, the processor treats all virtual addresses as 24-bit
values. This makes it impossible for a program in 24-bit addressing mode to
address virtual storage with an address greater than 16,777,215 (16 megabytes)
because that is the largest number that a 24-bit binary field can contain.
5-2
In 31-bit addressing mode, the processor treats all virtual addresses as 31-bit
values.
The processor supports bimodal operation so that both new programs and most old
programs can execute correctly. Bimodal operation is necessary because certain
coding practices in existing programs depend on 24-bit addresses. For example:
v Some programs use a 4-byte field for a 24-bit address and place flags in the
high-order byte.
v Some programs use the LA instruction to clear the high-order byte of a register.
(In 24-bit addressing mode, LA clears the high-order byte; in 31-bit addressing
mode, it clears only the high-order bit.)
v Some programs depend on BAL and BALR to return the ILC (instruction length
code), the CC (condition code), and the program mask. (BAL and BALR return
this information in 24-bit addressing mode. In 31-bit addressing mode they do
not.)
Each load module and each alias entry has an AMODE attribute.
A CSECT can have only one AMODE, which applies to all its entry points. Different
CSECTs in a load module can have different AMODEs.
RMODE specifies where a program is expected to reside in virtual storage. The
RMODE attribute is not related to central storage requirements. (RMODE 24
indicates that a program is coded to reside in virtual storage below 16 megabytes.
RMODE ANY indicates that a program is coded to reside anywhere in virtual
storage.)
Each load module and each alias entry has an RMODE attribute. The alias entry is
assigned the same RMODE as the main entry.
The following kinds of programs must reside in the range of addresses below 16
megabytes (addressable by 24-bit callers):
v Programs that have the AMODE 24 attribute
v Programs that have the AMODE ANY attribute
v Programs that use system services that require their callers to be AMODE 24
v Programs that use system services that require their callers to be RMODE 24
v Programs that must be addressable by 24-bit addressing mode callers
Programs without these characteristics can reside anywhere in virtual storage.
Addressing Mode and Residency Mode on page 5-12 describes AMODE and
RMODE processing and 31-bit addressing support of AMODE and RMODE in
detail.
5-3
CC
PGM
Mask
4
31
In 31-bit addressing mode, BAL and BALR put the return address into bits 1
through 31 of the first operand register and save the current addressing mode in
the high-order bit. Because the addressing mode is 31-bit, the high-order bit is
5-4
always a 1.
First operand register (31-bit addressing mode)
1
0
31
When executing in 31-bit addressing mode, BAL and BALR do not save the
instruction length code, the condition code, or the program mask. IPM (insert
program mask) can be used to save the program mask and the condition code.
LA: The LA (load address) instruction, when executed in 31-bit addressing mode,
loads a 31-bit value and clears the high-order bit. When executed in 24-bit
addressing mode, it loads a 24-bit value and clears the high-order byte (as in
MVS/370 mode).
LRA: The LRA (load real address) instruction always results in a 31-bit real
address regardless of the issuing programs AMODE. The virtual address specified
is treated as a 24-bit or 31-bit address based on the value of the PSW A-mode bit
at the time the LRA instruction is executed.
Branching Instructions
BASSM (branch and save and set mode) and BSM (branch and set mode) are
branching instructions that manipulate the PSW A-mode bit (bit 32). Programs can
use BASSM when branching to modules that might have different addressing
modes. Programs invoked through a BASSM instruction can use a BSM instruction
to return in the callers addressing mode. BASSM and BSM are described in more
detail in Establishing Linkage on page 5-21.
BAS (branch and save) and BASR:
v Save the return address and the current addressing mode in the first operand.
v Replace the PSW instruction address with the branch address.
The high-order bit of the return address indicates the addressing mode. BAS and
BASR perform the same function that BAL and BALR perform in 31-bit addressing
mode. In 24-bit mode, BAS and BASR put zeroes into the high-order byte of the
return address register.
5-5
5-6
Figure 5-2 summarizes the things that you need to do to maintain the proper
interface with a program that you plan to change to 31-bit addressing mode.
Calling Module
Invoked Module
AMODE 24
RMODE 24
CALL or BALR
to another CSECT
AMODE 31
RMODE 24
AMODE 24
RMODE 24
LINKX, XCTLX, ATTACHX,
LINK, XCTL, or ATTACH
5-7
Table 5-1. Establishing Correct Interfaces to Modules That Move Above 16 Megabytes
Means of Entry to Moved Module
(AMODE 31,RMODE ANY)
LOAD macro and BALR
or
v Have caller use LOAD macro and
BASSM (invoked program returns via
BSM)
or
v Change caller to AMODE 31,RMODE
24 before BALR
BALR using an address in a common
control block
or
v Change the address in the control block
to a pointer-defined value (described in
Establishing Linkage on page 5-21)
and use BASSM. (The moved module
will use BSM to return.)
ATTACH, ATTACHX, LINK, LINKX, XCTL,
or XCTLX
No changes required.
No changes required.
or
v Have caller switch to AMODE 31 before
issuing SYNCH or SYNCHX.
v Change address in the control block to
a pointer-defined value and use SYNCH
or SYNCHX with AMODE=DEFINED.
5-8
3. Are any address fields that are less than 4 bytes still appropriate? Make sure
that a load instruction does not pick up a 4-byte field containing a 3-byte
address with extraneous data in the high-order byte. Make sure that bits 1-7 are
zero.
4. Does the program use the ICM (insert characters under mask) instruction? The
use of this instruction is sometimes a problem because it can put data into the
high-order byte of a register containing an address, or it can put a 3-byte
address into a register without first zeroing the register. If the register is then
used as a base, index, or branch address register in 31-bit addressing mode, it
might not indicate the proper address.
5. Does the program invoke 24-bit addressing mode programs? If so, shared data
must be below 16 megabytes.
6. Is the program invoked by 24-bit or 31-bit addressing mode programs? Is the
data in an area addressable by the programs that need to use it? (The data
must be below 16 megabytes if used by a 24-bit addressing mode program.)
1,A
SR
ICM
1,1
1,7,A+1
The 7 specifies a 4-bit mask of 0111. The ICM instruction shown inserts bytes
beginning at location A+1 into register 1 under control of the mask. The bytes to
be filled correspond to the 1 bits in the mask. Because the high-order byte in
register 1 corresponds to the 0 bit in the mask, it is not filled.
v If the program needs storage above 16 megabytes, obtain the storage using the
STORAGE macro or the VRU, VRC, RU, and RC forms of GETMAIN and
FREEMAIN, or the corresponding functions on STORAGE. In addition, you can
obtain storage above 16 megabytes by using CPOOL services. These are the
only forms that allow you to obtain and free storage above 16 megabytes. Do not
use storage areas above 16 megabytes for save areas and parameters passed
to other programs.
5-9
v Do not use the STAE macro; use ESTAE or ESTAEX. STAE has 24-bit
addressing mode dependencies.
v Do not use SPIE; use ESPIE. SPIE has 24-bit addressing mode dependencies.
v Do not use previous paging services macros; use PGSER.
v To make debugging easier, switch addressing modes only when necessary.
v Identify the intended AMODE and RMODE for the program in a prologue.
v 31-bit addressing mode programs should use ESTAE, ESTAEX or the ESTAI
parameter on the ATTACH, or ATTACHX macro rather than STAE or STAI. STAI
has 24-bit addressing mode dependencies. When recovery routines refer to the
SDWA for PSW-related information, they should refer to SDWAEC1 (EC mode
PSW at the time of error) and SDWAEC2 (EC mode PSW of the program
request block (PRB) that established the ESTAE-type recovery.
When writing new programs, you need to decide whether to use 24-bit
addressing mode or 31-bit addressing mode.
The following are examples of kinds of programs that you should write in 24-bit
addressing mode:
Programs that must execute on MVS/370 as well as MVS/XA or MVS/ESA
and do not require any new MVS functions.
Service routines, even those in the common area, that use system services
requiring entry in 24-bit addressing mode or that must accept control directly
from unchanged 24-bit addressing mode programs.
When you use 31-bit addressing mode, you must decide whether the new
program should reside above or below 16 megabytes (unless it is so large that it
will not fit below). Your decision depends on what programs and system services
the new program invokes and what programs invoke it.
5-10
with macro libraries from a 31-bit addressing system (MVS/XA or MVS/ESA). You
can also assemble these programs on 31-bit addressing systems with macro
libraries from MVS/370, but you must generate MVS/370-compatible macro
expansions by specifying the SPLEVEL macro at the beginning of the programs.
If the program needs to use new MVS functions, your programming task is more
difficult because most MVS/XA functions are not supported on MVS/370. You need
to use dual paths in your program so that on each system your program uses the
services or macros that are supported on that system.
Programs designed to execute on either 24 or 31-bit addressing systems must use
fullword addresses where possible and use no new functions on macros except the
LOC parameter on GETMAIN. These programs must also be aware of downward
incompatible macros and use SPLEVEL as needed.
SPLEVEL Macro
Some macros are downward incompatible. The level of the macro expansion
generated during assembly depends on the value of an assembler language global
SET symbol. When the SET symbol value is 1, the system generates MVS/370
expansions. When the SET symbol value is 2 or greater, the system generates
MVS/XA or MVS/ESA expansions.
The SPLEVEL macro allows programmers to change the value of the SET symbol.
The SPLEVEL macro shipped with OS/390 MVS sets a default value of 5 for the
SET symbol. Therefore, unless a program or installation specifically changes the
default value, the macros generated are MVS/ESA macro expansions.
You can, within a program, issue the SPLEVEL SET=1 macro to obtain MVS/370
(MVS/System Product Version 1 Release 3.0) expansions, or SPLEVEL SET=2 to
obtain MVS/XA expansions, or SPLEVEL=3, 4, or 5 to obtain MVS/ESA expansions.
The SPLEVEL macro sets the SET symbol value for that programs assembly only
and affects only the expansions within the program being assembled. A single
program can include multiple SPLEVEL macros to generate different macro
expansions. The following example shows how to obtain different macro expansions
within the same program by assembling both expansions and making a test at
execution time to determine which expansion to execute.
*
z/OS MVS Programming: Assembler Services Guide and z/OS MVS Programming:
Assembler Services Reference IAR-XCT describe the SPLEVEL macro.
Certain macros produce a map of control blocks or parameter lists. These
mapping macros do not support the SPLEVEL macro. Mapping macros for different
5-11
levels of MVS systems are available only in the macro libraries for each system.
When programs use mapping macros, a different version of the program may be
needed for each system.
Dual Programs
Sometimes two programs may be required, one for each system. In this case, use
one of the following approaches:
v Keep each in a separate library
v Keep both in the same library but under different names
5-12
The ATTACH, ATTACHX, LINK, LINKX, XCTL, and XCTLX macros give the invoked
module control in the AMODE previously specified. However, specifying a particular
AMODE does not guarantee that a module that gets control by other means will
receive control in that AMODE. For example, an AMODE 24 module can issue a
BALR to an AMODE 31, RMODE 24 module. The AMODE 31 module will get
control in 24-bit addressing mode.
RMODE 24
RMODE ANY
AMODE 24
Valid
Invalid
AMODE 31
Valid
Valid
AMODE ANY
Valid
It Depends
1.
2.
This is a valid combination in that the assembler, linkage editor, and loader
accept it from all sources. However, the combination is not used at
execution time. Specifying ANY is a way of deferring a decision about the
actual AMODE until the last possible moment before execution. At
execution time, however, the module must execute in either 24-bit or 31-bit
addressing mode.
3.
5-13
Operation
Operand
AMODE
24/31/ANY
The name field associates the addressing mode with a control section. If there is a
symbol in the name field of an AMODE statement, that symbol must also appear in
the name field of a START, CSECT, or COM statement in the assembly. If the name
field is blank, there must be an unnamed control section in the assembly.
Similarly, the name field associates the residency mode with a control section. The
RMODE statement specifies the residency mode to be associated with a control
section. The format of the RMODE instruction is:
Name
Operation
Operand
RMODE
24/ANY
Both the RMODE and AMODE instructions can appear anywhere in the assembly.
Their appearance does not initiate an unnamed CSECT. There can be more than
one RMODE (or AMODE) instruction per assembly, but they must have different
name fields.
The defaults when AMODE, RMODE, or both are not specified are:
5-14
Specified
Defaulted
Neither
AMODE 24 RMODE 24
AMODE 24
RMODE 24
AMODE 31
RMODE 24
AMODE ANY
RMODE 24
RMODE 24
AMODE 24
RMODE ANY
AMODE 31
PARM field input overrides object module and load module input.
v Linkage editor MODE control statements in the SYSLIN data set. For example:
MODE AMODE(31),RMODE(24)
MODE control statement input overrides object module, load module and PARM
input.
Linkage editor processing results in two sets of AMODE and RMODE indicators
located in:
v The load module
v The PDS entry for the member name and any PDS entries for alternate names
or alternate entry points that were constructed using the linkage editor ALIAS
control statement.
These two sets of indicators might differ because they can be created from different
input. The linkage editor creates indicators in the load module based on input from
the input object module and load module. The linkage editor creates indicators in
the PDS directory based not only on input from the object module and load module
but also on the PARM field of the linkage editor EXEC statement, and the MODE
control statements in the SYSLIN data set. The last two sources of input override
indicators from the object module and load module. Figure 5-4 shows linkage editor
processing of AMODE and RMODE.
5-15
Assemble Input
Optional AMODE/
RMODE PARM
values from JCL
EXEC statement
and/or MODE
control statement.
Assembler H
Version 2
Linkage Editor Processing
Processes AMODE/RMODE
values from object module
and load module.Puts
AMODE/RMODE into output
load module.(The linkage
editor does not use
AMODE/RMODE values from
the PDS.)
Load Module:
Contains AMODE/RMODE of each
executable control section and
named common control second
(derived from object module and
load module input values.)
PDS contains AMODE/RMODE
value from object module or
load module or from overriding
PARM values or MODE control
statements.
PARM values or MODE control
statements.
5-16
MVS/XA and MVS/ESA treat programs in overlay structure as AMODE 24, RMODE
24 programs. Putting a program into overlay structure destroys any AMODE and
RMODE specifications contained in the load module.
The linkage editor recognizes as valid the following combinations of AMODE and
RMODE:
AMODE 24
RMODE 24
AMODE 31
RMODE 24
AMODE 31
RMODE ANY
AMODE ANY
RMODE 24
AMODE ANY
RMODE ANY
The linkage editor accepts the ANY/ANY combination from the object module or
load module and places AMODE 31, RMODE ANY into the PDS (unless overridden
by PARM values or MODE control statements). The linkage editor does not accept
ANY/ANY from the PARM value or MODE control statement.
Any AMODE value specified alone in the PARM field or MODE control statement
implies an RMODE of 24. Likewise, an RMODE of ANY specified alone implies an
AMODE of 31. However, for RMODE 24 specified alone, the linkage editor does not
assume an AMODE value. Instead, it uses the AMODE value specified in the
CSECT in generating the entry or entries in the PDS.
When the linkage editor creates an overlay structure, it assigns AMODE 24,
RMODE 24 to the resulting program.
5-17
Unlike the linkage editor, the loader does not accept MODE control statements from
the SYSLIN data set, but it does base its loading sequence on the sequence of
items in SYSLIN.
The loader passes the AMODE value to MVS. The loader processes the RMODE
value as follows. If the user specifies an RMODE value in the PARM field, that
value overrides any previous RMODE value. Using the value of the first RMODE it
finds in the first object module or load module it encounters that is not for a
common section, the loader obtains virtual storage for its output. As the loading
process continues, the loader may encounter a more restrictive RMODE value. If,
for example, the loader begins loading based on an RMODE ANY indicator and
later finds an RMODE 24 indicator in a section other than a common section, it
issues a message and starts over based on the more restrictive RMODE value.
Figure 5-5 shows loader processing of AMODE and RMODE.
Assembler Input
Loader Input
Optional AMODE/
RMODE PARM
values from JCL
EXEC statement.
Assembler H
Version 2
Loader Processing
5-18
v ATTACH, ATTACHX, LINK, LINKX, XCTL, and XCTLX give the invoked module
control in the addressing mode specified by its AMODE.
v LOAD brings a module into storage based on its RMODE and sets bit 0 in
register 0 to indicate its AMODE.
v CALL passes control in the AMODE of the caller.
v SYNCH or SYNCHX has an AMODE parameter that you can use to specify the
AMODE of the invoked module.
v For SVCs, the system saves and sets the addressing mode.
v SRBs are dispatched in the addressing mode indicated by the SRB specified to
the SCHEDULE macro.
v The cross memory instructions PC and PT establish the addressing mode for the
target program.
v DFP access methods, except VSAM macros and OPEN and CLOSE macros,
support AMODE 24 RMODE 24 callers only. VSAM macros and OPEN and
CLOSE macros support all addressing and residency mode callers.
v Dumping is based on the AMODE specified in the error-related PSW.
Program Fetch
The system uses RMODE information from the PDS to determine whether to
obtain storage above or below 16 megabytes.
ATTACH, ATTACHX, LINK, LINKX, XCTL, and XCTLX
Issuing an ATTACH or ATTACHX macro causes the control program to create a
new task and indicates the entry point to be given control when the new task
becomes active. If the entry point is a member name or an alias in the PDS.
ATTACH or ATTACHX gives it control in the addressing mode specified in the
PDS or in the mode specified by the loader. If the invoked program has the
AMODE ANY attribute, it gets control in the AMODE of its caller.
The LINK, LINKX, XCTL, and XCTLX macros also give the invoked program
control in the addressing mode indicated by its PDS for programs brought in by
fetch or in the AMODE specified by the loader. The entry point specified must
be a member name or an alias in the PDS passed by the loader, or specified in
an IDENTIFY macro. If the entry point is an entry name specified in an
IDENTIFY macro, IDENTIFY sets the addressing mode of the entry name equal
to the addressing mode of the main entry point.
LOAD
Issuing the LOAD macro causes MVS to bring the load module containing the
specified entry point name into virtual storage (if a usable copy is not already
there). LOAD sets the high-order bit of the entry point address in register 0 to
indicate the modules AMODE (0 for 24, 1 for 31), which LOAD obtains from the
modules PDS entry. If the modules AMODE is ANY, LOAD sets the high-order
bit in register 0 to correspond to the callers AMODE.
LOAD places the module in virtual storage either above or below 16 megabytes
as indicated by the modules RMODE, which is specified in the PDS for the
module.
Specifying the ADDR parameter indicates that you want the module loaded at a
particular location. If you specify an address above 16 megabytes, be sure that
the module being loaded has the RMODE ANY attribute. If you do not know the
AMODE and RMODE attributes of the module, specify an address below 16
megabytes or omit the ADDR parameter.
5-19
CALL
The CALL macro passes control to an entry point via BALR. Thus control is
transferred in the AMODE of the caller. CALL does not change AMODE.
SYNCH or SYNCHX
Using the AMODE parameter on the SYNCH or SYNCHX macro, you can
specify the addressing mode in which the invoked module is to get control.
Otherwise, SYNCH or SYNCHX passes control in the callers addressing mode.
SVC
For SVCs (supervisor calls), MVS saves and restores the issuers addressing
mode and makes sure that the invoked service gets control in the specified
addressing mode.
SRB
When an SRB (service request block) is dispatched, MVS sets the addressing
mode based on the high-order bit of the SRBEP field. This bit, set by the issuer
of the SCHEDULE macro, indicates the addressing mode of the routine
operating under the dispatched SRB.
PC and PT
For a program call (PC), the entry table indicates the target programs
addressing mode. The address field in the entry table must be initialized by
setting the high-order bit to 0 for 24-bit addressing mode or to 1 for 31-bit
addressing mode.
The PC instruction sets up register 14 with the return address and AMODE for
use with the PT (program transfer) instruction. If PT is not preceded by a PC
instruction, the PT issuer must set the high-order bit of the second operand
register to indicate the AMODE of the program being entered (0 for 24-bit
addressing mode or 1 for 31-bit addressing mode).
Data Management Access Methods
User programs must be in AMODE 24, RMODE 24 when invoking DFP access
methods other than VSAM. All non-VSAM access methods require parameter
lists, control blocks, buffers, and user exit routines to reside in virtual storage
below 16 megabytes.
VSAM request macros accept callers in AMODE 31, RMODE ANY. VSAM
allows parameter lists and control blocks to reside above 16 megabytes; for
details on addressing and residence requirements for VSAM parameter lists,
control blocks, buffers, and exit routines, see z/OS DFSMS: Using Data Sets.
AMODEs Effect on Dumps
The only time AMODE has an effect on dumps is when data on either side of
the address in each register is dumped. If the addresses in registers are treated
as 24-bit addresses, the data dumped may come from a different storage
location than when the addresses are treated as 31-bit addresses. If a dump
occurs shortly after an addressing mode switch, some registers may contain
31-bit addresses and some may contain 24 bit addresses, but dumping services
does not distinguish among them. Dumping services uses the AMODE from the
error-related PSW. For example, in dumping the area related to the registers
saved in the SDWA, dumping services uses the AMODE from the error PSW
stored in the SDWA.
5-20
LABEL1
LABEL2
LABEL3
CSECT
RMODE 24
AMODE 24
L 15,ACTLB
L 1,LABEL1
BSM
DC
DS
L
LA
BSM
DS
Establishing Linkage
This section describes the mechanics of correct linkage in 31-bit addressing mode.
Keep in mind that there are considerations other than linkage, such as locations of
areas that both the calling module and the invoked module need to address.
Linkage in MVS systems that use 31-bit addressing (MVS/XA, MVS/ESA and
OS/390) is the same as in MVS/370 for modules whose addressing modes are the
same. As shown in Figure 5-7, it is the linkage between modules whose addressing
modes are different that is an area of concern. The areas of concern that appear in
Figure 5-7 fall into two basic categories:
v Addresses passed as parameters from one routine to another must be addresses
that both routines can use.
5-21
High-order bytes of addresses must contain zeroes or data that the receiving
routine is programmed to expect.
Addresses must be less than 16 megabytes if they could be passed to a
24-bit addressing mode program.
v On transfers of control between programs with different AMODEs, the receiving
routine must get control in the AMODE it needs and return control to the calling
routine in the AMODE the calling routine needs.
There are a number of ways of dealing with the areas of concern that appear in
Figure 5-7:
v Use the branching instructions (BASSM and BSM)
v Use pointer-defined linkage
v Use supervisor-assisted linkage (ATTACH, ATTACHX, LINK, LINKX, XCTL, and
XCTLX)
v Use linkage assist routines
v Use capping.
5-22
AMODE 31
AMODE 31
ok
AMODE 31
AMODE 31
16 megabytes
ok
Possible
of
1
Area
Concern
Definite
2 of
AMODE 24
AMODE 24
Possible
3 of
AMODE 31
ok
1.
Area
Concern
AMODE 31
AMODE 24
Area
Concern
ok
AMODE 24
When an AMODE 31 module that resides above 16 megabytes invokes an AMODE 24 module, the concerns are:
The AMODE 24 program needs to receive control 24-bit mode.
The location of shared data (including control blocks, register save areas, and parameters). Can the AMODE 24
module address the data?
The AMODE 24 module cannot return control unless an addressing mode change occurs.
2.
An AMODE 24 module cannot invoke an AMODE 31 module that resides above the line unless the AMODE 24
module changes its addressing mode either directly or using supervisor-assisted linkage.
3.
4.
While there are no restrictions on the mechanics of linkage between two AMODE 31 modules, there might be
restrictions on parameter values.
Figure 5-7. Linkage Between Modules with Different AMODEs and RMODEs
5-23
The description of BASSM appears in Figure 5-8. (See Principles of Operation for
more information.)
BASSM R ,R
1 2
'0C'
0
R1
8
RR
R2
12
15
Bits 32-63 of the current PSW, including the updated instruction address, are
saved as link information in the general register designated by R1. Subsequently,
the addressing mode and instruction address in the current PSW are replaced
from the second operand. The action associated with the second operand is not
performed if the R2 field is zero.
The contents of the general register designated by the R2 field specify the new
addressing mode and branch address; however when the R2 field is zero, the
operation is performed without branching and without setting the addressing
mode.
When the contents of the general register designated by the R2 field are used,
bit 0 of the register specifies the new addressing mode and replaces bit 32 of the
current PSW, and the branch address is generated from the contents of the
register under the control of the new addressing mode. The new value for the
PSW is computed before the register designated by R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions: Trace (R2 field is not zero).
Figure 5-8. BRANCH and SAVE and Set Mode Description
The description of BSM appears in Figure 5-9. (See Principles of Operation for
more information.)
5-24
BSM
R ,R
1 2
RR
R1
R2
'0B'
0
12
15
Bit 32 of the current PSW, the addressing mode, is inserted into the first
operand. Subsequently the addressing mode and instruction address in the
current PSW are replaced from the second operand. The action associated with
an operand is not performed if the associated R field is zero.
The value of bit 32 of the PSW is placed in bit position 0 of the general register
designated by R1, and bits 1-31 of the register remain unchanged; however,
when the R1 field is zero, the bit is not inserted, and the contents of general
register 0 are not changed.
The contents of the general register designated by the R2 field specify the new
addressing mode and branch address; however, when the R2 field is zero, the
operation is performed without branching and without setting the addressing
mode.
When the contents of the general register designated by the R2 field are used,
bit 0 of the register specifies the new addressing mode and replaces bit 32 of the
current PSW, and the branch address is generated from the contents of the
register under the control of the new addressing mode. The new value for the
PSW is computed before the register designated by R1 is changed.
Condition Code: The code remains unchanged.
Program Exceptions: None.
Figure 5-9. Branch and Set Mode Description
5-25
ABOVE CSECT
ABOVE AMODE 31
ABOVE RMODE ANY
.
.
.
.
.
BSM 0, 14
16 megabytes
BELOW CSECT
BELOW AMODE 24
BELOW RMODE 24
.
.
LOAD
ST
.
EP=ABOVE
0,EPABOVE
.
L
15,EPABOVE
BASSM 14,15
5-26
5-27
RTN1
CSECT
EXTRN
EXTRN
.
.
L
L
BASSM
.
.
L
L
BASSM
.
RTN2AD
RTN3AD
15,=A(RTN2AD)
15,0(,15)
14,15
15,=A(RTN3AD)
15,0(,15)
14,15
__________________________________________________________________
RTN2 CSECT
RTN2 AMODE 24
ENTRY RTN2AD
.
BSM
0,14
RETURN TO CALLER IN CALLERS MODE
RTN2AD DC
A(RTN2)
WHEN USED AS A POINTER-DEFINED VALUE,
INDICATES AMODE 24 BECAUSE BIT 0 IS 0
__________________________________________________________________
RTN3 CSECT
RTN3 AMODE 31
ENTRY RTN3AD
.
BSM
0,14
RETURN TO CALLER IN CALLERS MODE
RTN3AD DC
A(X80000000+RTN3) WHEN USED AS A POINTER-DEFINED VALUE
INDICATES AMODE 31 BECAUSE BIT 0 IS 1
5-28
BEFORE
MOD1 links to MOD2. Both MOD1 and MOD2 reside below 16 megabytes and have the
attributes AMODE 24, RMODE 24 by default.
MOD1 CSECT
MOD2 CSECT
LINK EP=MOD2
AFTER
When MOD2 moves above 16 megabytes, you must make sure it will execute
correctly. Specifically, you must:
MOD2 CSECT
1.
MOD2 AMODE 31
2.
Review system services used to be sure they can be invoked in AMODE 31,
RMODE ANY and make the any necessary changed. (For example, change SPIE
to ESPIE). Review the Conversion Notebook chapters on incompatibilities,
coexistence considerations, and programming considerations. Move any services
that do not permit callers to be in 31-bit mode to modules residing below 16
megabytes.
3.
Make sure all parameters and control blocks needed by MOD1 reside below 16
megabytes.
4.
Make sure all addresses passed by MOD1 have high-order bytes that are free of
extraneous data or code MOD2 to clean up the high-order bytes to any address
shared with MOD1.
5.
Make sure that all fields containing addresses of areas above 16 megabytes are
fullword fields.
16 megabytes
line
MOD1 CSECT
LINK EP=MOD2
AMODE 24
by default
LINK or LINKX handles the mode switching between MOD1 and MOD2 as
follows:
1. LINK or LINKX obtains MOD2's AMODE from the PDS directory entry.
2. LINK or LINKX ensures that MOD2 is entered in the specified AMODE.
3. On completion, LINK or LINKX restores MOD1's AMODE by default and
returns control.
RMODE 24
5-29
residency modes. Using a linkage assist routine, a 24-bit addressing mode module
can invoke a 31-bit addressing mode module without having to make any changes.
The invocation results in an entry to a linkage assist routine that resides below 16
megabytes and invokes the 31-bit addressing mode module in the specified
addressing mode.
Conversely, a 31-bit addressing mode module, such as a new user module, can
use a linkage assist routine to communicate with other user modules that execute in
24-bit addressing mode. The caller appears to be making a direct branch to the
target module, but branches instead to a linkage assist routine that changes modes
and performs the branch to the target routine.
The main advantage of using a linkage assist routine is to insulate a module from
addressing mode changes that are occurring around it.
The main disadvantage of using a linkage assist routine is that it adds overhead to
the interface. In addition, it takes time to develop and test the linkage assist routine.
Some alternatives to using linkage assist routines are:
v Changing the modules to use pointer-defined linkage (described in Using
Pointer-Defined Linkage on page 5-26).
v Adding a prologue and epilogue to a module to handle entry and exit mode
switching, as described later in this chapter under Capping.
5-30
BEFORE
Existing Application - USER1 invokes USER2 repeatedly
USER1
USER2
LOAD EP=USER2
BALR
RETURN
Change
Reason
USER1 does not have to change the LOAD
USER2 macro.
USER1
USER2 (NEW)
USER1 CSECT
LOAD EP=USER2
USER2 CSECT
USER2 AMODE 24
USER2 RMODE 24
LOAD USER3
BALR
BASSM
BSM TO
NEXT
SEQUENTIAL
INSTRUCTION
RETURN
5-31
5-32
00000100
00000200
00000300
00000400
00000500
00000700
00000800
00000900
00001000
00001100
00002000
00002100
00002200
00003000
00003100
00005000
00007000
00007100
00000100
00000200
00000300
00000400
00008100
00008200
v Statements 8000 through 8200: These instructions preserve the AMODE in effect at the time of entry
into module USER2.
v Statement 9200: This use of the BASSM instruction:
Causes the USER3 module to be entered in the specified AMODE (AMODE 31 in this example).
This occurs because the LOAD macro returns a pointer-defined value that contains the entry point of
the loaded routine, and the specified AMODE of the module.
Puts a pointer-defined value for use as the return address into Register 14.
v Statement 9400: Module USER3 returns to this point.
v Statement 9500: Module USER2 re-establishes the AMODE that was in effect at the time the BASSM
instruction was issued (STATEMENT 9200).
Figure 5-13. Example of a Linkage Assist Routine (Part 3 of 4)
5-33
v Statements 300 and 400 establish the AMODE and RMODE values for this module. Unless they are
over-ridden by linkage editor PARM values or MODE control statements, these are the values that will
be placed in the PDS for this module.
v Statement 8100 returns to the invoking module.
Figure 5-13. Example of a Linkage Assist Routine (Part 4 of 4)
5-34
MYPROG
MYPROG
MYPROG
CSECT
AMODE ANY
RMODE 24
USING *,15
STM 14,12,12(13) SAVE CALLERS REGISTERS BEFORE SETTING AMODE
LA 10,SAVE
SET FORWARD ADDRESS POINTER IN CALLERS
ST 10,8(13)
SAVE AREA
LA 12,MYMODE
SET AMODE BIT TO 0 AND ESTABLISH BASE
LA 11,RESETM
GET ADDRESS OF EXIT CODE
BSM 11,12
SAVE CALLERS AMODE AND SET IT TO AMODE 24
USING *,12
MYMODE
DS
0H
DROP 15
ST 13,SAVE+4
SAVE CALLERS SAVE AREA
LR 13,10
ESTABLISH OWN SAVE AREA
_______________________________________________________________________
This is the functional part of the original module.
This example assumes that register 11 retains its
original contents throughout this portion of the program.
_______________________________________________________________________
L
13,4(13)
GET ADDRESS OF CALLERS SAVE AREA
BSM 0,11
RESET CALLERS AMODE
RESETM
DS 0H
LM 14,12,12(13) RESTORE CALLERS REGISTERS IN CALLERS AMODE
BR 14
RETURN
SAVE
DS 0F
DC 18F0
5-35
IDAW
Virtual address of
an I/O buffer
Any CCW that causes data to be transferred can point to a virtual IDAW. Virtual
IDAW support is limited to non-VIO data sets.
Although the I/O buffer can be in virtual storage above 16 megabytes, the virtual
IDAW that contains the pointer to the I/O buffer and all the other areas related to
the I/O operation (CCWs, IOBs, DEBs, and appendages) must reside in virtual
storage below 16 megabytes.
Note: EXCP can translate your virtual channel program to a real channel program
that uses 64-bit IDAWs if you are running in z/Architecture mode and the
device support code allows them.
For more EXCP information, see z/OS DFSMSdfp Advanced Services.
Using EXCPVR
The EXCPVR interface supports only format 0 CCWs. Format 0 CCWs support only
24-bit addresses. All CCWs and IDAWs used with EXCPVR must reside in virtual or
central storage below 16 megabytes. The largest virtual or central storage address
you can specify directly in your channel program is 16 megabytes minus one.
However, using IDAWs (indirect data address words) you can specify any central
storage address and therefore you can perform I/O to any location in real or virtual
storage. EXCPVR channel programs must use IDAWs to specify buffer addresses
above 16 megabytes in central storage.
The format 0 CCW may contain the address of an IDAL (indirect address list),
which is a list of IDAWs (indirect data address words).
5-36
CCW (Format 0)
Address of
IDAL
0 8
32 48
63
IDAL
IDAW
I/O buffer
address
IDAW
IDAW
You must assume that buffers obtained by data management access methods have
real storage addresses above 16 megabytes.
For more EXCPVR information, see z/OS DFSMSdfp Advanced Services.
5-37
BEFORE
Data management
services
USER1
AFTER
USER1 CSECT
USER1 AMODE 31
USER1 RMODE ANY
16 megabytes
USER2 CSECT
USER2 AMODE 24
USER2 RMODE 24
Data management
services
(AMODE 24, RMODE 24
by default)
USER1 moves above 16 megabytes and moves its interface to data management into a new module, USER2.
USER2 remains below 16 megabtyes because some data management services must be invoked 24-bit
addressing mode. The following coding example shows USER1 and USER2 after USER1 has moved.
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 1 of 10)
5-38
5-39
*
*
*
*
*
ST
13,8(9)
LOAD
EP=IOSERV
ST
0,EPA
The GETMAIN at statement #300 requests that the storage to be obtained match the current residency
mode of module USER1. Because the module resides above 16 megabytes, the storage obtained will be
above 16 megabytes.
At statement #400, the address of the callers save area is saved in storage below 16 megabytes.
Prepare to open input and output data base files
MVC
FUNCTION,OPEN1
Indicate open file 1
*
for input
LA
1,COMMAREA
Set up register 1 to
*
point to the parameter
*
area
#500
L
15,EPA
Get pointer-defined address
*
of the I/O service
*
routine
#600
BASSM 14,15
Call the service routine
*
Note: AMODE will change
#650
MVC FUNCTION,OPEN2
Indicate open file 2
*
for output
LA
1,COMMAREA
Setup register 1 to
*
point to the parameter
*
area
#700
L
15,EPA
Get pointer-defined address
*
of the I/O service
*
routine
BASSM 14,15
Call the service routine
*
Note: AMODE will change
The entry point address loaded at statements #500 and #700 is pointer-defined, as returned by the LOAD
service routine. That is, the low-order three bytes of the symbolic field EPA will contain the virtual address
of the loaded routine while the high order bit (bit 0) will be zero to indicate the loaded module is to receive
control in 24-bit addressing mode. The remaining bits (1-7) will also be zero in the symbolic field EPA.
The BASSM at statement #600 does the following:
v Places into bit positions 1-31 of register 14 the address of statement #650.
v Sets the high-order bit of register 14 to one to indicate the current addressing mode.
v Replaces bit positions 32-63 of the current PSW with the contents of register 15 (explained above)
The BSM instruction used by the called service routine USER2 to return to USER1 will reestablish 31-bit
addressing mode.
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 3 of 10)
5-40
*
*
*
LA
ST
LA
1,BUFFR31A
1,BUFPTR+0
1,UPDATBFR
ST
LA
1,BUFPTR+4
1,BUFPTR
L
15,ANALYZE
BASR 14,15
MVC BUFFER,UPDATBFR
#1000
*
*
*
At statement #1000 a BASR instruction is used to call the analysis routine since no AMODE switching is
required. A BALR could also have been used. A BALR executed while in 31-bit addressing mode performs
the same function as a BASR instruction. The topic Mode Sensitive Instructions describes the instruction
differences.
*
*
*
*
*
*
*
*
MVC
LA
FUNCTION,WRITE1
1,COMMAREA
15,EPA
BASSM 14,15
READRTN
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 4 of 10)
Chapter 5. Understanding 31-Bit Addressing
5-41
DS
MVC
LA
0H
FUNCTION,CLOSE1
1,COMMAREA
15,EPA
BASSM 14,15
MVC
LA
FUNCTION,CLOSE2
1,COMMAREA
15,EPA
BASSM 14,15
13,SAVEBKWD
LA
0,WORKLNTH
FREEMAIN RC,LV=(0),A=(6)
DROP 6
LA
0,GMLNTH
FREEMAIN RC,LV=(0),A=(8)
DROP 8
XR
15,15
RETURN (14,12),RC=(15)
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 5 of 10)
5-42
Define DSECTs and constants for module to module communication. Define constants used to
communicate the function module USER2 is to perform.
READ1
WRITE1
OPEN1
OPEN2
CLOSE1
CLOSE2
ANALYZE
*
ENDFILE
WORKAREA
SAVEREGS
*
SAVEAREA
SAVERSVD
SAVEBKWD
SAVEFRWD
SAVE1412
COMMAREA
*
*
FUNCTION
*
STATUS
BUFFER
WORKLNTH
DS
DC
DC
DC
DC
DC
DC
DC
0F
CR1
CW1
CO1
CO2
CC1
CC2
V(ANALYSIS)
DC
CEF
DSECT
DS
0F
EQU
DS
DS
DS
DS
DS
SAVEREGS
F
F
F
15F
0F
DS
CL2
DS
DS
EQU
CL2
CL80
*-WORKAREA
DSECT
DS
DS
DS
DS
DS
UPDATBFR DS
*
GMLNTH EQU
END
F
CL80
0F
A
A
CL80
*-DYNAREA
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 6 of 10)
5-43
*
*
CSECT
AMODE 24
RMODE 24
Save the callers registers in save area provided
SAVE
BASR
USING
LR
USING
(14,12)
12,0
*,12
10,1
COMMAREA,10
Save registers
Establish base
Addressability
Save parameter area pointer
around GETMAINs
Establish parameter area
addressability
Storage will be obtained via GETMAIN for a save area that module USER2 can pass to external
routines it calls.
*
*
*
*
*
*
*
*
LA
0,WORKLNTH
GETMAIN RU,LV=(0),LOC=RES
LR
6,1
USING SAVEREGS,6
LA
0,GMLNTH
Note: This GETMAIN will only be done on the initial call to this module.
#2000
*
*
*
*
*
*
*
GETMAIN RU,LV=(0),LOC=RES
LR
8,1
USING DYNAREA,8
ST
13,SAVEBKWD
LR
9,13
LA
13,SAVEAREA
The GETMAIN at statement #2000 requests that storage be obtained to match the current residency mode
of module USER2. Because the module resides below 16 megabytes, storage obtained will be below 16
megabytes.
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 7 of 10)
5-44
Note: The following store operation is successful because module USER1 obtained save area
storage below 16 megabytes.
*
ST
13,8(9)
.
.
.
.
* Process input requests
.
.
.
.
READ1
DS
0H
.
L
13,SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
WRITE1 DS
0H
.
L
13,SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
OPEN1
DS
0H
.
L
13,SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
CLOSE1 DS
0H
.
L
13,SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
OPEN2
DS
0H
.
L
13,SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
CLOSE2 DS
0H
.
L
13.SAVEBKWD
LM
14,12,12(13)
BSM
0,14
*
.
.
registers
- this
AMODE 31
input
registers
- this
AMODE 31
input
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 8 of 10)
5-45
Note: This FREEMAIN will only be done on the final call to this module.
*
LA
0,GMLNTH
FREEMAIN RC,LV=(0),A=(8)
.
.
.
*
*
DS
.
.
MVC
.
L
LM
BSM
.
.
.
.
ERREXIT1 DS
.
.
MVC
*
.
L
LM
BSM
*
*
.
.
.
.
ERREXIT2 DS
.
.
MVC
*
.
L
LM
BSM
*
*
0H
STATUS,ENDFILE
13,SAVWBKWD
14,12,12(13)
0,14
0H
STATUS,IOERROR
13,SAVWBKWD
14,12,12(13)
0,14
0H
STATUS,IOERROR
13,SAVWBKWD
14,12,12(13)
0,14
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 9 of 10)
5-46
Note: Define the required DCBs that module USER2 will process. The DCBs exist in storage below
16 megabytes. The END OF DATA and SYNAD exit routines also exist in storage below 16
megabytes.
INDCB
DCB
DDNAME=INPUT1,DSORG=PS,MACRF=(GL),EODAD=ENDFILE, x
SYNAD=ERREXIT1
OUTDCB DCB DDNAME=OUTPUT1,DSORG=PS,MACRF=(PL),SYNAD=ERREXIT2
* Work areas and constants for module USER2
IOERROR DC
CIO
Constant used to indicate
*
an I/O error
ENDFILE DC
CEF
Constant used to indicate
*
end of file encountered
SAVEREGS DSECT
This storage exists
*
below 16 megabytes
SAVEAREA EQU SAVEREGS
SAVERSVD DS
F
Reserved
SAVEBKWD DS
F
SAVEFRWD DS
F
SAVE1412 DS
15F
Save area for registers 14-12
WORKLNTH EQU *-SAVEREGS
Length of dynamic area
.
.
.
.
.
COMMAREA DSECT
Parameter area used to
*
communicate with module
*
USER1
FUNCTION DS
CL2
Function to be performed
*
by USER2
STATUS DS
CL2
Status of read operation
BUFFER DS
CL80
Input/output buffer
.
.
DYNAREA DSECT
This storage exists
*
below 16 megabytes
.
.
.
.
.
.
GMLNTH EQU
*-DYNAREA
Length of dynamic area
.
.
END
Figure 5-15. Performing I/O While Residing Above 16 Megabytes (Part 10 of 10)
5-47
be backed with real frames above 16 megabytes. In addition, the following virtual
areas below 16 megabytes can also be backed with real frames above 16
megabytes:
v SQA
v LSQA
v Nucleus
v Pageable private areas
v Pageable CSA
v PLPA
v MLPA
v Resident BLDL
The following virtual areas are always backed with real frames below 16
megabytes:
v V=R regions
v FLPA
v Subpool 226
v Subpools 227 and 228 (unless specified otherwise by the GETMAIN macro with
the LOC parameter)
When satisfying page-fix requests, MVS backs pageable virtual pages that reside
below 16 megabytes with central storage below 16 megabytes, unless the
GETMAIN macro specifies LOC=(24,31) or the PGSER macro specifies the
ANYWHER parameter. If the GETMAIN or STORAGE macro specifies or implies a
real location of 31, MVS backs pageable virtual pages with real frames above 16
megabytes even when the area is page fixed.
GETMAIN Macro
The LOC parameter on the RU, RC, VRU, and VRC forms of the GETMAIN macro
specifies not only the virtual storage location of the area to be obtained, but also
the central storage location when the storage is page fixed.
LOC=24 indicates that the virtual storage is to be located below 16 megabytes.
When the area is page fixed, it is to be backed with central storage below 16
megabytes.
5-48
DAT-Off Routines
The MVS/370 nucleus is mapped so that its virtual storage addresses are equal to
its central storage addresses. MVS/370 has a V=R (virtual=real) nucleus. In
contrast, the MVS/XA, MVS/ESA and OS/390 nucleus is mapped and fixed in
central storage without attempting to make its virtual storage addresses equal to its
real addresses. MVS systems that use 31-bit addressing (MVS/XA, MVS/ESA and
OS/390) save a V=F (virtual=fixed) nucleus.
Because the MVS/370 is V=R, nucleus code can turn DAT off, and the next
instruction executed is the same as it would be if DAT was still on. Because the
MVS/XA, MVS/ESA and OS/390 nucleus is not V=R, their nucleus code cannot turn
DAT-off and expect the next instruction executed to be the same as if DAT was on.
5-49
To allow for the execution of DAT-off nucleus code, the MVS nucleus consists of
two load modules, one that runs with DAT on and one that runs with DAT off.
Nucleus code that needs to run with DAT off must reside in the DAT-off portion of
the nucleus.
When the system is initialized, the DAT-off portion of the nucleus is loaded into the
highest contiguous central storage. Therefore, you must modify any user modules in
the nucleus that run with DAT off so that they operate correctly above 16
megabytes. Among the things you may have to consider are:
v All modules in the DAT-off portion of the nucleus have the attributes AMODE 31,
RMODE ANY. They may reside above 16 megabytes.
v These modules must return control via a BSM 0,14.
v Register 0 must not be destroyed on return.
To support modules in the DAT-off nucleus:
v Move the DAT-off code to a separate module with AMODE 31, RMODE ANY
attributes. Use as its entry point, IEAVEURn where n is a number from 1 to 4.
(MVS reserves four entry points in the DAT-off nucleus for users.) Use BSM 0,14
as the return instruction. Do not destroy register 0.
v Code a DATOFF macro to invoke the DAT-off module:
DATOFF INDEX=INDUSRn
5-50
An unauthorized caller can pause and release any task in An unauthorized caller can WAIT and POST any task in
the callers home address space.
the callers home address space.
A task can only pause on a single PE at a time.
6-1
1
W
2
P
31
completion code
When an ECB is originally created, bits 0 (wait bit) and 1 (post bit) must be set to
zero. If an ECB is reused, bits 0 and 1 must be set to zero before a WAIT, EVENTS
ECB= or POST macro can be specified. If, however, the bits are set to zero before
the ECB has been posted, any task waiting for that ECB to be posted will remain in
the wait state. When a WAIT macro is issued, bit 0 of the associated ECB is set to
1. When a POST macro is issued, bit 1 of the associated ECB is set to 1 and bit 0
is set to 0. For an EVENTS type ECB, POST also puts the completed ECB address
in the EVENTS table.
A WAIT macro can specify more than one event by specifying more than one ECB.
(Only one WAIT macro can refer to an ECB at a time, however.) If more than one
ECB is specified in a WAIT macro, the WAIT macro can also specify that all or only
some of the events must occur before the task is taken out of the wait condition.
When a sufficient number of events have taken place (ECBs have been posted) to
satisfy the number of events indicated in the WAIT macro, the task is taken out of
the wait condition.
6-2
An optional parameter, LONG=YES or NO, allows you to indicate whether the task
is entering a long wait or a regular wait. A long wait should never be considered for
I/O activity. However, you might want to use a long wait when waiting for an
operator response to a WTOR macro.
Through the LINKAGE parameter, POST and WAIT allow you to specify how the
macro passes control to the control program. You can specify that control is to be
passed by an SVC or a PC instruction.
When you issue the WAIT or POST macro and specify LINKAGE=SVC (or use the
default), your program must not be in cross memory mode. The primary, secondary,
and home address spaces must be the same, your program must be in primary
ASC mode, and it must not have an enabled unlocked task (EUT) functional
recovery routine (FRR) established. You may use WAIT and POST when the
primary and the home address spaces are different by specifying
LINKAGE=SYSTEM. This option generates a PC interface to the WAIT or POST
service and requires that the program be enabled, unlocked, in primary ASC mode
and, for WAIT only, in task mode. For POST, the control program assumes that the
ECB is in the primary address space. For WAIT, it assumes that the ECB is in the
home address space.
Figure 6-2 shows an example of using LINKAGE=SYSTEM. The program that runs
under TCB1 in ASN1 PCs to a program in ASN2. Now the primary address space is
ASN2 and home address space is ASN1. When the PC routine posts ECB2, it uses
LINKAGE=SYSTEM because home and primary are different. The PC routine waits
on ECB1 using LINKAGE=SYSTEM because home and primary are still different.
Note that ECB1 is in the home address space.
ASN1
ASN2
TCB1
ECB2
ECB1
PC
POST ECB2,LINKAGE=SYSTEM
WAIT ECB1,LINKAGE=SYSTEM
PR
6-3
These services, which are available to both unauthorized and authorized callers in
Assembler as well as C or C++, use a system-managed object called a pause
element to synchronize processing of tasks. The services provide the following
functions:
v Pause the current task (Pause service IEAVPSE)
v Release a paused task (Release service IEAVRLS)
v Simultaneously release a paused task and pass control to it (Transfer service
IEAVXFR)
v Simultaneously release one paused task and pause the current work unit
(Transfer service IEAVXFR)
The services use a system-managed pause element (PE) rather than an
application-managed control block, such as an event control block (ECB), thus
reducing the possibility of error that might come from improper reuse of the control
block.
As a PE is much like an ECB, the Pause service is much like the WAIT macro, and
the Release service is much like the POST macro. Just as you can use POST to
keep a task from waiting by preposting, you can use Release to keep a task from
pausing by prereleasing.
The Transfer service can both release a paused task and pass control directly to
the released task. The Transfer service can also pause the task that calls the
service. Thus, Transfer enables quick dispatches, saving the overhead of work
search. It also allows two tasks to trade control back and forth with minimal
overhead.
To understand how to use the services, you need to know more about pause
elements, (PEs) and the pause element tokens (PETs) that identify them.
6-4
Table 6-2. Pause Element (PE) and Event Control Block (ECB) (continued)
Pause Element (PE)
Pause IEAVPSE
Release IEAVRLS
Transfer IEAVXFR
Deallocate_Pause_Element IEAVDPE
To use Pause, Release, and Transfer, a program must first allocate a PE by calling
the Allocate_Pause_Element service. In response, the system allocates a PE and
returns a pause element token (PET) that identifies the pause element (PE).
You use the PET returned from Allocate_Pause_Element to identify the allocated
PE until either:
v The PE has been used to pause (through Pause or Transfer) and release
(through Release or Transfer) a task.
v A paused task has been released through an asynchronous ABEND.
When you are finished with the PE, call the Deallocate_Pause_Element service to
return the PE to the system. If a task is asynchronously ABENDed while it is
paused, the system itself invalidates the PE, and it cannot be reused for pause
requests. Thus, return an invalidated PE to the system as soon as possible by a
call to Deallocate_Pause_Element.
Though the PE remains allocated until you deallocate it, you can use a PET for only
one pair of calls, which result in a pause and a release of a task. When you specify
a PET on a successful call to the Pause service or to pause a task through a
successful call to the Transfer service, the system invalidates the input PET and
returns an updated PET to identify the PE. Use the updated PET to reuse the PE or
to deallocate the PE.
Figure 6-3 on page 6-6 shows, in pseudocode, the sequence of calls to allocate a
PE, pause the current task, release the task, and deallocate the PE.
6-5
/* Common variables
*/
*/
*/
/* Pause Workunit #1
*/
Call IEAVPSE (RC1,Auth1,PET,
Updated_PET,RetRelCode);
/*processing pauses until released*/
.
.
.
PET = UPET;
Call IEAVPSE (RC1,Auth1,PET);
Updated_PET,RetRelCode);
/*processing pauses until released*/
.
.
.
/* Deallocate the pause element */
Call IEAVDPE (RC1,Auth1,
Updated_PET)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Workunit #2
/* Workunit #2 variables
Dcl Auth2 char(4);
Dcl RC2 fixed(32;
Dcl RelCode binary(24);
*/
Auth2 = IEA_UNAUTHORIZED;
.
.
.
RelCode = 123;
/* Release Workunit #1
Call IEAVRLS (RC2,Auth2,PET,
RelCode);
*/
RelCode = 345;
/* Release Workunit #1
*/
Call IEAVRLS (RC2,Auth2,PET,
RelCode);
The Pause, Release, and Transfer services also provide a release code field that
programs can use to communicate, to indicate, for example, the reason for a
release. The program that calls the Release service can set a release code.
The release code is particularly useful when a task might be released before it is
paused (prereleased). When a subsequent call to the Pause service occurs, the
system does not pause the task; instead, it returns control immediately to the calling
program and provides the release code specified on the release call.
Figure 6-4 shows, in pseudocode, the sequence of calls needed to allocate a PE,
prerelease a task, and deallocate the PE
6-6
/* Common variables
*/
*/
Auth1 = IEA_UNAUTHORIZED;
/* Allocate a Pause Element
Call IEAVAPE (RC1,Auth1,PET);
.
.
.
*/
/* Pause Workunit #1
*/
Call IEAVPSE (RC1,Auth1,PET,
Updated_PET,RetRelCode);
/*check release code and continue */
.
.
.
/* Deallocate the pause element */
Call IEAVDPE (RC1,Auth1,
Updated_PET);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Workunit #2
/* Workunit #2 variables
Dcl Auth2 fixed(32);
Dcl RC2
fixed(32);
Dcl RelCode binary(24);
*/
Auth2 = IEA_UNAUTHORIZED;
RelCode =123;
/* Release Workunit #1
Call IEAVRLS (RC2,Auth2,PET,
RelCode);
.
.
.
*/
If you make a release request (through Release or Transfer) specifying a PET that
identifies a PE that has not yet been used to pause a task, the system marks the
PE as a prereleased PE. If a program tries to pause a task using a prereleased PE,
the system returns control immediately to the caller; it does not pause the task.
Instead, it resets the PE. As soon as a PE is reset, it can be reused for another
Pause and Release, but, as stated earlier, you use the returned updated PET for
the next reused PE.
The Pause and Release services are very similar to the WAIT and POST macros,
but the Transfer service provides new function. You can use Transfer to either:
v Release a paused task and transfer control directly to the released task
v Pause the current task, release a paused task, and transfer control directly to the
released task
Figure 6-5 shows an example of using the Transfer service to release a task without
pausing the current task.
Because the Transfer service can affect multiple units of work, using Transfer
requires you to work with three PETs:
1. The current pause element token (CurrentDuPet in Figure 6-5) identifies the
allocated pause element that Transfer is to use to pause the current task (the
caller of the Transfer service). When you do not need to pause the current task,
you set this token to binary zeros, as shown in Figure 6-5.
6-7
2. The updated pause element token (UPET2 in Figure 6-5), which the system
returns when you specify a current pause element token. You need this updated
token to reuse the pause element on a subsequent Pause or Transfer or to
deallocate the pause element. If you set the current token to binary zeros, as
done in Figure 6-5, the contents of the updated pause element token are not
meaningful.
3. The target token (TargetDuPET in Figure 6-5) identifies the allocated pause
element that Transfer is to use to release a task. In Figure 6-5, it contains the
PET that identifies the PE used to pause Workunit #1.
A current release code and a target release code are also available on the call to
Transfer. Whether or not each code contains valid data depends on conventions set
by the different parts of your program
/* Common variables
*/
*/
*/
/* Pause Workunit #1
*/
Call IEAVPSE (RC1,Auth1,PET,UPET1,
RetRelCode);
/*processing pauses until transfer*/
/*processing continues
*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Workunit #2
/* Workunit #2 variables
*/
Dcl Auth2 char(4);
Dcl RC2
char(4);
Dcl CurrentDuRelCode binary(24);
Dcl CurrentDuPET char(16);
Dcl UPET2 char(16);
Dcl TargetDuPET char(16);
Dcl TargetDuRelCode char(3);
Auth2 = IEA_UNAUTHORIZED;
.
.
.
TargetDuRelCode = 123;
/* no pause-set token to zeros
CurrentDuPet =B;
TargetDuPET = PET
*/
/* Transfer to Workunit #1
*/
Call IEAVXFR (RC2,Auth2,
CurrentDuPET,UPET2,
CurrentDuRelCode,
TargetDuPET,
TargetDuRelCode);
.
.
.
6-8
addition, none of the programs that are only reading the records want to use a
record that another program is updating until after the record has been replaced.
If your program uses a serially reusable resource, you must prevent incorrect use of
the resource. You must ensure that the logic of your program does not require the
second use of the resource before completion of the first use. Be especially careful
when using a serially reusable resource in an exit routine; because exit routines get
control asynchronously with respect to your program logic, the exit routine could
obtain a resource already in use by the main program. When more than one task is
involved, using the ENQ and DEQ macros correctly can prevent simultaneous use
of a serially reusable resource.
The ENQ macro assigns control of a resource to the current task. The control
program determines the status of the resource and does one of the following:
v If the resource is available, the control program grants the request by returning
control to the active task.
v If the resource has been assigned to another task, the control program delays
assignment of control by placing the active task in a wait condition until the
resource becomes available.
v Passes back a return code indicating the status of the resource.
v Abends the caller on unconditional requests that would otherwise result in a
non-zero return code.
When the status of the resource changes so that the waiting task can get control,
the task is taken out of the wait condition and placed in the ready condition.
The ENQ and DEQ macros work together. If used properly, ENQ/DEQ can protect
serially reusable resources. The rules for proper use of ENQ/DEQ are as follows:
v Everyone must use ENQ/DEQ.
v Everyone must use the same names and scope values for the same resources.
v Everyone must use consistent ENQ/DEQ protocol.
6-9
6-10
Because the RNL parameter affects the scope value of a resource, be consistent in
specifying the RNL parameter on both ENQ and DEQ. If you use the default value
on ENQ, use the default value also on DEQ.
6-11
ENTRY1 (Figure 6-6, Step 1) is assigned the resource. The request that established
ENTRY2 (Figure 6-6, Step 1) was for exclusive control, so the corresponding task is
placed in the wait condition, along with the tasks represented by all the other
entries in the list.
ENTRY1 (S)
ENTRY2 (E)
ENTRY2 (E)
ENTRY3 (S)
ENTRY3 (S)
ENTRY3 (S)
ENTRY4 (S)
ENTRY4 (S)
ENTRY4 (S)
ENTRY5 (E)
ENTRY5 (E)
ENTRY5 (E)
ENTRY6 (S)
ENTRY6 (S)
ENTRY6 (S)
Step 1
Step 2
Step 3
Eventually, the task represented by ENTRY1 uses DEQ to release control of the
resource, and the ENTRY1 is removed from the list. As shown in Figure 6-6, Step
2, ENTRY2 is now first on the list, and the corresponding task is assigned control of
the resource. Because the request that established ENTRY2 was for exclusive
control, the tasks represented by all the other entries in the list remain in the wait
condition.
Figure 6-6, Step 3, shows the status of the list after the task represented by
ENTRY2 releases the resource. Because ENTRY3 is now at the top of the list, the
task represented by ENTRY3 gets control of the resource. ENTRY3 indicates that
the resource can be shared, and, because ENTRY4 also indicates that the resource
can be shared, ENTRY4 also gets control of the resource. In this case, the task
represented by ENTRY5 does not get control of the resource until both the tasks
represented by ENTRY3 and ENTRY4 release control because ENTRY5 indicates
exclusive use.
The control program uses the following general rules in manipulating the lists:
v The task represented by the first entry in the list always gets control of the
resource.
v If the request is for exclusive control, the task is not given control of the resource
until its request is the first entry in the list.
v If the request is for shared control, the task is given control either when its
request is first in the list or when all the entries before it in the list also indicate a
shared request.
v If the request is for several resources, the task is given control when all of the
entries requesting exclusive control are first in their respective lists and all the
entries requesting shared control are either first in their respective lists or are
preceded only by entries requesting shared control.
6-12
Two specific reasons why the use of ENQ in an exit routine must be carefully
planned are:
v The exit may be entered more than once for the same task.
v An exit routine may request resources already obtained by some other process
associated with the task.
For more information on this topic, see Conditional and Unconditional Requests.
RET=USE
RET=CHNG
RET=HAVE
For the following descriptions, the term active task means the task issuing the
ENQ macro. No reference is intended to other tasks that might be active in other
processors of a multiprocessor.
Use RET=TEST to test the status of the corresponding qname, rname, and scope
combination, without changing the list in any way or waiting for the resource.
RET=TEST is most useful for determining if the task already has control of the
resource. It is less useful for determining the status of the list and taking action
based on that status. In the interval between the time the control program checks
the status and the time your program checks the return code and issues another
ENQ macro, another task could have been made active, and the status of the list
could have changed.
6-13
Use RET=USE if you want your task to receive control of the resource only if the
resource is immediately available. If the resource is not immediately available, no
entry will be made on the list and the task will not be made to wait. RET=USE is
most useful when there is other processing that can be done without using the
resource. For example, by issuing a preliminary ENQ with RET=USE in an
interactive task, you can attempt to gain control of a needed resource without
locking your terminal session. If the resource is not available, you can do other
work rather than enter a long wait for the resource.
Use RET=CHNG to change a previous request from shared to exclusive control.
Use RET=HAVE to specify a conditional request for control of a resource when you
do not know whether you have already requested control of that resource. If the
resource is owned by another task, you will be put in a wait condition until the
resource becomes available.
The RET=HAVE parameter on DEQ allows you to release control and prevents the
control program from abnormally ending the active task if a DEQ attempts to
release a resource not held. If ENQ and DEQ are used in an asynchronous exit
routine, code RET=HAVE to avoid possible abnormal termination.
Avoiding Interlock
An interlock condition happens when two tasks are waiting for each others
completion, but neither task can get the resource it needs to complete. Figure 6-7
shows an example of an interlock. Task A has exclusive access to resource M, and
task B has exclusive access to resource N. When task B requests exclusive access
to resource M, B is placed in a wait state because task A has exclusive control of
resource M.
The interlock becomes complete when task A requests exclusive control of resource
N. The same interlock would have occurred if task B issued a single request for
multiple resources M and N prior to task As second request. The interlock would
not have occurred if both tasks had issued single requests for multiple resources.
Other tasks requiring either of the resources are also in a wait condition because of
the interlock, although in this case they did not contribute to the conditions that
caused the interlock.
Task A
ENQ (M,A,E,8,SYSTEM)
ENQ (N,B,E,8,SYSTEM)
Task B
ENQ (N,B,E,8,SYSTEM)
ENQ (M,A,E,8,SYSTEM)
The above example involving two tasks and two resources is a simple example of
an interlock. The example could be expanded to cover many tasks and many
resources. It is imperative that you avoid interlock. The following procedures
indicate some ways of preventing interlocks.
v Do not request resources that you do not need immediately. If you can use the
serially reusable resources one at a time, request them one at a time and
release one before requesting the next.
v Share resources as much as possible. If the requests in the lists shown in
Figure 6-7 had been for shared control, there would have been no interlock. This
does not mean you should share a resource that you will modify. It does mean
6-14
that you should analyze your requirements for the resources carefully, and not
request exclusive control when shared control is enough.
v If you need concurrent use of more than one resource, use the ENQ macro to
request control of all such resources at the same time. The requesting program
is placed in a wait condition until all of the requested resources are available.
Those resources not being used by any other program immediately become
exclusively available to the waiting program. For example, instead of coding the
two ENQ macros shown in Figure 6-8, you could code the one ENQ macro
shown in Figure 6-9. If all requests were made in this manner, the interlock
shown in Figure 6-7 could not occur. All of the requests from one task would be
processed before any of the requests from the second task. The DEQ macro can
release a resource as soon as it is no longer needed; multiple resources
requested in a single ENQ invocation can be released individually through
separate DEQ instructions.
ENQ (NAME1ADD,NAME2ADD,E,8,SYSTEM)
ENQ (NAME3ADD,NAME4ADD,E,10,SYSTEM)
v If the use of one resource always depends on the use of a second resource,
then you can define the pair of resources as one resource. On the ENQ and
DEQ macros, define the pair with a single rname and qname. You can use this
procedure for any number of resources that are always used in combination.
However, the control program cannot then protect these resources if they are
also requested independently. Any requests must always be for the set of
resources.
v If there are many users of a group of resources and some of the users require
control of a second resource while retaining control of the first resource, it is still
possible to avoid interlocks. In this case, each user should request control of the
resources in the same order. For instance, if resources A, B, and C are required
by many tasks, the requests should always be made in the order of A, B, and
then C. An interlock situation will not develop, since requests for resource A will
always precede requests for resource B.
6-15
RIB
A
RIBE
A1
RIBE
A2
RIBE
A3
RIB
B
RIBE
B1
RIBE
B2
6-16
v RIBNRIBE contains the total number of RIBEs associated with this RIB that
GQSCAN could fit into the area specified on the AREA parameter.
v RIBEDEVN contains a 4-digit EBCDIC device number for RESERVEs issued on
the system. For RESERVEs issued on other systems, RIBEDEVN contains zero.
If the value in RIBNRIBE is less than the value in RIBTRIBE, you may need to
specify a larger area with the AREA parameter.
The number of RIBs and RIBEs you receive for a particular resource depends on
the size of the area you provide, and the scope and token values you specify on
the GQSCAN macro.
Initial call
No
6-17
Subsequent call
No
The example in Figure 6-10 shows the area contents for three requests. For each
request, the caller specified the TOKEN parameter and one of the following for the
scope value: STEP, SYSTEM, SYSTEMS, or ALL. Assume that the resource queue
contains information about four resources: A, which has three requestors; B, which
has six; C, which has two; and D, which has one.
First return
RIB
Second return
RIB
Third return
RIB
3 RIBEs total
3 here
6 RIBEs total
5 here
2 RIBEs total
2 here
RIBE A1
RIBE B1
RIBE C1
RIBE A2
RIBE B2
RIBE C2
RIBE A3
RIBE B3
RIB D
1 RIBEs total
1 here
RIBE B4
RIBE B5
RIBE D1
Figure 6-10. Work Area Contents for GQSCAN with a Scope of STEP, SYSTEM, SYSTEMS,
or ALL
Note that, because the specified area is not large enough, the caller cannot receive
all of the RIBEs associated with resource B, even though the caller coded the
TOKEN parameter. To receive all of those RIBEs, the caller has to specify a larger
area and reissue the GQSCAN request.
6-18
When scanning the information returned, you must use the size of the fixed portion
of the RIB and the RIBE that is returned in register 0. The size of the fixed portion
of the RIB (RIBLEN) is in the high-order half of register 0, and the size of the RIBE
(RIBELEN) is in the low-order half.
The first RIB starts at the beginning of the workarea you specify on the AREA
parameter. To find the first RIBE, add the value of RIBLEN and the variable portion
of RIB (as found in the RIBVLEN field of the RIB) to the address of the workarea.
To find the second RIBE, add the value of RIBELEN to the address of the first
RIBE.
To find the second RIB, add the following to the location of the first RIB:
RIBLEN + RIBVLEN + (the number of RIBEs RIBELEN)
6-19
6-20
7-1
addressing mode, you cannot issue the SPIE macro. The SPIE macro is restricted
in use to callers executing in 24-bit addressing mode in the performance of a task.
The following topics describe how to use the SPIE and ESPIE macros.
7-2
HOLD
.
.
SPIE
ST
.
.
L
SPIE
.
.
DC
FIXUP,(8)
1,HOLD
5,HOLD
Reload returned address
MF=(E,(5)) Use execute form and old PICA address
F0
you specify ESPIE SET, you pass the following information to the system:
A list of the program interruptions to be handled by the exit routine
The location of the exit routine
The location of a user-defined parameter list
The system returns either a token representing the previously active SPIE or ESPIE
environment, or a token of zeroes if there was none.
If you code ESPIE RESET, you pass the token, which was returned when the
ESPIE environment was established, back to the system. The SPIE or ESPIE
environment corresponding to the token is restored. If you pass a token of zero with
RESET, all SPIE and ESPIE environments are deleted.
7-3
If you specify ESPIE TEST, you will be able to determine the active SPIE or ESPIE
environment. ESPIE TEST sets return codes to indicate which type of exit is active,
if any, and if one or the other is active, provides information about the exit in a
parameter list. Refer to the TEST parameter on the ESPIE macro for a description
of the return codes, and the information that is returned in the parameter list.
If an ESPIE environment is active and you issue a SPIE macro to specify
interruptions for which a SPIE exit routine is to receive control, the system returns
the address of a system-generated PICA in register 1. Do not modify the contents
of the system-generated PICA; use the address to restore the previous ESPIE
environment.
For a data exception,an ESPIE routine will receive the DXC value in its parameter
area, and should use this value rather than the value in the Floating Point Control
(FPC) register.
If a retry is to be done, an ESPIE routine can manually change the value(s) of the
FPR(s) and FPC register. Changes to the non-volatile fields (i.e., the IEEE settings)
in the FPC register must be made carefully since this could affect the processing of
the rest of the current program, and possibly subsequent programs.
Register 1:
Registers 2-13:
Unchanged.
Register 14:
Return address.
Register 15:
The access registers and linkage stack have the values that were current at the
time of the program interruption. Both SPIE and ESPIE exits always receive control
in primary ASC mode.
7-4
v For a SPIE, your exit routine can test bits 16 through 31 (the first byte is the
exception extension code and the second is the exception code) of the old
program status word (OPSW in BC mode)in the PIE.
Note: For both ESPIE and SPIE If you are using vector instructions and an
exception of 8, 12, 13, 14, or 15 occurs, your exit routine can check the
exception extension code (the first byte of the two-byte interruption code in
the EPIE or PIE) to determine whether the exception was a vector or scalar
type of exception.
For more information about the exception extension code, see IBM System/370
Vector Operations.
Your exit routine can alter the contents of the registers when control is returned to
the interrupted program. The procedure for altering the registers also depends on
whether the exit is associated with an ESPIE or a SPIE.
v For an ESPIE exit, the exit routine can alter the contents of general purpose and
access registers 0 through 15 in the save area in the EPIE.
v For a SPIE exit, the exit routine can alter general purpose registers 14 through 2
in the register save area in the PIE. To change registers 3 through 13, the exit
routine must alter the contents of the registers themselves.
The exit routine can also alter the last four bytes of the OPSW in the PIE or EPIE.
For an ESPIE, the exit routine alters the condition code and program mask starting
at the third byte in the OPSW. By changing the OPSW, the routine can select any
return point in the interrupted program. In addition, for ESPIE exits, the routine must
set the AMODE bit of this four-byte address to indicate the addressing mode of the
interrupted program.
ESPIE exit routines can alter the ASC mode when control is returned to the
interrupted program if the EPIEVERS field in the EPIE contains a value greater than
zero. This value is set by the system. To alter the ASC mode of the interrupted
program, the exit must do the following:
v Set bit 17 of the EPIEPSW field in the EPIE. If this bit is 0 when control is
returned to the interrupted program, the program receives control in primary ASC
mode. If this bit is 1 when control is returned to the interrupted program, the
program receives control in AR ASC mode.
v Set the EPIERCTL bit in the EPIE to indicate that the ASC mode for the
interrupted program has been set by the exit routine.
7-5
7-6
8-1
8-2
8-3
When dealing with a multi-tasking environment, you must plan your recovery in
terms of the multiple tasks involved. You must have a cohesive scheme that
provides recovery for the set of tasks rather than thinking only in terms of a
single task.
v Is a way to help you determine what went wrong when an error occurs in
your program.
Recovery routines can do such things as save serviceability data and request
dumps to help determine what went wrong in your program. These actions are
explained in greater detail later in this chapter.
v Facilitates validity checking of user parameters.
Consider the case of a program that must verify input from its callers. The
program does parameter validation, but might not catch all variations. For
example, the caller might pass the address of an input data area that appears to
be valid; however, the caller did not have access to that storage. When the
program attempts to update the data area, a protection exception occurs. A
recovery routine could intercept this error, and allow the program to pass back a
return code to the caller indicating the input was not valid.
Providing recovery in a case like this improves the reliability of your program.
If you do not provide recovery for your program, and your program encounters an
error, MVS handles the problem to some extent, but the result is that your program
ends before you expected it to, and application resources might not be cleaned up.
8-4
As stated earlier, the system can detect errors, but your program also can detect
errors and request that the system pass control to recovery routines. To do so, your
program can issue the ABEND macro.
Use the ABEND macro to request recovery processing on behalf of the current unit
of work. Your program might choose to issue the ABEND macro if it detects an
impossible or illogical situation and cannot proceed further. For example, your
program might be passed parameters that are not valid, or might detect something
in the environment that is not valid. Your program might also choose to issue the
ABEND macro so that its recovery routine can get control to save serviceability
information.
8-5
All of these routines are user-written routines. The following section provides you
with a description of each of these routines.
Mainline Routine
The mainline routine is that portion of your program that does the work, or provides
the required function. In general, the mainline routine defines and activates the
recovery routine. Before returning to its caller, the mainline should also deactivate
the recovery routine and request that it be no longer defined. When an error occurs
in the mainline routine, the system passes control to the recovery routine.
Recovery Routine
A recovery routine is the routine to which the system passes control when an error
occurs in the mainline routine. The recovery routines objective is to intercept the
error and potentially perform one or more of the following tasks:
v Eliminate or minimize the effects of the error
v Allow the mainline routine to resume normal processing
v Clean up resources
v Communicate with other programs as appropriate
v Provide serviceability data
v Request a dump
v Validate user parameters
v Provide one or more recovery routines for itself.
The recovery routine can be an entry point in your program that processes only
when an error occurs, or it can be a separate routine that gets control when the
error occurs.
Retry Routine
A retry routine is essentially an extension of the mainline routine. When an error
occurs, the system passes control to your recovery routine, which can then request
the system to pass control back to the mainline routine to resume processing. That
portion of the mainline that gets control back is referred to as the retry routine.
When the retry routine gets control, it is as if the mainline routine branched there
after encountering the error; to the mainline routine, it appears as though the error
never occurred.
The retry routine does whatever processing your mainline routine would continue
doing at that point.
Once the retry routine is running, if another error occurs, the system again passes
control to your recovery routine, just as it did when the mainline routine
encountered an error.
8-6
8-7
Defined
Activated
Deactivated
No longer defined
ESTAE
ESTAE CT
ESTAE CT
ESTAE 0
ESTAE 0
ESTAEX
ESTAEX CT
ESTAEX CT
ESTAEX 0
ESTAEX 0
ESTAI
ATTACHX ESTAI
8-8
Mainline
Routine
Retry Point
End
Normally
Retry
ESTAEX
Routine
Percolate
The system abnormally
ends the mainline routine
Figure 8-2 on page 8-10 shows a more complex situation. Several recovery routines
exist, and each one that is entered has the opportunity to retry or to percolate. The
following sequence of events might occur if all recovery routines percolate:
1. The mainline routine encounters an error.
2. The system looks for recovery routines, and finds that ESTAEX(3) was the last
one created.
3. The system gives control to ESTAEX(3) first.
4. ESTAEX(3) percolates to ESTAE(2), which percolates to ESTAI(1).
8-9
5. ESTAI(1) also percolates, and no other recovery routines are activated, so the
system abnormally ends the mainline routine.
Had any of the recovery routines decided to retry, the system would have returned
control to the retry point, and the mainline routine might have ended normally.
Mainline
Routine
.
.
Retry Point
.
.
End
Normally
Error occurs
The system gets control
ESTAI(1)
ESTAI(1)
ESTAE(2)
ESTAI(1)
ESTAEX(3)
Retry
The system
gives control
to ESTAE-type
routines
All ESTAE-type routines percolate The system abnormally ends the mainline routine
8-10
8-11
To check for the presence of the SDWA, the recovery routine checks the contents
of GPR 0. If GPR 0 contains 12 (X'0C') the system could not obtain an SDWA.
When GPR 0 contains any value other than 12, an SDWA is present, and its
address is in GPR 1. When the system provides an SDWA, the system also
provides a register save area whose address is in GPR 13.
If an SDWA was not provided GPR 13 does not point to a save area, and your
routine must not use the area pointed to by GPR 13.
8-12
See Important Fields in the SDWA on page 8-20 for a list of some of the fields in
the SDWA, and an explanation of their contents.
Requesting a Dump
Your recovery routine can also request a dump of storage to help determine the
cause of the error. In most cases, the system does not automatically request dumps
on behalf of your program. To request an ABEND dump, the recovery routine can
issue the SETRP macro with the DUMP=YES parameter.
For more information about requesting dumps, see Chapter 9, Dumping Virtual
Storage (ABEND, SNAPX, SNAP, and IEATDUMP Macros) on page 9-1.
Chapter 8. Providing Recovery
8-13
Before requesting a dump of storage, the recovery routine should check the
SDWAEAS bit. The SDWAEAS bit is on when a previous recovery routine has
provided sufficient diagnostic data related to this error. The recovery routine that
analyzes the problem and captures sufficient diagnostic data is responsible for
setting the SDWAEAS bit so that subsequent recovery routines know they do not
have to capture any further data.
Note that if your program calls a system service (by issuing a macro or callable
service), that system service might encounter a user-induced error and end
abnormally. Generally, the system does not take dumps for user-induced errors. If
you require such a dump, then it is your responsibility to request one in your
recovery routine.
8-14
routine was in determining the cause of the error and fixing it. Perhaps the
environment is so badly damaged that repair is beyond the scope of the recovery
routine.
Once the decision is made, the recovery routine now does different things
depending on whether it will retry or percolate.
Note: If the recovery routine does not specify retry or percolate, the default is to
percolate.
8-15
Note: IBM recommends that the recovery routine use FRESDWA=YES on the
SETRP macro, thus alleviating the retry routines responsibility to free the
SDWA. If your recovery routine retries multiple times and the SDWA is not
freed, out-of-storage failures can result.
The retry routine can determine what action the recovery routine took in regard to
freeing the SDWA and restoring registers by examining the contents of GPR 0:
Table 8-2. Contents of GPR 0 on Entry to a Retry Routine
GPR 0 Contents
Meaning
12 (X'0C')
20 (X'14')
For complete details about register contents see Understanding the Recovery
Environment on page 8-27.
v The recovery routine that requested the retry is still activated and can be entered
again, so be aware of the possibility of looping back to the same recovery
routine. That recovery routine remains activated and can be entered again unless
the recovery routine issued SETRP with REMREC=YES. If the recovery routine
specified REMREC=YES, the system deactivated that recovery routine before
giving control to the retry routine.
v Any previous recovery routines (those that percolated to the recovery routine that
requested the retry) are deactivated.
Notes:
1. You can have as many retry points in your program as needed, and you can
change the designated retry point as your mainline processing continues.
2. The retry routine can be a separate routine. The only requirement is that it must
be in virtual storage. You are responsible for ensuring that the retry routine is in
virtual storage when needed.
8-16
Notes:
1. Once a recovery routine percolates, it is no longer activated; it cannot receive
control again for this error.
2. An ESTAI routine can request that the system not give control to any further
ESTAI routines by specifying RC=16 on the SETRP macro. The system then
abnormally ends the task.
Deciding What to Include in the Parameter Area: Your mainline routine can put
whatever information it wants in the parameter area. Remember that the object is to
provide the recovery routine with as much useful information as possible so the
recovery routine can be effective. Here are some suggestions for important
information to place in the parameter area:
v The base registers for the mainline. The recovery routine must be able to
establish addressability to whatever resources the mainline is holding.
v The addresses of all dynamically acquired storage.
v The location of a workarea for use by the recovery routine.
8-17
v Indications of what resources are held or serialized, such as ENQs, data sets,
and so on.
v Footprints indicating the processing being performed by the mainline when the
error occurred. Using footprints is a technique whereby the mainline sets bits as
it goes through its processing. When the recovery routine gets control, it can
check the parameter area to see which bits have been turned on, and thus can
tell how far along the mainline was. The recovery routine can pinpoint what the
mainline was doing at the time of error. If the mainline was done with its
processing when the error occurred, the recovery routine might not need to retry,
but might just clean up resources.
v An indication of whether a retry is desired.
v The input parameter list to the mainline. When the mainline received control, it
might have received an input parameter list. The mainline can preserve this in
the parameter area intended for use by the recovery routine. The recovery
routine can then inspect the input parameter list to determine if the mainline
received input that was not valid.
v Whatever register contents (both GPRs and ARs) the mainline wants to save
(they might need to be restored upon retry).
v The location of important data areas used by the mainline. Errors often occur
because of damage to information in a data area. The recovery routine might
need to repair one or more of these data areas, and so must be able to access
them. The recovery routine might also want to include these data areas when it
specifies the areas of storage to dump.
v The addresses of any user-written routines available to repair damage. You might
have separate routines designed to scan and repair queues, repair data areas,
and so on. The recovery routine might want to call these other routines for
assistance.
Passing the Parameter Area: When you provide a recovery routine, you have the
opportunity to identify to the system the parameter area you want passed to the
recovery routine. Here are the ways to accomplish that:
v ESTAE and ESTAEX routines
Use the PARAM parameter on the ESTAE or ESTAEX macro to specify the
address of the parameter area you have constructed.
v ESTAI routines
Use the ESTAI parameter on the ATTACHX macro to specify both the address of
the recovery routine to get control, and the address of the parameter area you
have constructed.
Accessing the Parameter Area: Once the recovery routine gets control, the
routine must know how to access the parameter area. That varies according to
whether the system provided an SDWA, and according to how the recovery routine
was defined:
v SDWA is present
ESTAE macro
SDWAPARM and GPR 2 contain the address of the parameter area you
specified on the PARAM parameter on ESTAE.
ESTAEX macro
SDWAPARM contains the address of an 8-byte field, which contains the
address and ALET of the parameter area you specified on the PARAM
8-18
Updating the SDWA: A recovery routine can update the SDWA in various ways:
v By issuing the SETRP macro (See Using the SETRP Macro to Update the
SDWA.)
v By issuing the VRADATA macro (See the VRADATA macro in z/OS MVS
Programming: Assembler Services Reference IAR-XCT and use of the VRADATA
macro in Symptoms Provided by a Recovery Routine on page 9-5.)
v By directly updating specific fields (see Important Fields in the SDWA on
page 8-20).
Using the SETRP Macro to Update the SDWA: Recovery routines issue the
SETRP macro to communicate recovery options to the system, and to save
serviceability data. The routine must have an SDWA to issue SETRP. The following
are some of the things a recovery routine can do using the SETRP macro:
v Indicate retry or percolate
Use the RC parameter on SETRP to let the system know whether the recovery
routine wants to percolate (RC=0) or retry (RC=4). If attempting a retry, the
routine must also specify a retry address on the RETADDR parameter.
For ESTAI routines, you can also specify RC=16 to ask the system not to give
control to any further ESTAI routines.
v Specify register contents for the retry routine and free the SDWA
ESTAE-type recovery routines can use parameters on the SETRP macro to
restore registers from the SDWA (RETREGS=YES), and to free the SDWA before
Chapter 8. Providing Recovery
8-19
Data
Failing module name
Failing CSECT name
Product or component identifier
Example
IEAVTCXX
IEAVTC22
SCDMP
5655
IEAVTC2R
RSM-PGFIX
Important Fields in the SDWA: The following table summarizes some of the key
fields in the SDWA. Note that certain fields are in an extension of the SDWA called
SDWARC1, which is a different DSECT. Here is how to access SDWARC1:
v SDWAXPAD in the SDWA contains the address of SDWAPTRS.
v SDWAPTRS is a DSECT which contains SDWASRVP.
v SDWASRVP contains the address of SDWARC1.
The fields described below that are in SDWARC1 are:
v SDWACRC
v SDWAARER
v SDWAARSV
v SDWACID
v SDWASC
v SDWAMLVL
v SDWARRL
8-20
Use
SDWAPARM
This 4-byte field contains the address of the user parameter area that
you supply for an ESTAE-type recovery routine.
For routines defined by the ESTAEX macro, this field contains the
address of an 8-byte area. The first four bytes of this 8-byte area
contain the address of the parameter area you specified on the ESTAEX
macro; the next four bytes contain the ALET for the parameter area.
SDWACMPC
This 3-byte field contains the completion code that existed when the
system gave control to the recovery routine. The recovery routine can
change the completion code by issuing the SETRP macro with the
COMPCOD parameter. The system completion code appears in the first
twelve bits, and the user completion code appears in the second twelve
bits.
SDWARPIV
This bit tells the recovery routine that the registers and PSW at the time
of error are not available. When this bit is on, the contents of
SDWAGRSV, SDWAARER, and SDWAEC1 are unpredictable.
SDWACRC
This 4-byte field contains the reason code associated with the
completion code in SDWACMPC. The reason code is set through the
REASON parameter of the ABEND macro, and is valid only when bit
SDWARCF is on. The recovery routine may change this reason code by
specifying a new value for the REASON parameter of the SETRP
macro.
Note: This reason code is not the same as the return code that
programs may set in GPR 15 before they issue the ABEND macro.
SDWARCF
SDWAGRSV
This field contains the contents of the general purpose registers (GPRs)
0-15 as they were at the time of the error.
SDWAARER
This field contains the contents of the access registers (ARs) 0-15 as
they were at the time of the error.
SDWAEC1
This field contains the PSW that existed at the time of the error.
SDWAEC2
The contents of this field vary according to the type of recovery routine:
v For ESTAE-type recovery routines (except for ESTAI routines): If a
program establishes an ESTAE routine, and subsequently performs a
stacking operation while running under the same RB as when it
established the ESTAE routine, SDWAEC2 contains the PSW from
the linkage stack entry immediately following the entry that was
current when the ESTAE routine was established. Otherwise,
SDWAEC2 contains the current RBOPSW from the RB that activated
the recovery routine, and the PSW is the one from the time of the last
interruption of that RB that occurred while the RB was unlocked and
enabled. Bit SDWAINTF in SDWAXFLG indicates whether the
contents of SDWAEC2 are from the linkage stack (SDWAINTF is 1)
or from an RB (SDWAINTF is 0).
v For an ESTAI routine, this field contains zero.
8-21
Use
The contents of this field vary according to the type of recovery routine:
v For ESTAE-type recovery routines (except for ESTAI routines): If a
program establishes an ESTAE routine, and subsequently performs a
stacking operation while running under the same RB as when it
established the ESTAE routine, SDWASRSV contains GPRs 0-15
from the linkage stack entry immediately following the entry that was
current when the ESTAE routine was established. Otherwise,
SDWASRSV contains GPRs 0-15 from the RB that activated the
recovery routine, and the GPRs are the same as they were at the
time of the last interruption of that RB that occurred while the RB was
unlocked and enabled. Bit SDWAINTF in SDWAXFLG indicates
whether the contents of SDWASRSV are from the linkage stack
(SDWAINTF is 1) or from an RB (SDWAINTF is 0).
v For an ESTAI routine, this field contains zeros.
If the recovery routine requests a retry, the system might use the
contents of this field to load the GPRs for the retry routine. See the
RETREGS parameter description in the SETRP macro in z/OS MVS
Programming: Assembler Services Reference IAR-XCT for details. To
change the contents of the GPRs for the retry routine, you must make
the changes to SDWASRSV and then issue SETRP with
RETREGS=YES. You can update the registers directly or with the RUB
parameter on SETRP.
SDWAARSV
8-22
SDWASPID
This field contains the subpool ID of the storage used to obtain the
SDWA, for use whenever the retry routine is responsible for freeing the
SDWA.
SDWALNTH
This field contains the length, in bytes, of this SDWA, the SDWA
extensions, and the variable recording area, for use whenever the retry
routine is responsible for freeing the SDWA. (This allows the retry
routine to free the extensions along with the SDWA.)
Use
SDWACOMU
The recovery routines can use this 8-byte field to communicate with
each other when percolation occurs. The system copies this field from
one SDWA to the next on all percolations. When the field contains all
zeros, either no information is passed or the system has not been able
to pass the information.
SDWATRAN
SDWATEAR
SDWACLUP
If on, this bit indicates that the recovery routine cannot retry.
SDWAPERC
If on, this bit indicates that a recovery routine has already percolated for
this error.
SDWAEAS
SDWACID
The recovery routine can use this 5-byte field to provide the component
ID of the component involved in the error.
SDWASC
The recovery routine can use this 23-byte field to provide the name of
the component and a description of the function or subfunction involved
in the error.
SDWAMLVL
The recovery routine can use this 16-byte field to indicate the level of
the module involved in the error. The first 8 bytes contains the date
(SDWAMDAT) and the second 8 bytes contains the version
(SDWAMVRS).
SDWARRL
The recovery routine can use this 8-byte field to indicate the recovery
routines entry point label.
SDWALSLV
The recovery routine can use this 2-byte field to control the linkage
stack state upon retry. See Linkage Stack at Time of Retry on
page 8-35 for additional information.
RB Considerations
A program must activate and deactivate ESTAE-type recovery routines under the
same RB level. If you try to deactivate an ESTAE-type recovery routine that is not
associated with your RB, you get a return code that indicates your request is not
valid.
Chapter 8. Providing Recovery
8-23
Recovery Routine: IBM recommends that your recovery routine not modify or
extract from the linkage stack entry that is current when the routine is entered. In
some cases, the system might prevent an ESTAE-type recovery routine from
modifying or extracting from that linkage stack entry. If your recovery routine
attempts to modify or extract from the linkage stack entry when the system does not
allow it, the result is a linkage stack exception.
IBM recommends that if your recovery routine adds entries to the linkage stack,
through a stacking PC or BAKR instruction, it should also remove them. If the
recovery routine adds entries to the stack and does not remove them, the system
recognizes an error when the recovery routine returns control. If the recovery
routine retries, the additional entries are not given to the retry routine. If the
recovery routine percolates, subsequent recovery routines receive a linkage stack
with entries more recent than the entry that was current at the time of error.
8-24
Retry Routine: When the system gives control to your retry routine, the linkage
stack level is set to the level that was current when your program activated the
recovery routine, unless the recovery routine sets the SDWALSLV field.
Deactivating an ESTAE-Type Recovery Routine: A program may deactivate an
ESTAE-type recovery routine only under the same linkage stack level as the level
that existed when the program activated the recovery routine. This rule affects
programs that add entries to the linkage stack either through the BAKR or PC
instruction. Failure to follow this rule results in an error return code of 36 from the
ESTAE or ESTAEX macro.
When you issue a PR, the system automatically deactivates all ESTAE-type
recovery routines that were previously activated under that current linkage stack
entry.
8-25
RETREGS=NO
RETREGS=YES
FRESDWA=YES
FRESDWA=NO
Note: If the system did not provide an SDWA and RETREGS=NO, then GPR 2 contains the address of
the purged I/O restore list.
You can use the RESTORE macro to have the system restore all I/O requests on
the list. For information about where the RESTORE macro is documented, see
z/OS DFSMS Introduction for the version of DFP you have installed.
8-26
Interrupt status
DU-AL
Program mask
Condition of the linkage stack
Chapter 8. Providing Recovery
8-27
This section discusses each of the environmental factors, and makes distinctions,
where necessary, that depend on the following:
v Whether the system provided an SDWA
v Whether you are dealing with the recovery routine or the retry routine.
Register Contents
This section describes register contents for the following:
v On entry to a recovery routine
v On return from a recovery routine (see Register Contents on Return from a
Recovery Routine on page 8-29)
v On entry to a retry routine.
The following table provides a roadmap to all the tables containing register content
information on entry to a recovery routine or on entry to a retry routine:
Table 8-5. Where to Find Register Content Information
Registers Described For:
Table 8-6
Table 8-7 on
page 8-29
Table 8-8 on
page 8-30
Table 8-9 on
page 8-31
Table 8-10 on
page 8-31
Table 8-11 on
page 8-32
Contents
GPR 1
GPR 2
16 (X'10')
8-28
Contents
GPRs 3 - 12
GPR 13
GPR 14
GPR 15
Access Registers
ARs 0 - 1
AR 2
Zero
One of the following:
v If you issued the ESTAEX macro in AR ASC mode, an ALET that
qualifies the address in GPR 2.
v Otherwise, this register does not contain any information for use by the
routine.
ARs 3 - 15
Zero.
Contents
GPR 1
Completion code in bytes 1-3. The system completion code appears in the
first 12 bits, and the user completion code appears in the second 12 bits.
GPR 2
GPRs 3 - 13
GPR 14
GPR 15
Access Registers
ARs 0 - 1
AR 2
Zero
One of the following:
v If you issued the ESTAEX macro in AR ASC mode, an ALET that
qualifies the address in GPR 2.
v Otherwise, this register does not contain any information for use by the
routine.
ARs 3 - 15
Zero.
8-29
ESTAE-type recovery routines that do not receive an SDWA must set one of the
following return codes in GPR 15:
Return Code
Meaning
16 (X'10')
Valid only for an ESTAI recovery routine. The system should not
give control to any further ESTAI routines, and should abnormally
end the task.
Contents
12 (X'0C').
GPR 1
GPR 2
Address of the purged I/O restore list if I/O was quiesced and is restorable;
otherwise, zero.
GPRs 3 - 14
GPR 15
Access Registers
AR 0
8-30
Zero.
Contents
One of the following:
v If the recovery routine was defined using ESTAEX and the caller was in
AR ASC mode, the ALET of the user parameter area.
v Otherwise, this register does not contain any information for use by the
routine.
ARs 2 - 13
ARs 14 - 15
Zero.
Contents
Zero.
GPR 1
GPRs 2 - 14
GPR 15
Access Registers
ARs 0 - 1
Zero.
ARs 2 - 13
ARs 14 - 15
Zero.
Contents
20 (X'14').
GPR 1
GPR 2
Address of the purged I/O restore list, if I/O was quiesced and is
restorable; otherwise, zero.
GPRs 3 - 14
GPR 15
Access Registers
AR 0
Zero.
AR 1
ARs 2 - 13
ARs 14 - 15
Zero.
8-31
Contents
Access Registers
ARs 0 - 15
Authorization:
v Problem or supervisor state
The ESTAE-type recovery routines you can write are entered in problem state.
v PSW key
An ESTAE-type recovery routine is entered with the PSW key that existed at the
time the recovery routine was defined.
v PKM
An ESTAE-type recovery routine is entered with the PKM that existed at the time
the recovery routine was defined.
SDWA Storage Key: An ESTAE-type recovery routine receives an SDWA in the
same storage key as the TCB key at the time the related task made the first
storage request from subpool 0.
Dispatchable Unit Mode: All ESTAE-type recovery routines receive control in task
mode.
8-32
AMODE: A recovery routine defined through the ESTAE macro, or the ESTAI
parameter on ATTACHX, has the addressing mode of the caller at the time the
macro was issued. ESTAEX routines are always entered in 31-bit addressing mode.
ASC Mode: A recovery routine defined through the ESTAE macro is entered in
primary ASC mode. A recovery routine defined through the ESTAEX macro or the
ESTAI parameter on ATTACHX is entered in the ASC mode that existed at the time
the macro was issued.
Interrupt Status: All ESTAE-type recovery routines are entered enabled for I/O
and external interrupts.
DU-AL: ESTAE-type recovery routines receive control with the DU-AL that was
current at the time of the error, as modified by any previous recovery routines, with
the following exception. For an ESTAE-type recovery routine activated by an IRB, or
activated by an IRBs ESTAE-type recovery routine, the ESTAE-type recovery
routine receives the IRBs DU-AL (IRBs get control with their own DU-AL). The
system does not modify the contents of the DU-AL during recovery processing.
Program Mask: The program mask on entry to an ESTAE-type recovery routine is
the same as the program mask at the time of error.
Condition of the Linkage Stack: On entry to an ESTAE-type recovery routine,
the current linkage stack entry is the same as it was at the time of the error, unless
a previous recovery routine added entries to the linkage stack through a PC or
BAKR instruction and did not remove them. In such a case, when percolation
occurs and the recovery routine gets control, the linkage stack contains additional
entries beyond what was the current entry at the time of the error for which the
recovery routine received control. IBM recommends that any recovery routines that
add entries to the linkage stack also remove them.
Restricted Environments: During normal task termination, a resource manager
might end abnormally; its own recovery routines, if any exist, will receive control. If
they do not retry, or if the resource manager has no recovery routines, the system
now considers this situation to be an abnormal termination, and passes control to
the newest ESTAI routine. Because the abending resource manager, and any
previous resource managers, might have completed some processing, the ESTAI
routine will run in an unpredictable environment. In this situation, IBM recommends
that you restrict the ESTAI routines processing. For the ESTAI routine to run in this
environment, design it to:
1. Check the STCBRMET field in the STCB; if the bit is on, the ESTAI routine is
running after a resource manager has ended abnormally and its recovery
routines have not retried. In this situation, the ESTAI routine does not need to
hold a lock to check the STCBRMET field. See z/OS MVS Data Areas, Vol 5
(SSAG-XTLST) for the mapping of the STCB.
2. Do as little processing as possible, and nothing that might depend on a
resource that might have been cleaned up already.
3. Do not request to retry. The system will not allow a retry in this situation.
Note that no other ESTAE-type routines receive control in this situation; only those
established through the ATTACHX macro still exist at this point in termination
processing.
8-33
Authorization:
v Problem or supervisor state
The retry routine from an ESTAE-type recovery routine that you can write is
entered in problem state.
v PSW key
If the recovery routine was defined by an ESTAE or ESTAEX macro, the retry
routine is entered with the same PSW key that existed when the macro was
issued.
If the recovery routine was defined by the ESTAI parameter of the ATTACHX
macro, the retry routine is entered with the same PSW key as the one in
RBOPSW of the retry RB, if the RBOPSW of the retry RB has a key greater than
or equal to 8 and is in problem state, and the PKM of that RB does not have
authority to keys less than 8. Otherwise, the PSW key of the retry routine is that
of the task in error.
v PKM
If the recovery routine was defined through the ESTAE or ESTAEX macro, the
retry routine is entered with the PKM that existed when the macro was issued.
If the recovery routine was defined through the ESTAI parameter of the
ATTACHX macro, the retry routine is entered with the PKM from the retry RB if
the RBOPSW of the retry RB has a key greater that or equal to 8 and is in
problem state, and the PKM of that RB does not have authority to keys less than
8. Otherwise, the PKM of the retry routine has authority that is equivalent to that
of the task in error.
SDWA Storage Key: If the recovery routine does not request that the system free
the SDWA, the retry routine receives the SDWA in the same storage key as that
which the recovery routine received.
Dispatchable Unit Mode: The retry routine is always entered in task mode.
AMODE: Retry routines are entered in the same addressing mode that existed
when the recovery routine was entered. Remember that ESTAEX routines are
always entered in 31-bit addressing mode. The recovery routine cannot change the
addressing mode of the retry routine.
ASC Mode: For recovery routines defined through the ESTAE macro, the retry
routine is entered in primary ASC mode. For recovery routines defined through the
ESTAEX macro or through the ESTAI parameter on ATTACHX, the retry routine is
entered with the ASC mode of the caller when the macro was issued.
Interrupt Status: The retry routine is always entered enabled for I/O and external
interrupts.
DU-AL: The retry routine is entered with the same DU-AL that the ESTAE-type
recovery routine received, as modified by the ESTAE-type recovery routine. The
system does not modify the contents of the DU-AL during recovery processing.
Program Mask: When the retry routine receives control, the program mask is the
one in the RBOPSW for the retry RB, saved at the time of the last interruption of
that RB that occurred while the RB was unlocked and enabled.
8-34
Condition of the Linkage Stack: For recovery routines defined through the
ESTAE or ESTAEX macro, on entry to the retry routine, the current linkage stack
entry is the same as it was at the time the macro was issued, unless the recovery
routine has set the SDWALSLV field.
For recovery routines defined through the ESTAI parameter on ATTACHX, on entry
to the retry routine, the current linkage stack entry is the same as it was at the time
the selected retry RB was entered, unless the recovery routine has set the
SDWALSLV field.
ESTAEX
Environment
When macro was issued
ASC mode=primary
ASC mode=primary
ASC mode=primary
ASC mode=primary or AR
ASC mode at time macro was issued ASC mode at time macro was issued
Linkage stack at time of error (see
Note 1)
ASC mode at time macro was issued ASC mode at time macro was issued
Linkage stack at time of error (see
Note 1)
8-35
example, where PGM1 activates an ESTAEX routine that handles recovery for
PGM1, PGM2, and PGM3.
caller ---> PGM1
BAKR
:
ESTAEX
:
BALR -------->
PGM2
BAKR
:
BALR -------->
PGM3
BAKR
***abend***
:
retry point
:
<-------- PR
Both PGM2 and PGM3 use the BAKR instruction to save status; each BAKR adds
an entry to the linkage stack. Within PGM3, retry point indicates the location
where the ESTAEX routine is to retry. After PGM3 issues the BAKR instruction, the
last entries in the linkage stack are:
v Entry 1 -- caused by PGM1s BAKR
v Entry 2 -- caused by PGM2s BAKR
v Entry 3 -- caused by PGM3s BAKR
When the abend occurs in PGM3, unless you take special measures, the linkage
stack level is reset to the level that was current when PGM1 activated the ESTAEX
recovery routine. However, retry from the abend in PGM3 occurs within PGM3. The
linkage stack level and the retry routine are not in synch. Measures you take to
avoid this situation involve:
1. Passing the recovery routine a value that represents the difference between the
level of the linkage stack that the retry routine in PGM3 needs and the level of
the stack at the time PGM1 activated the ESTAEX routine. (In our example, the
difference is 2 entries.)
2. Having the recovery routine set the value 2 in the SDWALSLV field in the
SDWA.
At a retry, the system uses the value in SDWALSLV to adjust the linkage stack. In
this way, the retry routine has the appropriate current linkage stack entry.
Two ways your program can track the entries in the linkage stack are:
v Count the number of entries added to the stack through BAKRs since PGM1
activated the ESTAEX routine. Subtract from that total the number of entries
taken from the stack through corresponding PRs.
v Issue the IEALSQRY macro, which returns the number as output.
In either case, the recovery routine must receive the value and must place it in
SDWALSLV. In summary, the value in SDWALSLV is the difference between the
number of linkage stack entries present when the retry routine gets control and the
number that were present when the recovery routine was activated. The system
preserves the additional entries on the linkage stack for use by the retry routine.
These linkage stack entries must exist at the time of the error; the system does not
create any new entries.
8-36
The following rules apply to the value in SDWALSLV, as it pertains to linkage stack
entries:
v The system ignores the SDWALSLV field when retry is from a STAE or STAI
recovery routine.
v The value must not reflect entries that were placed on the linkage stack through
a PC instruction.
v The value must reflect only those entries associated with programs that are
problem state and running with the same PSW key as the program that activated
the ESTAE-type recovery routine.
v For ESTAE-type routines, the value must reflect only those entries associated
with programs that have been established by a program running under the RB of
the retry routine. See RB Considerations on page 8-23.
If any of these rules are broken, retry still occurs but the system ignores the entry
that did not conform and all subsequent entries.
CSECT
* SAMPLE PROGRAM THAT USES ESTAEX
AMODE 31
RMODE ANY
USING EXAMPLE,15
* ESTABLISH TEMPORARY ADDRESSABILITY
B
@PROLOG
* BRANCH AROUND EYE CATCHER
DC CL24EXAMPLE 04/10/92.01 * EYE CATCHER
*
* USE THE LINKAGE STACK TO SAVE STATUS ON ENTRY TO THE PROGRAM.
*
@PROLOG BAKR 14,0
* SAVE REGISTER/PSW STATUS
*
* ESTABLISH ADDRESSABILITY FOR THIS PROGRAM.
*
LR 12,15
* REG 12 BECOMES BASE REGISTER
DROP 15
*
USING EXAMPLE,12
* ESTABLISH ADDRESSABILITY
*
* OBTAIN DYNAMIC STORAGE AREA FOR THIS REENTRANT PROGRAM.
*
L
2,DYNSIZE
* LENGTH TO OBTAIN
STORAGE OBTAIN,ADDR=(1),SP=0,LENGTH=(2)
LR 13,1
* SAVE DYNAMIC AREA ADDRESS
USING DYNAREA,13
* ADDRESSABILITY TO DYNAMIC AREA
*
* SET UP THE REMOTE PARAMETER LIST FOR THE ESTAEX MACRO.
*
MVC RMTESTAEX(@LSTSIZE),LSTESTAEX
*
* DEFINE AND ACTIVATE AN ESTAEX RECOVERY ROUTINE AT LABEL RECOVERY.
*
Chapter 8. Providing Recovery
8-37
ESTAEX RECOVERY,PARAM=DYNAREA,MF=(E,RMTESTAEX)
***********************************************************************
*
* CODE FOR THE MAINLINE ROUTINE FUNCTION CAN BE INSERTED HERE
*
*
IF AN ERROR OCCURS IN THE MAINLINE ROUTINE, THEN THE SYSTEM WILL
*
PASS CONTROL TO RECOVERY.
*
***********************************************************************
*
RETRYPT DS 0H
***********************************************************************
*
* CODE FOR THE RETRY ROUTINE FUNCTION CAN BE INSERTED HERE
*
***********************************************************************
ESTAEX 0
* DELETE THE ESTAEX
LR 1,13
* FREE DYNAMIC AREA, ADDRESS TO FREE
L
2,DYNSIZE
* LENGTH TO FREE
STORAGE RELEASE,ADDR=(1),SP=0,LENGTH=(2)
PR
* RESTORE STATUS & RETURN TO CALLER
***********************************************************************
*
* RECOVERY ROUTINE
*
***********************************************************************
RECOVERY DS
0H
* ENTRY POINT FOR ESTAEX RECOVERY ROUTINE
*
* HANDLE INPUT FROM THE SYSTEM AND RE-ESTABLISH ADDRESSABILITY FOR
* BASE REGISTER (12) AND DYNAMIC AREA REGISTER (13)
*
PUSH USING
DROP ,
* ENSURE NO SPURIOUS USING REFERENCES
USING RECOVERY,15
* TEMPORARY ADDRESSABILITY
L
12,#BASE
* RELOAD THE BASE REGISTER
DROP 15
* RELEASE TEMPORARY ADDRESSABILITY
USING EXAMPLE,12
* USE THE BASE REGISTER
USING DYNAREA,13
* DYNAMIC AREA ADDRESSABILITY
C
0,TESTNOSDWA
* IS THERE AN SDWA PRESENT?
BE NOSDWA
* NO, DO NOT USE THE SDWA
HAVESDWA DS 0H
USING SDWA,1
* ADDRESSABILITY TO SDWA
L
13,SDWAPARM
* ADDRESS OF PARAMETER ADDRESS
L
13,0(13)
* PARAMETER ADDRESS (DYNAREA)
MVC SAVE_ABCC,SDWAABCC * SAVE THE COMPLETION CODE
B
RECOV1
* CONTINUE WITH COMMON RECOVERY
NOSDWA
LR 13,2
* PARAMETER ADDRESS (DYNAREA)
ST 1,SAVE_ABCC
* SAVE THE COMPLETION CODE
SR 1,1
* NO SDWA IS AVAILABLE, CLEAR REGISTER
*
* COMMON RECOVERY PROCESSING
*
RECOV1
DS 0H
* COMMON RECOVERY PROCESSING
ST 1,SAVE_SDWA
* SAVE THE SDWA ADDRESS
ST 14,SAVE_RETURNR14 * RETURN ADDRESS TO THE SYSTEM
*
***********************************************************************
*
* CODE FOR THE RECOVERY ROUTINE FUNCTION SHOULD BE INSERTED HERE
*
***********************************************************************
*
* IF THERE IS NO SDWA, THEN SET UP FOR PERCOLATION
*
L
1,SAVE_SDWA
* RESTORE SDWA REGISTER (1)
LTR 1,1
* IS THERE AN SDWA?
BZ NORETRY
* NO, DO NOT ATTEMPT TO RETRY
8-38
*
* CHECK SDWACLUP TO SEE IF RETRY IS ALLOWED
*
TM SDWAERRD,SDWACLUP * IS RETRY ALLOWED?
BNZ NORETRY
* NO, DO NOT ATTEMPT TO RETRY
*
* SET UP THE RETURN PARAMETERS TO THE SYSTEM. THE SETRP MACRO UPDATES
* THE SDWA. NOTE: THE WKAREA PARAMETER DEFAULTS TO REGISTER 1, WHICH
* HAS THE ADDRESS OF THE SDWA. ALSO NOTE THAT OTHER REGISTERS MIGHT
* NEED TO BE UPDATED TO MEET THE NEEDS OF DIFFERENT PROGRAMS.
*
ST
12,SDWASR12
* BASE REGISTER 12 FOR RETRY
ST
13,SDWASR13
* DYNAMIC AREA REGISTER 13 FOR RETRY
SETRP RETREGS=YES,RC=4,RETADDR=RETRYPT,FRESDWA=YES
B
RECOV2
* CONTINUE WITH COMMON RECOVERY
NORETRY DS 0H
* BRANCH HERE WHEN NOT GOING TO RETRY
LA 15,0
* RETURN CODE TO INDICATE PERCOLATION
RECOV2
DS 0H
* COMPLETE THE RETURN TO THE SYSTEM
L 14,SAVE_RETURNR14 * SET THE RETURN ADDRESS TO THE SYSTEM
BR 14
* RETURN TO THE SYSTEM
*
* STATIC STORAGE AREA
*
TESTNOSDWA DC F12
* TEST FOR NO SDWA CONDITION
#BASE
DC A(EXAMPLE)
* BASE REGISTER VALUE
DYNSIZE DC AL4(@DYNSIZE)
* DYNAMIC AREA SIZE
LSTESTAEX ESTAEX RECOVERY,MF=L * LIST FORM OF ESTAEX PARAMETER LIST
@LSTSIZE EQU *-LSTESTAEX
* SIZE OF ESTAEX PARAMETER LIST
*
* DYNAMIC AREA STORAGE FOR REENTRANT PROGRAM
*
DYNAREA DSECT
* DYNAMIC STORAGE
SAVEAREA DS 18F
* REGISTER SAVE AREA
SAVE_SDWA DS F
* SDWA ADDRESS ON ENTRY TO RECOVERY
SAVE_ABCC DS F
* COMPLETION CODE
SAVE_RETURNR14 DS F
* RETURN ADDR. TO SYSTEM FROM RECOVERY
RMTESTAEX DS CL(@LSTSIZE)
* REMOTE ESTAEX PARAMETER LIST
STATUS
DS F
* MAINLINE STATUS INDICATOR
@ENDDYN DS 0X
* USED TO CALCULATE DYNAMIC AREA SIZE
@DYNSIZE EQU ((@ENDDYN-DYNAREA+7)/8)*8 * DYNAMIC AREA SIZE
*
* INCLUDE MACROS
*
IHASDWA
END
8-39
ABEND macro is issued when the job step task (the highest level or only task) is
active, or if the STEP parameter is coded in an ABEND macro issued during the
performance of any task in the job step, all the tasks in the job step are terminated.
For example, if the STEP parameter is coded in an ABEND macro under TSO/E,
the TSO/E job is terminated. An ABEND macro (without a STEP parameter) that is
issued in performance of any task in the job step task usually causes only that task
and its subtasks to be abnormally terminated. However, if the abnormal termination
cannot be fulfilled as requested, it might be necessary for the system to end the job
step task abnormally.
If you have provided a recovery routine for your program, the system passes control
to your routine. If you have not provided a recovery routine, the system handles the
problem. The action the system takes depends on whether the job step is going to
be terminated.
If the job step is not going to be terminated, the system:
v Releases the resources owned by the terminating task and all of its subtasks,
starting with the lowest level task.
v Places the system or user completion code specified in the ABEND macro in the
task control block (TCB) of the active task (the task for which the ABEND macro
was issued).
v Posts the event control block (ECB) with the completion code specified in the
ABEND macro, if the ECB parameter was coded in the ATTACHX macro issued
to create the active task.
v Schedules the end-of-task exit routine to be given control when the originating
task becomes active, if the ETXR parameter was coded in the ATTACHX macro
issued to create the active task.
v Calls a routine to free the storage of the terminating tasks TCB, if neither the
ECB nor ETXR parameter were specified by the ATTACHX macro.
If the job step is to be terminated, the system:
v Releases the resources owned by each task, starting with the lowest level task,
for all tasks in the job step. The system does not give control to any end-of-task
exit.
v Writes the system or user completion code specified in the ABEND macro on the
system output device.
The remaining steps in the job are skipped unless you can define your own
recovery routine to perform similar functions and any other functions that your
program requires. Use either the ESTAE or ESTAEX macro, or the ATTACHX
macro with the ESTAI option to provide a recovery routine that gets control
whenever your program issues an ABEND macro. If your program is running in AR
ASC mode, use the ESTAEX or ATTACHX macro.
8-40
routines are entered after all other ESTAE-type recovery routines that exist for a
given task have received control and have either failed or percolated.
MVS functions provide their own recovery routines; thus, percolation can pass
control to both installation-written and system-provided recovery routines. If all
recovery routines percolate -- that is, no recovery routine can recover from the error
-- then the task is terminated.
When a recovery routine gets control and cannot recover from the error (that is, it
does not retry), it must free the resources held by the mainline routine and request
that the system continue with error processing (percolate). Note that a recovery
routine entered with the SDWACLUP bit set to one, indicating that retry is not
permitted, has no choice but to percolate. When the recovery routine requests
percolation, the previously activated recovery routine gets control. When a retry is
not requested and the system has entered all possible recovery routines, the task
ends abnormally.
When a recovery routine requests percolation, it is deactivated; that is, it can no
longer get control for this error. A deactivated recovery routine is not entered again
unless that recovery routine is activated again after a retry.
8-41
8-42
If a STAE routine receives control and requests retry, the retry routine reissues the
STAE macro if it wants continued STAE protection.
A STAI routine is deactivated if the task completes or if the STAI routine requests
that termination continue and no further STAI processing be done. In the latter
case, all STAI recovery routines for the task are deactivated.
Contents
A code indicating the type of I/O processing performed:
0
Active I/O has been quiesced and is restorable.
4
Active I/O has been halted and is not restorable.
8
No active I/O at abend time.
16 (X'10')
Active I/O, if any, was allowed to continue.
1
Address of the SDWA.
2
Address of the parameter area you specified on the PARAM parameter.
3 - 12 Do not contain any information for use by the routine.
13
Save area address.
14
Return address.
15
Address of STAE recovery routine.
If no SDWA was available:
GPR
0
1
2
3 - 13
14
15
Contents
12 (X'0C') to indicate that no SDWA was obtained.
Completion code.
Address of user-supplied parameter list.
Do not contain any information for use by the routine.
Return address.
Address of STAE recovery routine.
When the STAE or STAI routine has completed, it should return to the system
through the contents of GPR 14. GPR 15 should contain one of the following return
codes:
Return Code
Action
4,8,12
8-43
16
8-44
If an SDWA was obtained upon entry to the STAE/STAI retry routine, the contents
of the GPRs are as follows:
GPR
0
1
2 - 14
15
Contents
0
Address of the first 104 bytes of the SDWA.
Do not contain any information for use by the routine.
Address of the STAE/STAI retry routine.
When the storage is no longer needed, the retry routine should use the FREEMAIN
macro with the default subpool to free the first 104 bytes of the SDWA.
If the system was not able to obtain storage for the work area, GPR contents are as
follows:
GPR
0
1
2
3 - 14
15
Contents
12 (X'0C')
Completion code.
Address of purged I/O restore list or 0 if I/O is not restorable.
Do not contain any information for use by the routine.
Address of the STAE/STAI retry routine.
The retry routine is entered with the same PSW key as the one in the RBOPSW of
the retry RB if the RBOPSW of the retry RB has a key greater than or equal to 8
and is in problem program state, and the PKM of that RB does not have authority to
keys less than 8.
Otherwise, the PSW key of the retry routine is that of the task in error.
8-45
8-46
ABEND dumps
SNAP dumps
Use a SNAP dump to show one or more user-specified areas in the problem-state program
while it is running. A series of SNAP dumps can show a storage area at different stages to
display a programs processing. For example, you can use SNAP dumps to show fields
holding calculations and the counter in a loop to check processing in the loop.
Transaction dumps
(IEATDUMP)
Use Transaction dump to show one or more user-specified areas in the problem-state
program while it is running. Transaction dump can be more useful for diagnosis than SNAP
dumps because you can use IPCS to gather diagnostic information. Use IPCS to format,
view, and print dumps.
z/OS MVS Diagnosis: Tools and Service Aids shows, in detail, the contents of
dumps. z/OS MVS IPCS Users Guide describes how to use IPCS. z/OS MVS
Programming: Authorized Assembler Services Guide describes macros that
authorized programs can use to dump virtual storage.
ABEND Dumps
An ABEND macro initiates error processing for a task. The DUMP option of ABEND
requests a dump of storage and the DUMPOPT or DUMPOPX option may be used
to specify the areas to be displayed. These dump options may be expanded by an
ESTAE or ESTAI routine. The system usually requests a dump for you when it
issues an ABEND macro. However, the system can provide an ABEND dump only if
Copyright IBM Corp. 1988, 2002
9-1
9-2
v The system supplies system-level data, such as the abend and reason
codes, the failing instruction, and the register/PSW difference.
v The ESTAE routine or the functional recovery routine (FRR) of the failing
program supplies module-level information, such as the failing load module
name and the failing CSECT name.
2. DAE forms a symptom string. DAE adds a descriptive keyword to each field
of problem data to form a symptom. DAE forms MVS symptoms, rather than
RETAIN symptoms. DAE combines the symptoms for a requested dump into a
symptom string.
The following tables show the required and optional symptoms. SDWA field
names are given for the symptoms the failing program must provide to enable
dump suppression. The tables have both MVS and RETAIN symptoms so that
you can relate the MVS symptoms DAE uses to the RETAIN symptoms you
might use to search the RETAIN data base. An MVS symptom string must
contain at least five symptoms that are not null. DAE places symptoms into
strings in the order shown in the tables.
Required symptoms are first and must be present.
Symptom
SDWA Field
MVS Keyword
RETAIN Keyword
SDWAMODN
MOD/name
RIDS/name#L
SDWACSCT
CSECT/name
RIDS/name
Optional symptoms must follow the required symptoms. DAE needs at least
three of these optional symptoms to make a useful symptom string.
Symptom
SDWA Field
MVS Keyword
RETAIN Keyword
SDWACID,
SDWACIDB
PIDS/name
PIDS/name
AB/S0hhh
AB/S0hhh
AB/Udddd
AB/Udddd
REXN/name
RIDS/name#R
FI/area
VALU/Harea
PSW/register difference
REGS/hhhhh
REGS/hhhhh
HRC1/nnnn
PRCS/nnnn
SUB1/name
VALU/Cname
SDWAREXN
SDWASC
3. DAE tries to match the symptom string from the dump to a symptom
string for a previous dump of the same type, that is, SVC dumps, with SVC
dumps and SYSMDUMP, or Transaction dumps with a previous SYSMDUMP or
Transaction dump. When DAE finds a match, DAE considers the dump to be a
duplicate.
Previous symptom strings are kept by DAE in virtual storage. When DAE is
started, usually during IPL, DAE selects from the DAE data set symptom strings
that were active in the last 180 days; either the string was created for a unique
dump within the last 180 days or its dump count was updated within the last
180 days. The selected symptom strings are placed in virtual storage.
Chapter 9. Dumping Virtual Storage (ABEND, SNAPX, SNAP, and IEATDUMP Macros)
9-3
The systems in a sysplex can share the DAE data set to suppress duplicate
dumps across the sysplex. While each system in a sysplex can use its own
DAE data set, IBM recommends that systems in a sysplex share a DAE data
set so that:
v DAE can write a dump on one system and suppress duplicates on other
systems in the sysplex.
v Only one DAE data set is required, rather than a data set for each system.
4. DAE updates the symptom strings in storage and, later, in the DAE data
set, if updating is requested.
v For a unique symptom string, DAE adds a new record. The record contains
the symptom string, the dates of the first and last occurrences, the incidence
count for the number of occurrences, and the name of the system that
provided the string.
v For a duplicate symptom string, DAE updates the incidence count for the
string, the last-occurrence date, and the name of the last system that found
the string.
In a sysplex, changes to the in-storage strings are propagated to the in-storage
strings throughout the sysplex.
5. DAE suppresses a duplicate dump, if DAE is enabled for dump suppression.
Note that, if you specify an ACTION of SVCD, TRDUMP, NOSUP, or
RECOVERY on a SLIP command, the command overrides DAE suppression
and the system writes the dump. Also, dumps requested by the DUMP operator
command are not eligible for suppression.
When DAE does not suppress a dump, the symptom string is in the dump
header; you can view it with the IPCS VERBEXIT DAEDATA subcommand. DAE
also issues informational messages to indicate why the dump was not
suppressed.
DAE suppresses a dump when all of the following are true:
v DAE located in the dump the minimum set of symptoms.
v The symptom string for the dump matches a symptom string for a previous
dump of the same type.
v Either of the following is true:
The current ADYSETxx parmlib member specifies SUPPRESS for the type
of dump being requested and the VRADAE key is present in the SDWA.
To set the VRADAE key, a recovery routine issues the following macro:
VRADATA KEY=VRADAE
9-4
ADYSETxx Option
VRADAE Key in
SDWA
VRANODAE Key in
SDWA
Dump Suppressed?
SUPPRESS
Yes
N/A
Yes
SUPPRESS
No
N/A
No
SUPPRESSALL
Yes
No
Yes
SUPPRESSALL
No
Yes
No
SUPPRESSALL
No
No
Yes
SUPPRESSALL
Yes
Yes
No
The only way to ensure that a dump is not suppressed, regardless of the
contents of the ADYSETxx parmlib member, is to specify the VRANODAE key in
the SDWA, or DAE=NO on SYMRBLD used to build a symptom record passed
to the SDUMPX or IEATDUMP macro with the SYMREC keyword.
References:
v See z/OS MVS Diagnosis: Reference for symptoms and symptom strings.
v See z/OS MVS Initialization and Tuning Reference for the ADYSETxx and
IEACMD00 parmlib members.
v See z/OS MVS IPCS Commands for the VERBEXIT DAEDATA subcommand.
Chapter 9. Dumping Virtual Storage (ABEND, SNAPX, SNAP, and IEATDUMP Macros)
9-5
VRADATA Macro: Use the VRAREQ key to tell DAE that the symptom is required
and the VRAOPT key to tell DAE that the symptom is optional.
A VRADATA macro with VRAREQ adds a symptom following the two required
symptoms (see the previous table). For example, to add a symptom, in this case
the name of a data set, and to define the symptom as required:
VRADATA KEY=VRAREQ,DATA=TAG1,LEN=LTAG1
VRADATA
KEY=VRADSN,DATA=MYDSN,LEN=LMYDSN
.
.
.
TAG1 DC AL2(VRADSN)
MYDSN DC CDEPT27.PAYROLL
A VRADATA macro with VRAOPT adds an optional symptom following the optional
symptoms (see the previous table). For example, to add an optional symptom with
the data at the address in register 5, and to define the symptom as optional:
LA R5,VRAOPTKEY
VRADATA KEY=VRAOPT,LEN=2,DATA=(5)
VRADAYA
KEY=VRACA,DATA=PGMCALLR
.
.
.
VRAOPTKEY DC AL2(VRACA)
PGMCALLR DS A
If the symptom is to be the callers address, the data pointed to would consist of
X'003C', which represents the key VRACA.
See z/OS MVS Diagnosis: Reference for the VRADATA keys.
Required Symptom Data: The recovery routine must provide the following
minimum data to enable dump suppression by DAE:
SDWA Field
SDWAMODN
SDWACSCT
SDWACID
SDWACIB
SDWAREXN
SDWASC
Data
Failing module name
Failing CSECT name
Product or component identifier
Component identifier base
Recovery routine name
Subcomponent or module subfunction
Example
IEAVTCXX
IEAVTC22
SCDMP
5655
IEAVTC2R
RSM-PGFIX
To obtain the failing module name, the failing CSECT name, and the recovery
module name, the recovery routine can set up a RECPARM parameter list and
specify it on a SETRP macro. For information, see the RECPARM parameter of the
SETRP macro in z/OS MVS Programming: Authorized Assembler Services
Reference SET-WTO.
Correct Module and CSECT Names: Obtaining the correct module and CSECT
names may be difficult, especially when the PSW does not point within the program
areas. Problems can also occur when the program uses the following:
v User exits: When the program calls a user exit, which in turn invokes system
services, such as getting a lock, the recovery routine often cannot identify the
exit as the failing module and CSECT. To avoid this problem, the program should
save the name of the user exit, so that the recovery routine can use the saved
name.
v Common recovery routines: The program should maintain footprints or require
that all modules using a common recovery routine update a common parameter
9-6
list with the name of the current module, CSECT, subfunction, and so on. The
recovery routine can obtain data from the common parameter list when filling in
the SDWA.
Control of Suppression: When the ADYSETxx parmlib member being used by the
installation contains SUPPRESS, a recovery routine must indicate that enough data
is available to suppress a duplicate dump. To indicate to DAE that the SDWA
contains enough data, set the VRADAE indicator in the SDWA variable recording
area by issuing the following:
VRADATA KEY=VRADAE
If the recovery routine cannot provide enough data in the SDWA suppression, the
recovery routine should indicate that its dump is not eligible for suppression, even
when the ADYSETxx member contains SUPPRESSALL. The routine should set the
VRANODAE indicator by issuing the following:
VRADATA KEY=VRANODAE
The VRANODAE key is useful for error environments that generate identical
symptoms but represent different problems.
9-7
v The VRADAE key in the SDWA is absent, signifying that the dump should not be
suppressed, and the DAE parameter of the ADYSETxx parmlib member does not
specify SUPPRESSALL.
v The VRANODAE key is present in the SDWA, specifying that the dump should
not be suppressed.
SNAP Dumps
A program can request a SNAP dump at any time during its processing by issuing a
SNAPX or SNAP macro. For a SNAP dump, the DD statement can have any name
except SYSABEND, SYSMDUMP, and SYSUDUMP.
If your program is in AR ASC mode, use the SNAPX macro instead of SNAP.
Ensure that the SYSSTATE ASCENV=AR macro has been issued to tell the macro
to generate code and addresses appropriate for callers in AR mode.
Like the ABEND dump, the data set containing the dump can reside on any device
that is supported by BSAM. The dump is placed in the data set described by the
DD statement you provide. If you select a printer, the dump is printed immediately.
However, if you select a direct access or tape device, you must schedule a
separate job to obtain a listing of the dump, and to release the space on the device.
To obtain a dump using the SNAP macro, you must provide a data control block
(DCB) and issue an OPEN macro for the data set before issuing any SNAP
macros. If the standard dump format is requested, 120 characters per line are
printed. The DCB must contain the following parameters: DSORG=PS,
RECFM=VBA, MACRF=W, BLKSIZE=882 or 1632, and LRECL=125. (The DCB is
described in z/OS DFSMS: Using Data Sets, and z/OS DFSMS Macro Instructions
for Data Sets). If a high-density dump is to be printed on a 3800 Printing
Subsystem, 204 characters per line are printed. To obtain a high-density dump,
code CHARS=DUMP on the DD statement describing the dump data set. The
BLKSIZE= must be either 1470 or 2724, and the LRECL= must be 209.
CHARS=DUMP can also be coded on the DD statement describing a dump data
set that will not be printed immediately. If CHARS=DUMP is specified and the
output device is not a 3800, print lines are truncated and print data is lost. If your
program is to be processed by the loader, you should also issue a CLOSE macro
for the SNAP DCB.
9-8
Transaction Dumps
Transaction dump is a service used to request an unformatted dump of virtual
storage to a data set, similar to a SYSMDUMP. It is invoked with the IEATDUMP
assembler macro which issues SVC 51. You can request that the dump be written
to a data set that is either pre- allocated or automatically allocated. To request a
pre-allocated data set, specify an open MACRF=W DCB that contains sufficient
space in one or more extents for the entire dump to be written. If you dont provide
a large enough data set, you will receive a partial dump. To request automatic
allocation, ensure a dump will not be truncated due to space constraints and specify
a data set name pattern. Automatic allocation is done to SYSALLDA.
When a Transaction dump is written, a dump directory record describing the dump
may be written. Specify the dump directory to be used with the IDX keyword on the
dump request. If you do not specify a dump directory, the directory allocated to
IPCSDDIR in the current job step will be used. If no dump directory is specified and
IPCSDDIR is not allocated, no record describing the dump will be written.
Dump suppression occurs using symptoms available in the current SDWA or a
symptom string may be provided (via the SYMREC keyword). If you provide a
symptom string, and an SDWA exists, the symptom string is used for suppression
purposes. Statistics for dump suppression are contained in the DAE data set and
are not differentiated from SYSMDUMPs.
Authorized users may specify the REMOTE keyword on the IEATDUMP macro to
request other address spaces on the current or other MVS images (in the same
sysplex) be dumped. When you request remote dumps, automatic allocation must
also be used.
Transaction dump uses an incident token to associate this dump with other
diagnostic information. Automatic allocation also uses this incident token for symbol
substitution in the data set name pattern. You can generate an incident token using
the IEAINTKN macro and providing the INTOKEN keyword on the dump request. If
you do not provide an incident token, one will be generated and used internally.
While an incident token may always be specified, it may be especially important
when remote dumps are requested.
An asynchronous dump may be requested by specifying ASYNC=YES on the dump
request. It is recommended that an ECB be specified for asynchronous dumps to
ensure that any volatile resources are captured before being freed.
Chapter 9. Dumping Virtual Storage (ABEND, SNAPX, SNAP, and IEATDUMP Macros)
9-9
9-10
Using the SYMRBLD Macro: SYMRBLD services use both the ADSR mapping
macro and SYMREC, thus decreasing the amount of code your application requires
to write symptom records. IBM recommends that you use SYMRBLD rather than
coding your application to use ADSR and SYMREC directly.
By invoking the SYMRBLD macro multiple times, you can generate code to build
the symptom record. After storing all symptoms into the symptom record by using
the SYMRBLD macro, invoke the SYMRBLD macro with the INVOKE=YES
parameter one last time to write the data from the symptom record to the logrec
data set.
For more information about SYMRBLD and SYMREC, see z/OS MVS
Programming: Assembler Services Reference IAR-XCT.
Using EREP or IPCS: The Environmental Record Editing and Printing (EREP)
program processes and presents software error records in the following reports:
v Detail edit report for an abend
v Detail edit report for a symptom record
v System summary report
v Event history report
v Detail summary report
EREP Users Guide describes how to use EREP.
10-1
IPCS formats the software error records. You can use the IPCS VERBEXIT
LOGDATA subcommand to format and print or view the logrec data set records in a
dump. For more information about the subcommand, see z/OS MVS IPCS
Commands.
Section 1 (Environmental Data): Section 1 contains the record header with basic
environmental data. The environmental data provides a system context within which
the software errors can be viewed. The SYMREC caller initializes this area to zero
and stores the characters "SR" into the record header. The environmental data of
section 1 is filled in automatically when you invoke the SYMREC macro. Section 1
includes items such as:
v CPU model and serial number
v Date and time, with a time zone conversion factor
v Customer assigned system name
v Product ID of the control program
Section 2 (Control Data): Section 2 contains control information with the lengths
and offsets of the sections that follow. The application must initialize the control
information before invoking SYMREC for the first time. You can initialize the control
information by using SYMRBLD with the INITIAL parameter. Section 2 immediately
follows section 1 in the symptom record structure.
Section 2.1 (Component Data): Section 2.1 contains the name of the component
in which the error occurred, as well as other specific component-related data. The
application must also initialize section 2.1 before invoking SYMREC. You can
initialize the control information by using SYMRBLD with the INITIAL parameter.
Section 3 (Primary SDB Symptoms): Section 3 contains the primary string of
problem symptoms, which may be used to perform tasks such as duplicate problem
recognition. When an application detects an error, it must store a string of
symptoms in section 3, and this string becomes the primary symptom for the error.
This string should be a unique and complete description of the error. All incidences
of that error should produce the same string in section 3. When problems are
analyzed, problems that have identical strings in section 3 represent the same error.
Note that an application does not store any primary symptom string or invoke
SYMREC unless it detects an error in its own processing. You can invoke
SYMRBLD with the PRIMARY parameter to store symptoms into section 3.
Section 4 (Secondary SDB Symptoms): Section 4 contains an optional secondary
symptom string. The purpose of the secondary string is to provide additional
symptoms that might supplement the symptoms in section 3.
Section 5 (Free-Format Data): Section 5 contains logical segments of optional
problem-related data to aid in problem diagnosis. However, the data in section 5 is
not in the SDB format, which is found in only sections 3 and 4. Each logical
segment in section 5 is structured in a key-length-data format.
10-2
Data
A component name
A routine name
An abend code
A return code
For more information about the prefixes and all valid SDB key names, see z/OS
MVS Programming: Assembler Services Reference IAR-XCT. For a full explanation
of symptom strings and how to format and print the four basic symptom record
reports, see z/OS MVS Diagnosis: Procedures and z/OS MVS Diagnosis: Tools and
Service Aids.
10-3
incident occurs. These alterations and substitutions must be obvious to the user
who interprets the data. Setting these flag fields is the responsibility of the program
that alters or substitutes the data. If a program changes a symptom record that is
already written on the repository, it should set the appropriate RA-designated
flag-bit fields as an indication of how the record has been altered.
The remaining fields, those not marked by RC, RS, or RA, are optionally set by the
caller of the SYMREC macro. When SYMREC is invoked, it checks that all the
required input fields in the symptom record are set by the caller. If the required
input fields are not set, SYMREC issues appropriate return and reason codes.
Record header
Local Time Conversion Factor
Time stamp
Time stamp (HHMMSSTH)
Date (YYMMDD)
Customer Assigned System/Node Name
Product ID of Base System (BCP)
Feature and level of Symrec Service
Truncated flag
Section 3 modified flag
Surrogate record flag
Section 4 modified flag
ADSRTOD & ADSRDATE not computed flag
Asynchronous event flag
Name of dump
(RC)
(RS)
(RS)
(RS)
(RS)
(RS)
(RA)
(RA)
(RS)
(RA)
Notes:
1. SYMREC stores the TOD clock value into ADSRTIME when the incident occurs.
However, it does not compute ADSRTOD and ADSRDATE when the incident
occurs, but afterwards, when it formats the output. When the incident occurs,
SYMREC also sets ADSRNOTD to 1 as an indication that ADSRTOD and
ADSRDATE have not been computed.
2. SYMREC stores the customer-assigned system node name into ADSRSID.
3. SYMREC stores the first four digits of the base control program component id
into ADSRSYS. The digits are 5752, 5759 and 5745 respectively for MVS, VM
and DOS/VSE.
4. The ADSRDTP field is not currently used by the system.
5. If some application creates the record asynchronously, that application should
set ADSRASYN to 1. 1 means that the data is derived from sources outside the
normal execution environment, such as human analysis or some type of
machine post-processing.
6. If SYMREC truncates the symptom record, it sets ADSRTRNC to 1. This can
happen when the size of the symptom record provided by the invoking
application exceeds SYMRECs limit.
7. ADSRSGEN indicates that the symptom record was not provided as first time
data capture by the invoking application. Another program created the symptom
record. For instance, the system might have abended the program, and created
a symptom record for it because the failing program never regained control.
Setting the field to 1 means that another program surrogate created the record.
The identification of the surrogate might be included with other optional
information, for example, in section 5.
10-4
8. The application invoking SYMREC must provide the space for the entire
symptom record, and initialize that space to hex zeroes. The application must
also store the value SR into ADSRID.
9. The fields ADSRCPM through ADSRFL2, which appear in the record that is
written to the logrec data set, are also written back into the input symptom
record as part of the execution of SYMREC.
(RS)
(RC)
(RC)
(RC)
(RC)
(RC)
Notes:
1. The invoking application must ensure that the actual lengths of supplied data
agree with the lengths indicated in the ADSR data area. The application should
not assume that the SYMREC service validates these lengths and offsets.
2. The lengths and offsets in section 2 are intended to make the indicated portions
of the record indirectly addressable. Invoking applications should not program to
a computed absolute offset, which may be observed from the byte assignments
in the data area.
3. The value of the ADSRARID field is the architectural level at which the
SYMREC service is operating. The architecture level is always 10.
4. Section 2 has a fixed length of 48 bytes. Optional fields (not marked with RC,
RS, or RA) will contain zeroes when the invoking application provides no values
for them.
(RC)
(RC)
(RC)
(RC)
(RC)
(RC)
(RS)
(RS)
10-5
Notes:
1. This section has a fixed length of 100 bytes, and cannot be truncated. Optional
fields (not marked with RC, RS, or RA) will appear as zero if no values are
provided.
2. ADSRCID is the component ID of the application that incurred the error.
Under some circumstances, there can be more than one component ID
involved. For ADSRCID, select the component ID that is most indicative of the
source of the error. The default is the component ID of the detecting program.
In no case should the component ID represent a program that only
administratively handles the symptom record. Additional and clarifying data
(such as, other component ID involved) is optional, and may be placed in
optional entries such as ADSRCDSC of section 2.1, section 4, or section 5.
For example: if component A receives a program check; control is taken by
component B, which is the program check handler. Component C provides a
service to various programs by issuing SYMREC for them. In this case, the
component ID of A should be given. Component B is an error handler that is
unrelated to the source of the error. Component C is only an administrator.
Note that, in this example, it was possible for B to know A was the program in
control and the source of the program check. This precise definition is not
always possible. B is the detector, and the true source of the symptom record.
If the identity of A was unknown, then B would supply, as a default, its own
component ID.
ADSRCID is not a required field in this section, although it is required in
section 3 after the PIDS/ prefix of the symptom string. Repeating this value in
section 2.1 is desirable but not required. Where the component ID is not given
in section 2.1, this field must contain zeroes.
ADSRPID is the program identification number assigned to the program that
incurred the error. ADSRPID must be provided only by IBM programs that do
not have an assigned component ID. Therefore, ADSRCID contains hex
zeroes if ADSRPID is provided.
3. ADSRLVL is the release level of the component indicated in ADSRCID.
4. ADSRPIDL is the release level of the program designated by ADSRPID, and it
should be formatted using the characters, V, R, and M as separators, where V,
R, and M represent the version, release, and modification level respectively.
For example, V1R21bbbbb is Version 1 Release 2.1 without any modification.
No punctuation can appear in this field, and ADSRPIDL must be provided only
when ADSRPID is provided.
5. ADSRPTF is the service level. It may differ from ADSRLVL because the
program may be at a higher level than the release. ADSRPTF can contain any
number indicative of the service level. For example, a PTF, FMID, APAR
number, or user modification number. This field is not required, but it should be
provided if possible.
6. ADSRCDSC is a 32-byte area that contains text, and it is only provided at the
discretion of the reporting component. It provides clarifying information.
7. ADSRREA is the reason code, and ADSRRET is the return code from the
execution of SYMREC. SYMREC places these values in registers 0 and 15
and in these two fields as part of its execution. The fields are right justified,
and identical to the contents of registers 0 and 15.
8. ADSRCRL is the architectural level of the record, which is always 10. Note that
ADSRARID (section 2) is the architectural level of the SYMREC service.
9. ADSRPRID is a value that can be used to associate the symptom record with
other symptom records. This value must be in EBCDIC, but it is not otherwise
restricted.
10-6
10-7
two-byte length field. Adjacent segments must be packed together. The length of
section 5 is in the ADSRRONL field in section 2, and this field should be
correctly updated as a result of all additions or deletions to section 5.
2. There are 64K key values grouped in thirteen ranges representing thirteen
potential SYMREC user categories. The data type (that is, hexadecimal,
EBCDIC, etc.) of section 5 is indicated by the category of the key value. Thus,
the key value indicates both the user category and the data type that are
associated with the information in section 5. Because the component ID is a
higher order qualifier of the key, it is only necessary to control the assignment of
keys within each component ID or, if a component ID is not assigned, within
each PID number.
Key Value
0001-00FF
0100-0FFF
1000-18FF
1900-1FFF
2000-BFFF
C000-CFFF
D000-DFFF
E000-EFFF
F000
F001-F0FFN
F100-FEFF
FF00
FF01-FFFF
10-8
11-1
11-2
RU or RC
VRU or VRC
11-3
.
.
GETMAIN EC,LV=16000,A=ANSWADD
The code shown in Figure 11-1 makes a conditional request for a single element of
storage with a length of 16,000 bytes. The return code in register 15 is tested to
determine if the storage is available; if the return code is 0 (the 16,000 bytes were
allocated), control is passed to the processing routine. If sufficient storage is not
available, an attempt to obtain more virtual storage is made by issuing a DELETE
macro to free the area occupied by the load module REENTMOD. A second
GETMAIN macro is issued, this time an unconditional request for an area between
4,000 and 16,000 bytes in length. If the minimum size is not available, the task is
abnormally terminated. If at least 4,000 bytes are available, the task can continue.
The size of the area actually allocated is determined, and one of the two
procedures (efficient or inefficient) is given control.
Note: If you issue GETMAIN for less than a single page and you then issue the
PGSER macro with the PROTECT option, the entire page is made read-only,
whether you have issued GETMAIN for it or not. IBM recommends that you
use PROTECT for full pages only. This usage avoids making other areas of
storage read-only unintentionally. If you update the page using real
addresses after the page has been protected, the page must be fixed until it
is unprotected; otherwise data might be lost.
When you issue this macro, the system uses certain defaults. The following list
summarizes the defaults for optional parameters and identifies the parameters that
override the system defaults.
v After STORAGE completes, you will find the address of the storage in register 1
(ADDR parameter).
v The storage is located in subpool 0 (SP parameter).
v The storage is aligned on a doubleword boundary (BNDRY parameter).
v After the macro executes, you will find the return code in register 15 (RTCD
parameter).
11-4
11-5
Subpool Handling
The system provides subpools of virtual storage to help you manage virtual storage
and communicate between tasks in the same job step. Because the use of
subpools requires some knowledge of how the system manages virtual storage, a
discussion of virtual storage control is presented here.
Virtual Storage Control: When the job step is given a region of virtual storage in
the private area of an address space, all of the storage area available for your use
within that region is unassigned. Subpools are created only when a GETMAIN,
STORAGE, or CPOOL macro is issued designating a subpool number (other than
0) not previously specified. If no subpool number is designated, the virtual storage
is allocated from subpool 0, which is created for the job step by the system when
the job-step task is initiated.
For purposes of control and virtual storage protection, the system considers all
virtual storage within the region in terms of 4096-byte blocks. These blocks are
assigned to a subpool, and space within the blocks is allocated to a task by the
system when requests for virtual storage are made. When there is sufficient
unallocated virtual storage within any block assigned to the designated subpool to
fill a request, the virtual storage is allocated to the active task from that block. If
there is insufficient unallocated virtual storage within any block assigned to the
subpool, a new block (or blocks, depending on the size of the request) is assigned
to the subpool, and the storage is allocated to the active task. The blocks assigned
to a subpool are not necessarily contiguous unless they are assigned as a result of
one request. Only blocks within the region reserved for the associated job step can
be assigned to a subpool.
11-6
Figure 11-2 is a simplified view of a virtual storage region containing four 4096-byte
blocks of storage. All the requests are for virtual storage from subpool 0. The first
request from some task in the job step is for 1008 bytes; the request is satisfied
from the block shown as Block A in the figure. The second request, for 4000 bytes,
is too large to be satisfied from the unused portion of Block A, so the system
assigns the next available block, Block B, to subpool 0, and allocates 4000 bytes
from Block B to the active task. A third request is then received, this time for 2000
bytes. There is enough area in Block A (blocks are checked in the order first in, first
out), so an additional 2000 bytes are allocated to the task from Block A. All blocks
are searched for the closest fitting free area which will then be assigned. If the
request had been for 96 bytes or less, it would have been allocated from Block B.
Because all tasks may share subpool 0, Request 1 and Request 3 do not have to
be made from the same task, even though the areas are contiguous and from the
same 4096 byte block. Request 4, for 6000 bytes, requires that the system allocate
the area from 2 contiguous blocks which were previously unassigned, Block D and
Block C. These blocks are assigned to subpool 0.
As indicated in the preceding example, it is possible for one 4096-byte block in
subpool 0 to contain many small areas allocated to many different tasks in the job
step, and it is possible that numerous blocks could be split up in this manner. Areas
acquired by a task other than the job step task are not released automatically on
task termination. Even if FREEMAIN or STORAGE RELEASE macros were issued
for each of the small areas before a task terminated, the probable result would be
that many small unused areas would exist within each block while the control
program would be continually assigning new blocks to satisfy new requests. To
avoid this situation, you can define subpools for exclusive use by individual tasks.
Request 1
1008 bytes
Request 2
4000 bytes
Request 4
6000 bytes
Request 3
2000 bytes
Block A
Block B
Block C
Block D
Any subpool can be used exclusively by a single task or shared by several tasks.
Each time that you create a task, you can specify which subpools are to be shared.
Unlike other subpools, subpool 0 is shared by a task and its subtask, unless you
specify otherwise. When subpool 0 is not shared, the system creates a new
subpool 0 for use by the subtask. As a result, both the task and its subtask can
request storage from subpool 0 but both will not receive storage from the same
4096-byte block. When the subtask terminates, its virtual storage areas in subpool 0
are released; since no other tasks share this subpool, complete 4096-byte blocks
are made available for reallocation.
Chapter 11. Virtual Storage Management
11-7
Note: If the storage is shared, it is not released until the owning task terminates.
When there is a need to share subpool 0, you can define other subpools for
exclusive use by individual tasks. When you first request storage from a subpool
other than subpool 0, the system assigns new 4096-byte blocks to that subpool,
and allocates storage from that block. The task that is then active is assigned
ownership of the subpool and, therefore, of the block. When additional requests are
made by the same task for the same subpool, the requests are satisfied by
allocating areas from that block and as many additional blocks as are required. If
another task is active when a request is made with the same subpool number, the
system assigns a new block to a new subpool, allocates storage from the new
block, and assigns ownership of the new subpool to the second task.
FREEMAIN or STORAGE RELEASE macros can be issued to release any
complete subpool except subpool 0, thus releasing complete 4096-byte blocks.
Storage Key
v CPOOL BUILD
v STORAGE OBTAIN or RELEASE;
CALLRKY=YES is omitted or CALLRKY=NO is
specified
A program can issue a request to obtain or release storage from subpool 131 or
132 in a storage key that does not match the PSW key under which the program is
running. However, the system will accept the storage request only if the requesting
program is authorized to access the storage. To access storage in subpool 131 or
132, a problem-state program that is not APF-authorized and is running under PSW
key 8-15 must be able to switch its PSW key to match the storage key. Such a
program can switch its PSW key only if a supervisor-state program has previously
11-8
set up the PSW-key mask (PKM) to enable the PSW key switch. For STORAGE
RELEASE or FREEMAIN requests to release all the storage in subpool 131 or 132,
the requesting program must be able to switch its PSW key to match all the storage
keys that exist in the subpool. For information about the function and structure of
the PSW key-mask, and information about switching the PSW key, see Principles of
Operation.
Owning and Sharing Subpools: A subpool is initially owned by the task that was
active when the subpool was created. The subpool can be shared with other tasks,
and ownership of the subpool can be assigned to other tasks. The macros used to
handle subpools are STORAGE, GETMAIN, ATTACH and ATTACHX. In the
GETMAIN and STORAGE macros, you can specify the SP parameter to request
storage from subpools 0-127, 131, or 132. If you omit the SP parameter, the system
assumes subpool 0. The parameters that deal with subpools in the ATTACH and
ATTACHX macros are:
v GSPV and GSPL, which give ownership of one or more subpools (other than
subpool 0) to the task being created.
v SHSPV and SHSPL, which share ownership of one or more subpools (other than
subpool 0) with the new subtask.
v SZERO, which determines whether subpool 0 is shared with the subtask.
All of these parameters are optional. If they are omitted, no subpools are given to
the subtask, and only subpool 0 is shared.
Creating a Subpool: If the subpool specified does not exist for the active task, a
new subpool is created whenever SHSPV or SHSPL is coded on ATTACH or
ATTACHX, or when a GETMAIN or STORAGE macro is issued. A new subpool zero
is created for the subtask if SZERO=NO is specified on ATTACH or ATTACHX. If
one of the ATTACH or ATTACHX parameters that specifies shared ownership of a
subpool causes the subpool to be created, the subpool number is entered in the list
of subpools owned by the task, but no blocks are assigned and no storage is
actually allocated. If a GETMAIN or STORAGE macro results in the creation of a
subpool, the subpool number is assigned to one or more 4096-byte blocks, and the
requested storage is allocated to the active task. In either case, ownership of the
subpool belongs to the active task; if the subpool is created because of an ATTACH
or ATTACHX macro, ownership is transferred or retained depending on the
parameter used.
Transferring Ownership: An owning task gives ownership of a subpool to a direct
subtask by using the GSPV or GSPL parameters on ATTACH or ATTACHX issued
when that subtask is created. Ownership of a subpool can be given to any subtask
of any task, regardless of the control level of the two tasks involved and regardless
of how ownership was obtained. A subpool cannot be shared with one or more
subtasks and then transferred to another subtask, however; an attempt to do this
results in abnormal termination of the active task. Ownership of a subpool can only
be transferred if the active task has sole ownership; if the active task is sharing a
subpool and an attempt is made to transfer it to a subtask, the subtask receives
shared control and the originating task relinquishes the subpool. Once ownership is
transferred to a subtask or relinquished, any subsequent use of that subpool
number by the originating task results in the creation of a new subpool. When a
task that has ownership of one or more subpools terminates, all of the virtual
storage areas in those subpools are released. Therefore, the task with ownership of
a subpool should not terminate until all tasks or subtasks sharing the subpool have
completed their use of the subpool.
11-9
If GSPV or GSPL specifies a subpool that does not exist for the active task, no
action is taken.
Sharing a Subpool: A task can share ownership of a subpool with a subtask that it
attaches. Subtasks cannot share ownership of a subpool with the task that caused
the attach. A program shares ownership by specifying the SHSPV or SHSPL
parameters on the ATTACH or ATTACHX macro issued when the subtask is
created. Any task with ownership or shared control of the subpool can add to or
reduce the size of the subpool through the use of the GETMAIN, FREEMAIN, or
STORAGE macros. When a task that has shared control of the subpool terminates,
the subpool is not affected.
Subpools in Task Communication: The advantage of subpools in virtual storage
management is that, by assigning separate subpools to separate subtasks, the
breakdown of virtual storage into small fragments is reduced. An additional benefit
from the use of subpools can be realized in task communication. A subpool can be
created for an originating task and all parameters to be passed to the subtask
placed in the subpool. When the subtask is created, the ownership of the subpool
can be passed to the subtask. After all parameters have been acquired by the
subtask, a FREEMAIN or STORAGE RELEASE macro can be issued, under control
of the subtask, to release the subpool virtual storage areas. In a similar manner, a
second subpool can be created for the originating task, to be used as an answer
area in the performance of the subtask. When the subtask is created, the subpool
ownership would be shared with the subtask. Before the subtask is terminated, all
parameters to be passed to the originating task are placed in the subpool area;
when the subtask is terminated, the subpool is not released, and the originating
task can acquire the parameters. After all parameters have been acquired for the
originating task, a FREEMAIN or STORAGE RELEASE macro again makes the
area available for reuse.
11-10
Reenterable Macros
All of the macros described in this manual can be written in reenterable form. These
macros are classified as one of two types: macro that pass parameters in registers
0 and 1, and macros that pass parameters in a list. The macros that pass
parameters in registers present no problem in a reenterable program; when the
macro is coded, the required parameter values should be contained in registers. For
example, the POST macro requires that the ECB address be coded as follows:
POST ecb address
The macros that pass parameters in a list require the use of special forms of the
macro when used in a reenterable program. The macros that pass parameters in a
list are identified within their descriptions in z/OS MVS Programming: Assembler
Services Reference ABE-HSP and z/OS MVS Programming: Assembler Services
Reference IAR-XCTThe expansion of the standard form of these macros results in
an in-line parameter list and executable instructions to branch around the list, to
save parameter values in the list, to load the address of the list, and to pass control
to the required system routine. The expansions of the list and execute forms of the
macro simply divide the functions provided in the standard form expansion: the list
form provides only the parameter list, and the execute form provides executable
instructions to modify the list and pass control. You provide the instructions to load
the address of the list into a register.
The list and execute forms of a macro are used in conjunction to provide the same
services available from the standard form of the macro. The advantages of using
list and execute forms are as follows:
v Any parameters that remain constant in every use of the macro can be coded in
the list form. These parameters can then be omitted in each of the execute forms
of the macro which use the list. This can save appreciable coding time when you
use a macro many times. (Any exceptions to this rule are listed in the description
of the execute form of the applicable macro.)
v The execute form of the macro can modify any of the parameters previously
designated. (Again, there are exceptions to this rule.)
v The list used by the execute form of the macro can be located in a portion of
virtual storage assigned to the task through the use of the GETMAIN macro. This
ensures that the program remains reenterable.
Figure 11-3 shows the use of the list and execute forms of a DEQ macro in a
reenterable program. The length of the list constructed by the list form of the macro
is obtained by subtracting two symbolic addresses; virtual storage is allocated and
the list is moved into the allocated area. The execute form of the DEQ macro does
not modify any of the parameters in the list form. The list had to be moved to
allocated storage because the system can store a return code in the list when
RET=HAVE is coded. Note that the coding in a routine labeled MOVERTN is valid
for lengths up to 256 bytes only. Some macros do produce lists greater than 256
bytes when many parameters are coded (for example, OPEN and CLOSE with
many data control blocks, or ENQ and DEQ with many resources), so in actual
Chapter 11. Virtual Storage Management
11-11
practice a length check should be made. The move long instruction (MVCL) should
be considered for moving large data lists.
.
.
LA
3,MACNAME
Load address of list form
LA
5,NSIADDR
Load address of end of list
SR
5,3
Length to be moved in register 5
BAL
14,MOVERTN
Go to routine to move list
DEQ
,MF=(E,(1))
Release allocated resource
.
.
* The MOVERTN allocates storage from subpool 0 and moves up to 256
* bytes into the allocated area. Register 3 is from address,
* register 5 is length. Area address returned in register 1.
MOVERTN
GETMAIN R,LV=(5)
LR
4,1
Address of area in register 4
BCTR
5,0
Subtract 1 from area length
EX
5,MOVEINST
Move list to allocated area
BR
14
Return
MOVEINST
MVC
0(0,4),0(3)
.
.
MACNAME
DEQ
(NAME1,NAME2,8,SYSTEM),RET=HAVE,MF=L
NSIADDR
...
...
NAME1
DC
CL8MAJOR
NAME2
DC
CL8MINOR
Figure 11-3. Using the List and the Execute Forms of the DEQ Macro
11-12
v If the load module was requested on LINK, LINKX, ATTACH, ATTACHX, XCTL,
or XCTLX, that responsibility count is lowered when using XCTL or XCTLX or by
returning control to the system.
v When a task is terminated, the responsibility counts are lowered by the number
of requests for the load module made by LINK, LINKX, LOAD, ATTACH,
ATTACHX, XCTL, or XCTLX during the performance of that task, minus the
number of deletions indicated above.
The virtual storage area occupied by a load module is released when the
responsibility counts reach zero. When you plan your program, you can design the
load modules to give you the best trade-off between execution time and efficient
paging. If you use a load module many times in the course of a job step, issue a
LOAD macro to bring it into virtual storage; do not issue a DELETE macro until the
load module is no longer needed. Conversely, if a load module is used only once
during the job step, or if its uses are widely separated, issue LINK or LINKX to
obtain the module and issue an XCTL or XCTLX from the module (or return control
to the system) after it has been executed.
There is a minor problem involved in the deletion of load modules containing data
control blocks (DCBs). An OPEN macro instruction must be issued before the DCB
is used, and a CLOSE macro issued when it is no longer needed. If you do not
issue a CLOSE macro for the DCB, the system issues one for you when the task is
terminated. However, if the load module containing the DCB has been removed
from virtual storage, the attempt to issue the CLOSE macro causes abnormal
termination of the task. You must either issue the CLOSE macro yourself before
deleting the load module, or ensure that the data control block is still in virtual
storage when the task is terminated (possibly by issuing a GETMAIN and creating
the DCB in the area that had been allocated by the GETMAIN).
11-13
11-14
12-1
All programs start in 24-bit or 31-bit AMODE; at that time, they are unable to work
with data above the bar. To use virtual storage above the bar, a program must
change to AMODE 64 and use the new z/Architecture assembler instructions.
While there is no practical limit to the virtual storage above the bar, there are
practical limits to the real storage frames that back that area. To control the amount
of real and auxiliary storage that an address space can use, your installation can
set a limit, called a MEMLIMIT, on the total number of usable virtual pages above
the bar for a single address space. To learn the MEMLIMIT value, see a system
programmer at your installation.
Memory Objects
Programs obtain storage above the bar in chunks of virtual storage called
memory objects. The system allocates a memory object as a number of virtual
segments; each segment is a megabyte in size and begins on a megabyte
boundary. A memory object can be as large as the memory limits set by your
installation and as small as one megabyte.
12-2
Using the IARV64 macro, a program can create and free a memory object and
manage the physical frames that back the virtual storage. You can think of IARV64
as the GETMAIN/FREEMAIN or STORAGE macro for virtual storage above the bar.
(GETMAIN/FREEMAIN and STORAGE do not work on virtual storage above the
bar; neither do CPOOL or callable cell pool services.)
When a program creates a memory object, it provides an area in which the system
returns the memory objects low address. You can think of that address as the
name of the memory object. After creating the memory object, the program can use
the storage in the memory object much as it used storage in the 2-gigabyte address
space; see Using a Memory Object on page 12-10. The program cannot safely
operate on storage areas that span more than one memory object.
To help the system manage the physical pages that back ranges of addresses in
memory objects, a program can alert the system to its use of some of those pages,
making them available for the system to steal and then return.
The program can free the physical pages that back ranges of memory objects and,
optionally, clear those ranges to zeros. Later, the program can ask the system to
return the physical backing from auxiliary storage. When it no longer needs the
memory object, the program frees it in its entirety.
While your program can obtain only one memory object at a single invocation of
IARV64, it can, for management purposes, relate a set of two or more memory
objects to each other by specifying a user token, a value you choose. A program
can then delete all memory objects that have the same user token value.
All S/390 instructions are carried forward into z/Architecture and continue to operate
using the low-order half of the z/Architecture 64-bit GPRs. That is, an S/390
Chapter 12. Using the 64-bit Address Space
12-3
Throughout the discussion of GPRs, bits 0 through 31 of the 64-bit GPR are called
the high-order half, and bits 32 through 63 are called the low-order half.
z/Architecture 64-bit GPR
low-order half
high-order half
0
32
63
The purpose of this section is help you use the 64-bit GPR and the 64-bit
instructions as you want to save registers, perform arithmetic operations, access
data. It is not a tutorial about how to use the new instruction set. Principles of
Operation is the definitive reference book for these instructions. This section,
however, describes some concepts that provide the foundation you need. After you
understand these, you can go to Principles of Operation and read the introduction
to z/Architecture that appears in the first chapter and then refer to the specific
instructions you need to write your program.
Second, consider the LOAD instruction: L R3,MYDATA. This instruction takes the 4
bytes of data at location MYDATA and puts them into the low order bits of GPR3.
The high-order half is not changed by the ADD instruction or the LOAD instruction.
The register forms of these instructions (AR and LR) work similarly, as do Add
Logical instructions (AL and ALR).
12-4
Because 32-bit binary integers are prevalent in S/390, z/Architecture also provides
instructions that use a 64-bit binary integer and a 32-bit binary integer. These
instructions include a GF in the instruction mnemonic (AGF and LGF). Consider
AGF. In AGF R3,MYDATA, assume that MYDATA holds a 32-bit positive binary
integer, and GPR3 holds a 64-bit positive binary integer. (The numbers could have
been negative.) The AGF instruction adds the contents of MYDATA to the contents
of GPR3 and places the resulting signed binary integer in GPR3; the sign
extension, in this case, is zeros.
The AGFR instruction adds the contents of the low-order half of a 64-bit GPR to bits
0 through 63 in another 64-bit GPR. Instructions that include GF are very useful
as you move to 64-bit addressing.
12-5
Non-Modal Instructions
An instruction that behaves the same, regardless of the AMODE of the program, is
called a non-modal instruction. The only influence AMODE exerts on how a
non-modal instruction performs is where the storage operand is located. Two
excellent examples of non-modal instructions have already been described: the
Load and the Add instructions. Non-modal z/Architecture instructions already
described also include the LG instruction and the AGF instruction. For example,
programs of any AMODE can issue AG R3,NUM64, described earlier, which adds
the value of a doubleword binary integer at location NUM64 to the contents of
GPR3, placing the sum in GPR3.
The LGF instruction is another example of a non-modal instruction. In LGF
R3,MYDATA, assume MYDATA is a signed negative binary integer. This instruction
places MYDATA into the low-order half of GPR3 and propagates the sign (1s) to the
high-order half, as follows:
If the current AMODE is 64, MYDATA can reside anywhere in the address space; if
the AMODE is 31, MYDATA must reside below 2 gigabytes; if the AMODE is 24,
MYDATA must reside below 16 megabytes.
Other 64-bit instructions that are non-modal are the register form of AGF, which is
AGFR, and the register form of LGF, which is LGFR. Others are LGR, AGR, ALGR,
and ALG.
Modal Instructions
Modal instructions are instructions where addressing mode is a factor in the output
of the instruction. The AMODE determines the width of the output register
operands. A good example of a modal instruction is Load Address (LA). If you
specify LA R3,VIRT_PTR successively in the three AMODEs, what are the three
results?
v In AMODE 24, the address of VIRT_PTR is a 24-bit address that is loaded into
bits 40 through 63 of GPR3 (or bits 8 through 31 of the 32-bit register imbedded
in the 64-bit GPR). The processor places zeroes into bits 32 through 39, and
leaves the first 31 bits unchanged, as follows:
12-6
v In AMODE 64, the address of VIRT_PTR fill the entire 64-bit GPR3:
Other modal instructions are Move Long (MVCL), Branch and Link (BALR), and
Branch and Save (BASR).
Linkage Conventions
In z/OS R2, program entry is in AMODE 31; therefore linkage conventions you have
used in S/390 apply, which means passing 4-byte parameter lists and a 72-byte
savearea.
A older program changing into AMODE 64 to exploit z/Architecture instructions
should expect to receive 31-bit addresses and the 72-byte save area from its
callers. If you are running in AMODE 64 and want to use an address a caller has
passed to you, the high-order half of the GPR will probably not be cleared to
zeroes. As soon as you receive this address, use the Load Logical G Thirty One
Bits (LLGTR) instruction to change this 31-bit address into a 64-bit address that you
can use.
Pitfalls to Avoid
As you begin to use the 64-bit instructions, consider the following:
Chapter 12. Using the 64-bit Address Space
12-7
IARV64 Services
The IARV64 macro provides all the virtual storage services for your programs. This
section introduces these services and the rules for what programs can do with the
memory objects your programs create and use.
Your program can use:
v The GETSTOR service to create a memory object in the primary address space.
The memory object has a storage key that matches your PSW key. You can
assign ownership of the memory object to the TCB of the job step task or the
mother task (the task of the program that issued the ATTACHX). You can create
a memory object that contains two areas: a usable area and a guard area that
cannot be used while in that state.
v The PAGEOUT service to alert the system that physical pages will not be used
so that the system can optimize the use of the physical pages.
v The PAGEIN service to alert the system that pages will be needed soon.
v The DISCARDATA service to discard in physical pages and optionally clear the
pages to zeros.
v The CHANGEGUARD service to change
v The DETACH service to free one or more memory objects that you own.
The remaining pages of this chapter describe how you use IARV64 services. It
does not describe environmental or programming requirements, register usage, or
12-8
syntax rules. For that information, turn to the descriptions of the IARV64 macro in
z/OS MVS Programming: Assembler Services Reference IAR-XCT.
12-9
When a program creates a memory object, it can specify, through the GUARDSIZE
and GUARDHIGH and GUARDLOW parameters, that the memory object is to
consist of two different areas. One area is called a guard area; this storage is not
accessible; the other area is called the usable area. A later request can change the
guard area into a usable area. The section Creating a Guard Area and Changing
its Size on page 12-13 can help you understand the important purposes for this
kind of memory object.
Before issuing IARV64, issue SYSSTATE ARCHLVL=2 so that the macro generates
the correct parameter addresses.
12-10
Table 12-1. Comparing Tasks and Concepts: Below the Bar and Above the Bar
Task or concept
Obtaining storage
GETMAIN, STORAGE,
CPOOL macros and callable
cell pool services. On
GETMAIN and STORAGE,
you can ask to have a return
code tell you whether the
storage is cleared to zeros.
Increments of storage
allocation
In 8byte increments.
In 1-megabyte increments.
Freeing storage
FREEMAIN, STORAGE,
CPOOL macros, and callable
cell pool services. Any 8-byte
increment of the
originally-obtained storage
can be freed. An entire
subpool can be freed with a
single request. At task
termination, storage owned
by task is freed; some
storage (common, for
example) does not have an
owner.
IARV64 DISCARDDATA
service. CLEAR=YES must
be specified to guarantee the
storage is cleared to zeros
on the next usage.
Performing I/O
12-11
Table 12-1. Comparing Tasks and Concepts: Below the Bar and Above the Bar (continued)
Task or concept
Accessing storage
Virtual address
Number of pages
12-12
If you try to free a memory object that doesnt exist, the system abends your
program.
v Freeing a memory object that has I/O in progress.
If you specify the COND=YES parameter, you must also specify a user token. In
the recovery routine that gets control at an abend, you can ignore the abend and
leave the memory object in an unusable state.
As part of normal task termination, RTM frees the memory objects owned by the
terminating task.
12-13
+
+
+
+
+
The following example increases the size of the guard area by the specified
amount.
IARV64 REQUEST=CHANGEGUARD,
CONVERT=FROMGUARD,
MEMOBJSTART=VIRT64_ADDR,
CONVERTSIZE=SEGMENT_SIZE
+
+
+
12-14
CNOP 0,4
BRAS 12,@PDATA
DC
A(@DATA)
@PDATA LLGF 12,0(12)
USING @DATA,12
LHI 0,DYNAREAL
STORAGE OBTAIN,LENGTH=(0),SP=0,CALLRKY=YES
LLGTR 13,1
USING @DYNAREA,13
MVC 4(4,13),=CF6SA
* End entry linkage
*
SAM64
Change to amode64
IARV64 REQUEST=GETSTOR,
SEGMENTS=ONE_SEG,
USERTKN=USER_TOKEN,
ORIGIN=VIRT64_ADDR
LG
4,VIRT64_ADDR
Get address of memory obj
LHI 2,256
Set loop counter
LOOP
DS
0H
MVC 0(10,4),=CHI_MOM! Store HI MOM!
AHI 4,4096
BRCT 2,LOOP
* Get rid of all memory objects created with this
* user token
IARV64 REQUEST=DETACH,
MATCH=USERTOKEN,
USERTKN=USER_TOKEN,
COND=YES
*
* Begin exit linkage
LHI 0,DYNAREAL
LR
1,13
STORAGE RELEASE,LENGTH=(0),ADDR=(1),SP=0,CALLRKY=YES
PR
* End exit linkage
@DATA
DS
0D
ONE_SEG DC
FD1
USER_TOKEN DC FD1
LTORG
@DYNAREA DSECT
SAVEAREA DS
36F
VIRT64_ADDR DS AD
DYNAREAL EQU *-@DYNAREA
END DUNAJOB
+
+
+
+
+
+
12-15
12-16
Important
In this chapter, the notation CSRPxxx/CSRC4xxx is used to indicate either the
CSRPxxx service in AMODE 24 or 31, or the CSRC4xxx service in AMODE
64.
Callable cell pool services manage areas of virtual storage in the primary address
space, in data spaces and in address spaces other than the primary address space.
A cell pool is an area of virtual storage that is subdivided into fixed-sized areas of
storage called cells, where the cells are the size you specify. A cell pool contains:
v An anchor
v At least one extent
v Any number of cells, all having the same size.
The anchor is the starting point or foundation on which you build a cell pool. Each
cell pool has only one anchor. An extent contains information that helps callable
cell pool services manage cells and provides information you might request about
the cell pool. A cell pool can have up to 65,536 extents, each responsible for its
own cell storage. Your program determines the size of the cells and the cell
storage. Figure 13-1 on page 13-3 illustrates the three parts of a cell pool.
Through callable cell pool services, you build the cell pool. You can then obtain
cells from the pool. When there are no more cells available in a pool, you can use
callable cell pool services to enlarge the pool.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To use callable cell pool services, your program issues the CALL macro to invoke
one of the following services:
v Build a cell pool and initialize an anchor (CSRPBLD/CSRC4BLD service)
v Expand a cell pool by adding an extent (CSRPESP/CSRC4EXP service)
v Connect cell storage to an extent (CSRPCON/CSRC4CON service)
v Activate previously connected storage (CSRPACT/CSRC4ACT service)
v Deactivate an extent (CSRPDAC/CSRC4DAC service)
v Disconnect the cell storage for an extent (CSRPDIS/CSRC4DIS service)
v Allocate a cell from a cell pool (CSRPGET/CSRC4GET, CSRPGT1/CSRC4GT1,
or CSRPGT2/CSRC4GT2 and CSRPRGT/CSRC4RGT or
CSRPRGT1/CSRC4RG1 services)
v Return a cell to the cell pool (CSRPFRE/CSRC4FRE or CSRPFR1/CSRC4FR1,
or CSRPFR2/CSRC4FR2 and CSRPRFT/CSRC4RFR or
CSRPRFR1/CSRC4RF1 services)
v Query the cell pool (CSRPQPL/CSRC4QPL service)
v Query a cell pool extent (CSRPQEX/CSRC4QEX service)
v Query a cell (CSRPQCL/CSRC4QCL service).
|
|
|
|
|
|
|
Your systems AMODE will determine which set of services to use, as follows:
v When running AMODE 24 or AMODE 31, use the CSRPxxx services. Use the
CSRCPxxx interface definition file (IDF) for your language, and use CSRCPOOL
to linkedit.
v When running AMODE 64, use the CSRC4xxx services. Use the CSRC4xxx
interface definition file (IDF) for your language (note that only assembler and C
IDFs are provided), and use CSRC4POL to linkedit.
13-1
Use:
Is in AR mode
CPOOL.
In some ways, callable cell pool services require more work from the caller than
CPOOL does. For example, the services require the following actions that the
CPOOL macro does not require:
v Use the GETMAIN, STORAGE OBTAIN, or DSPSERV macro to obtain the
storage area for the cell pool.
v Provide the beginning addresses of the anchor, the extents, and cell storage
areas.
v Provide the size of each extent and the cell storage that the extent is responsible
for.
Storage Considerations
The virtual storage for the cell pool must reside in an address space or a data
space.
v The anchor and extents must reside within the same address space or data
space.
v The cells must reside within one address space or data space; that space can be
different from the one that contains the anchor and extents.
Figure 13-1 on page 13-3 illustrates the anchor and extents in Data/Address Space
A and the cell storage in Data/Address Space B.
Before you can obtain the first cell from a cell pool, you must plan the location of
the anchor, the extents, and the cell storage. You must obtain the storage for the
following areas and pass the following addresses to the services:
13-2
Anchor
Data/Address
Space A
Extent
1
Cell
Storage
Extent
2
Extent
3
Extent
4
Cell
Storage
Cell
Storage
Cell
Storage
Data/Address
Space B
When you plan the size of the cell storage, consider the total requirements of your
application for this storage and some performance factors. Although a single extent
may contain any number of cells (up to 2 bytes, or 16,777,216), you might wish
to have multiple extents for performance purposes. Avoid having a large number of
extents, where each extent is responsible for a small number of cells. In general, a
greater requirement for cells should mean a proportionately smaller number of
extents. The following two examples illustrate this point.
If you have 10,000 cells in the pool, a good extent size is 2,500 cells per extent.
If you have 100,000 cells in the pool, a good extent size is 10,000 cells per
extent.
13-3
Using Callable Cell Pool Services to Manage Data Space Areas on page 16-16
contains an example of using callable cell pool services with data spaces. It also
describes some storage considerations.
AMODE 24 or 31
//LINKJOB
//
//LINKSTP1
//
//SYSPRINT
//SYSLMOD
//SYSUT1
//SYSLIN
INCLUDE
INCLUDE
NAME
//OBJDD1
//OBJDD2
JOB accountinfo,name,CLASS=x,
MSGCLASS=x,NOTIFY=userid,MSGLEVEL=(1,1),REGION=4096K
EXEC PGM=HEWL,PARM=LIST,LET,XREF,REFR,RENT,NCAL,
SIZE=(1800K,128K)
DD
SYSOUT=x
DD
DSNAME=userid.LOADLIB,DISP=SHR
DD
UNIT=SYSDA,SPACE=(TRK,(5,2))
DD
*
OBJDD1(userpgm)
OBJDD2(CSRCPOOL)
userpgm(R)
DD
DSN=userid.OBJLIB,DISP=SHR
DD
DSN=SYS1.CSSLIB,DISP=SHR
AMODE 64
|
|
//LINKJOB
//
//LINKSTP1
//
//SYSPRINT
//SYSLMOD
//SYSUT1
//SYSLIN
INCLUDE
INCLUDE
NAME
//OBJDD1
//OBJDD2
JOB accountinfo,name,CLASS=x,
MSGCLASS=x,NOTIFY=userid,MSGLEVEL=(1,1),REGION=4096K
EXEC PGM=IEWBIND,PARM=LIST,LET,XREF,REFR,RENT,NCAL,
SIZE=(1800K,128K)
DD
SYSOUT=x
DD
DSNAME=userid.LOADLIB,DISP=SHR
DD
UNIT=SYSDA,SPACE=(TRK,(5,2))
DD
*
OBJDD1(userpgm)
OBJDD2(CSRC4POL)
userpgm(R)
DD
DSN=userid.OBJLIB,DISP=SHR
DD
DSN=SYS1.CSSLIB,DISP=SHR
13-4
CSRPEXP/CSRC4EXP service initializes an extent for the cell pool, connects the
cell storage area to the extent, and activates the cell storage for the extent.
Having activated the cell storage for an extent, you can now process GET requests
from the cells that the extent represents.
|
|
|
|
To contract a cell pool, deactivate its extents, and disconnect its storage, use
the CSRPDAC/CSRC4DAC and CSRPDIS/CSRC4DIS services.
CSRPDAC/CSRC4DAC deactivates an extent and prevents the processing of any
further GET requests from the storage that the extent represents. Cell FREE
requests are unaffected. (You can use the CSRPACT/CSRC4ACT service to
reactivate an inactive extent; reactivating undoes the effect of using
CSRPDAC/CSRC4DAC.)
CSRPDIS/CSRC4DIS disconnects the cell storage from an extent and makes cell
storage unavailable. After you disconnect an extent, you can free the cell storage
associated with the extent. Do not free the extent itself until you have finished using
the entire pool.
|
|
|
|
|
To allocate (that is, obtain) cells and deallocate (that is, free) previously
allocated cells, you have a choice of two forms of the same services. One service
form supports the standard CALL interface. The other supports a register interface
and is appropriate for programs that cannot obtain storage for a parameter list. The
two service functions are identical; however, the calling interface is different.
|
|
|
|
|
|
|
|
13-5
The CSRPQPL/CSRC4QPL service returns information about the entire cell pool. It
returns the following:
v Pool name
v Cell size
v Total number of cells in active extents
v Total number of available cells associated with active extents
v Number of extents in the cell pool.
AMODE 24 or 31
CSRCPASM
SAC 512
SYSSTATE ASCENV=AR
*
* Establish addressability to code.
*
LAE AR12,0
BASR R12,0
USING *,R12
*
* Get data space for the cell pool.
*
GETDSP DSPSERV CREATE,NAME=DSPCNAME,STOKEN=DSPCSTKN,
BLOCKS=DSPBLCKS,ORIGIN=DSPCORG
*
* Add the data space to callers access list.
13-6
*
X
*
*
GETALET
ALESERV ADD,STOKEN=DSPCSTKN,ALET=DSPCALET,AL=WORKUNIT
L
2,DSPCORG
ORIGIN OF SPACE IN GR2
ST
2,DSPCMARK
DSPCMARK IS MARK FOR DATA SPACE
*
* Copy ALET to ANCHALET for calls to cell pool services.
*
MVC ANCHALET(4),DSPCALET
*
* Set address and size of the anchor
*
L
R4,DSPCMARK
ST R4,ANCHADDR
A
R4,ANCHSIZE
ST R4,DSPCMARK
*
X
X
X
X
13-7
*
* Return to caller.
*
BR 14
*****************************************************************
* Constants and data areas used by cell pool services
*
*****************************************************************
*
CELLS_PER_EXTENT EQU 512
EXTENTS_PER_POOL EQU 10
CELLSIZE_EQU
EQU 256
CELLS_PER_POOL
EQU CELLS_PER_EXTENT*EXTENTS_PER_POOL
XTNTSIZE_EQU
EQU 128+(((CELLS_PER_EXTENT+63)/64)*8)
STORSIZE_EQU
EQU CELLS_PER_EXTENT*CELLSIZE_EQU
CELLS_IN_POOL
DC
A(CELLS_PER_POOL)
ANCHALET DS F
ANCHADDR DS F
CELLSIZE DC A(CELLSIZE_EQU)
USERNAME DC CL8MYCELLPL
ANCHSIZE DC F64
XTNTSIZE DC A(XTNTSIZE_EQU)
XTNTADDR DS F
CELLSTAD DS F
CELLSTLN DC A(STORSIZE_EQU)
CELLADDR DS F
EXTENT
DS F
STATUS
DS F
RTNCODE DS F
*
*****************************************************************
* Constant data and areas for data space
*
*****************************************************************
*
DS
0D
DSPCSTKN DS
CL8
DATA SPACE STOKEN
DSPCORG DS
F
DATA SPACE ORIGIN RETURNED
DSPCSIZE EQU STORSIZE_EQA*EXTENTS_PER_POOL 1.28MEG DATA SPACE
DSPBLCKS DC
A((DSPCSIZE+4095)/4096) BLOCKS FOR 10K DATA SPACE
DSPCALET DS
F
DSPCMARK DS
F
HIGH WATER MARK FOR DATA SPACE
DSPCNAME DC
CL8DATASPC1
DATA SPACE NAME
*
*****************************************************************
* Values returned by queries
*
*****************************************************************
*
QNAME
DS CL8
QCELLSZ
DS F
QNUMEXT
DS F
QEXTNUM
DS F
QEXSTAT
DS F
QXTNT_ADDR
DS F
QXTNT_LEN
DS F
QCELL_ADDR
DS F
QCELL_LEN
DS F
QTOT_CELLS
DS F
QAVAIL_CELLS DS F
QRTNCODE
DS F
RC
DS F
QCLADDR
DS F
QCLEXT
DS F
QCLAVL
DS F
13-8
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
AMODE 64
TEST
TEST
TEST
CSECT
AMODE 64
RMODE 31
BSM R14,0
Save callers AMODE indication
BAKR R14,0
Save regs on linkage stack
SAM64
Into AMODE 64
SYSSTATE AMODE64=YES
*
* Establish addressability to static data. We use relative
* branching to avoid needing addressability to the code
*
CNOP 0,4
BRAS R12,PAST1
DC A(STATIC_DATA)
PAST1
DS 0H
LLGT R12,0(R12,0)
USING STATIC_DATA,R12
*
* Get space for the cell pool in primary, above 2G
*
IARV64 REQUEST=GETSTOR,SEGMENTS=STORSEGS,ORIGIN=STORORIG
*
* Since the space is in primary, an ALET of 0 is needed
*
XC ANCHALET(4),ANCHALET
*
* Set address and size of the anchor
*
LG
R4,STORORIG
STG R4,ANCHADDR
*
* Call the build service
*
CALL CSRC4BLD,(ANCHALET,ANCHADDR,USERNAME,CELLSIZE,RTNCODE)
*
* Set address and size of the extent and connect extent to cells
*
LG
R4,STORORIG
AGF R4,ANCHSIZE
STG R4,XTNTADDR
AG
R4,XTNTSIZE Sets size of extent
STG R4,CELLSTAD
AG
R4,CELLSTLN Sets size of cell storage
CALL CSRC4EXP,(ANCHALET,ANCHADDR,XTNTADDR,XTNTSIZE,
X
CELLSTAD,CELLSTLN,EXTENT,RTNCODE)
*
* Get a cell. CELLADDR receives the address of the cell.
*
CALL CSRC4GET,(ANCHALET,ANCHADDR,CELLADDR,RTNCODE)
*
* The program uses the cells.
*
* Query the pool, the extent, and the cell. *
*
CALL CSRC4QPL,(ANCHALET,ANCHADDR,QNAME,QCELLSZ,QTOT_CELLS,
X
QAVAIL_CELLS,QNUMEXT,QRTNCODE)
CALL CSRC4QEX,(ANCHALET,ANCHADDR,EXTENT,QEXSTAT,QXTNT_ADDR, X
QXTNT_LEN,QCELL_ADDR,QCELL_LEN,QTOT_CELLS,
X
QAVAIL_CELLS,QRTNCODE)
CALL CSRC4QCL,(ANCHALET,ANCHADDR,CELLADDR,QCLAVL,QCLEXT,
X
QRTNCODE)
*
* Free the cell.
*
CALL CSRC4FRE,(ANCHALET,ANCHADDR,CELLADDR,RTNCODE)
Chapter 13. Callable Cell Pool Services
13-9
*
* Deactivate the extent.
*
CALL CSRC4DAC,(ANCHALET,ANCHADDR,EXTENT,RTNCODE)
*
* Disconnect the extent.
*
CALL CSRC4DIS,(ANCHALET,ANCHADDR,EXTENT,QCELL_ADDR,QCELL_LEN, X
QRTNCODE)
*
* Free the storage
*
IARV64 REQUEST=DETACH,MEMOBJSTART=STORORIG
*
* Return to caller.
*
PR
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
*****************************************************************
* Constants and data areas used by cell pool services *
*****************************************************************
*
STATIC_DATA DS 0D
*
CELLS_PER_EXTENT EQU 512
EXTENTS_PER_POOL EQU 10
CELLSIZE_EQU
EQU 256
CELLS_PER_POOL EQU CELLS_PER_EXTENT*EXTENTS_PER_POOL
XTNTSIZE_EQU
EQU CSRC4_EXTENT_BASE+(((CELLS_PER_EXTENT+63)/64)*8)
STORSIZE_EQU
EQU CELLS_PER_EXTENT*CELLSIZE_EQU
CELLS_IN_POOL DC AD(CELLS_PER_POOL)
ANCHADDR DS
AD
CELLSIZE DC
AD(CELLSIZE_EQU)
USERNAME DC
CL(CSRC4_POOL_NAME_LEN)MYCELLPL
ANCHALET DS
F
ANCHSIZE DC
A(CSRC4_ANCHOR_LENGTH)
XTNTSIZE DC
AD(XTNTSIZE_EQU)
XTNTADDR DS
AD
CELLSTAD DS
AD
CELLSTLN DC
AD(STORSIZE_EQU)
CELLADDR DS
AD
STATUS DS
D
EXTENT DS
F
RTNCODE DS
F
*
*****************************************************************
* Constant data and areas
*****************************************************************
*
DS
0D
STORORIG DS
AD
Storage Origin
STORSIZE EQU STORSIZE_EQU*EXTENTS_PER_POOL
STORSEGS DC
AD((STORSIZE+1024*1024-1)/(1024*1024)) 1M Segments needed
*
*****************************************************************
* VALUES RETURNED BY QUERIES
*****************************************************************
*
QNAME
DS
CL(CSRC4_POOL_NAME_LEN)
QCELLSZ DS
D
QNUMEXT DS
D
QEXSTAT DS
D
QXTNT_ADDR DS D
QXTNT_LEN DS D
QCELL_ADDR DS D
QCELL_LEN DS D
QTOT_CELLS DS D
13-10
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QAVAIL_CELLS DS D
QCLADDR DS
D
QCLAVL DS
D
QCLEXT DS
F
QRTNCODE DS F
*****************************************************************
* Registers
*****************************************************************
R4
EQU 4
R12
EQU 12
R14
EQU 14
*****************************************************************
* Declares for CSRC4xxx services
*****************************************************************
CSRC4ASM
Assembler declares for AMODE 64
END TEST
13-11
13-12
14-1
14-2
/*
For further information on creating linear VSAM data sets and altering
entry-sequenced VSAM data sets, see z/OS DFSMS Access Method Services for
Catalogs.
Identify
An application must use IDENTIFY to tell the system which data-in-virtual object it
wants to process. IDENTIFY generates a unique ID, or token, that uniquely
represents an applications request to use the given data object. The system returns
this ID to the application. When the application requests other kinds of services with
Chapter 14. Data-in-Virtual
14-3
the DIV macro, the application supplies this ID to the system as an input parameter.
Specify DDNAME for a linear data set object and STOKEN for a hiperspace object.
Access
To gain the right to view or update the object, an application must use the ACCESS
service. You normally invoke ACCESS after you invoke IDENTIFY and before you
invoke MAP. ACCESS is similar to the OPEN macro of VSAM. It has a mode
parameter of READ or UPDATE, and it gives your application the right to read or
update the object.
If the object is a data set and if the SHAREOPTIONS parameter used to allocate
the linear data set implies serialization, the system automatically serializes your
access to the object. If access is not automatically serialized, you can serialize
access to the object by using the ENQ, DEQ, and the RESERVE macros. If you do
not serialize access to the object, you should consider using the LOCVIEW
parameter to protect your window data against the unexpected changes that can
occur when access to the object is not serialized. LOCVIEW is described on page
14-8.
If the object is a hiperspace, DIV ensures that only one program can write to the
object and that multiple users can only read the object. Only the task that owns the
corresponding ID can issue ACCESS.
Map
The data object is stored in units of 4096-byte blocks. An application uses the MAP
service to specify the part of the object that is to be processed in virtual storage. It
can specify the entire object (all of the blocks), or a part of the object (any
continuous range of blocks). Because parts of the same object can be viewed
simultaneously through several different windows, the application can set up
separate windows on the same object. However, a specific page of virtual storage
cannot be in more than one window at a time.
After ACCESS, the application obtains a virtual storage area large enough to
contain the window. The size of the object, which ACCESS optionally returns, can
determine how much virtual storage you need to request. After requesting virtual
storage, the application invokes MAP. MAP establishes a one to one
correspondence between blocks in the object and pages in virtual storage. A
continuous range of pages corresponds to a continuous range of blocks. This
correspondence is called a virtual storage window, or a window.
After MAP, the application can look into the virtual storage area that the window
contains. When it looks into this virtual storage area, it sees the same data that is in
the object. When the application references this virtual storage area, it is
referencing the data from the object. To reference the area in the window, the
application simply uses any conventional processor instructions that access storage.
Although the object data becomes available in the window when the application
invokes MAP, no actual movement of data from the object into the window occurs at
that time. Actual movement of data from the object to the window occurs only when
the application refers to data in the window. When the application references a
page in the window for the first time, a page fault occurs. When the page fault
occurs, the system reads the permanent storage block into central storage.
When the system brings data into central storage, the data movement involves only
the precise block that the application references. The system updates the contents
14-4
of the corresponding page in the window with the contents of the linear data set
object. Thus, the system brings in only the blocks that an application references into
central storage. The sole exception to the system bringing in only the referenced
blocks occurs when the application specifies LOCVIEW=MAP with the ACCESS
service for a data set object.
Notes:
1. If the application specifies LOCVIEW=MAP with ACCESS, the entire window is
immediately filled with object data when the application invokes MAP.
2. If, when an application invokes MAP, it would rather keep in the window the
data that existed before the window was established (instead of having the
object data appear in the window), it can specify RETAIN=YES. Specifying
RETAIN=YES is useful when creating an object or overlaying the contents of an
object.
3. An important concept for data-in-virtual is the concept of freshly obtained
storage. When virtual storage has been obtained and not subsequently
modified, the storage is considered to be freshly-obtained. The storage is also
in this state when it has been obtained as a data space by using a DSPSERV
CREATE and not subsequently modified. After a DSPSERV RELEASE, the
storage is still considered freshly obtained until it has been modified. When
referring to this storage or any of its included pages, this book uses freshly
obtained storage and freshly obtained pages. If a program stores into a
freshly obtained page, only that page loses its freshly obtained-status, while
other pages still retain it.
4. You can map virtual storage pages that are protected only when you specify
RETAIN=YES. When the system establishes the virtual window, you can use the
PGSER PROTECT macro to protect the data in the window. However, you must
ensure that the data in the window is not protected when you issue the RESET
form of the DIV macro.
14-5
data from the object. RESET reloads only the blocks that have been changed
unless you specify or have specified RELEASE=YES.
Unmap
When the application is finished processing the part of the object that is in the
window, it eliminates the window by using UNMAP. To process a different part of the
object, one not already mapped, the application can use the MAP service again.
The SAVE, RESET, MAP, and UNMAP services can be invoked repeatedly as
required by the processing requirements of the application.
If you issued multiple MAPs to different STOKENs, use STOKEN with UNMAP to
identify the data space or hiperspace you want to unmap.
Note: If you do not want to retain the data in the virtual window, use the PGSER
UNPROTECT macro to unprotect any protected pages in the window,
before you use the UNMAP service.
If you issue UNMAP with RETAIN=NO and there are protected pages in the
virtual storage window, the system loses the data in the protected pages and
preserves the protection status. If you try to reference the protected pages,
the system issues abend X'028'. To access the protected pages again,
remove the protection status. Then issue the PGSER RELEASE or
DSPSERV RELEASE macro to release all physical paging resources.
Unaccess
If the application has temporarily finished processing the object but still has other
processing to perform, it uses UNACCESS to relinquish access to the object. Then
other programs can access the object. If the application needs to access the same
object again, it can regain access to the object by using the ACCESS service again
without having to use the IDENTIFY service again.
Unidentify
UNIDENTIFY ends the use of a data-in-virtual object under a previously assigned
ID that the IDENTIFY service returned.
Hiperspace object:
DIV IDENTIFY,ID=DIVOBJID,TYPE=HS,STOKEN=HSSTOK
ID: The ID parameter specifies the address where the IDENTIFY service returns a
unique eight-byte name that connects a particular user with a particular object. This
name is an output value from IDENTIFY, and it is also a required input value to all
other services.
14-6
TYPE: The TYPE parameter indicates the type of data-in-virtual object, either a
linear data set (TYPE=DA) or a hiperspace (TYPE=HS).
DDNAME: When you specify TYPE=DA for a data set object, you must specify
DDNAME to identify your data-in-virtual object. If you specify TYPE=HS with
IDENTIFY, do not specify DDNAME. (Specify STOKEN instead.)
STOKEN: When you specify TYPE=HS for a hiperspace object, you must specify
STOKEN to identify that hiperspace. The STOKEN must be addressable in your
primary address space. The hiperspace must be a non-shared standard hiperspace
and must be owned by the task issuing the IDENTIFY. The system does not verify
the STOKEN until your application uses the associated ID to access the object.
ID: When you issue a DIV macro that requests the ACCESS service, you must also
specify, on the ID parameter, the identifier that the IDENTIFY service returned. The
ID parameter tells the system what object you want access to. When you request
permission to access the object under a specified ID, the system checks the
following conditions before it grants the access:
v You previously established the ID specified with your ACCESS request by
invoking IDENTIFY.
v You have not already accessed the object under the same unique eight-byte ID.
Before you can reaccess an already-accessed object under the same ID, you
must first invoke UNACCESS for that ID.
v If your installation uses RACF and the object is a linear data set, you must have
the proper RACF authorization to access the object.
v If you are requesting read access, the object must not be empty. Use the MODE
parameter to request read or update access.
v If the data object is a hiperspace, the system rejects the request if the
hiperspace:
Has ever been the target of an ALESERV ADD
Has one or more readers and one updater. (That is, the hiperspace can have
readers and it can have one updater, but it cant have both.)
MODE: The MODE parameter specifies how your program will access the object.
You can specify a mode parameter of READ or UPDATE. They are described as
follows:
14-7
v READ lets you read the object, but prevents you from using SAVE, to change the
object.
v UPDATE, like READ, lets you read the object, but it also allows you update the
object with SAVE.
Whether you specify READ or UPDATE, you can still make changes in the window,
because the object does not change when you change the data in the window.
SIZE: The SIZE parameter specifies the address of the field where the system
stores the size of the object. The system returns the size in this field whenever you
specify SAVE or ACCESS with SIZE. If you omit SIZE or specify SIZE=*, the
system does not return the size.
If you specified TYPE=DA with IDENTIFY for a data set object, SIZE specifies the
address of a four-byte field. When control is returned to your program after the
ACCESS service executes, the four-byte field contains the current size of the
object. The size is the number of blocks that the application must map to ensure
the mapping of the entire object.
If you specified TYPE=HS with IDENTIFY for a hiperspace object, ACCESS returns
two sizes. The first is the current size of the hiperspace (in blocks). The second is
the maximum size of the hiperspace (also in blocks). When specifying SIZE with an
ID associated with a hiperspace object, you must provide an eight-byte field in
which the system can return the sizes (4 bytes each).
LOCVIEW: The LOCVIEW parameter allows you to specify whether the system is
to create a local copy of the data-in-virtual object.
If your object is a hiperspace, you cannot specify LOCVIEW=MAP.
If your object is a data set, you can code the LOCVIEW parameter two ways:
v LOCVIEW=MAP
v LOCVIEW=NONE (the default if you do not specify LOCVIEW)
If another program maps the same block of a data-in-virtual object as your program
has mapped, a change in the object due to a SAVE by the other program can
sometimes appear in the virtual storage window of your program. The change can
appear when you allocate the data set object with a SHAREOPTIONS(2,3),
SHAREOPTIONS(3,3), or SHAREOPTIONS(4,3) parameter, and when the other
program is updating the object while your program is accessing it.
If the change appears when your program is processing the data in the window,
processing results might be erroneous because the window data at the beginning of
your processing is inconsistent with the window data at the end of your processing.
The relationship between SHAREOPTIONS and LOCVIEW is as follows:
v When you allocate the data set object by SHAREOPTIONS(2,3),
SHAREOPTIONS(3,3), or SHAREOPTIONS(4,3), the system does not serialize
the accesses that programs make to the object. Under these options, if the
programs do not observe any serialization protocol, the data in your virtual
storage window can change when other programs invoke SAVE. To ensure that
your program has a consistent view of the object, and protect your window from
changes that other programs make on the object, use LOCVIEW=MAP. If you do
not use LOCVIEW=MAP when you invoke ACCESS, the system provides a
return code of 4 and a reason code of hexadecimal 37 as a reminder that no
serialization is in effect even though the access was successful.
14-8
14-9
Permanent Object
Address Space
OR
Temporary Object
Address Space
Hiperspace
window
If your window is in a data space or a hiperspace, you can map only a linear data
set. See Figure 14-2.
Permanent Object
Data Space
or Hiperspace
If your window is in a data space or hiperspace, you can issue multiple MAPs under
the same ID to different data spaces or hiperspaces. You cannot mix data space
maps or hiperspace maps with address space maps under the same ID at any one
time. However, you can mix data space maps and hiperspace maps. See
Figure 14-3 on page 14-12.
The MAP service has two required parameters: ID and OFFSET, and five optional
parameters: SPAN, AREA, RETAIN, STOKEN, and PFCOUNT.
The following examples show two ways to code the MAP service.
14-10
DIV MAP,ID=DIVOBJID,AREA=MAPPTR1,SPAN=SPANVAL,OFFSET=*,PFCOUNT=7
ID: The ID parameter specifies the storage location containing the unique eight-byte
value that was returned by IDENTIFY. The map service uses this value to determine
which object is being mapped under which request.
If you specify the same ID on multiple invocations of the MAP service, you can
create simultaneous windows corresponding to different parts of the object.
However, an object block that is mapped into one window cannot be mapped into
any other window created under the same ID. If you use different IDs, however, an
object block can be included simultaneously in several windows.
OFFSET and SPAN: The OFFSET and SPAN parameters indicate a range of
blocks on the object. Blocks in this range appear in the window. OFFSET indicates
the first object block in the range, while SPAN indicates how many contiguous
blocks make up the range. An offset of zero indicates the beginning of the object.
For example, an offset of zero and a span of ten causes the block at the beginning
of the object to appear in the window, together with the next nine object blocks. The
window would then be ten pages long.
14-11
Data Space
or Hiperspace
window
Permanent Object
Data Space
or Hiperspace
Linear Data Set
window
Data Space
or Hiperspace
window
14-12
record. Therefore, when a DIV object is created without extents, the largest
possible span value is the total number of blocks contained in the DIV object
minus one.
AREA: When you specify MAP, you must also specify an AREA parameter. AREA
indicates the beginning of a virtual storage space large enough to contain the entire
window. Before invoking MAP, you must ensure that your task owns this virtual
storage space. The storage must belong to a single, pageable private area subpool.
It must begin on a 4096-byte boundary (that is, a page boundary) and have a
length that is a multiple of 4096 bytes.
Note that any virtual storage space assigned to one window cannot be
simultaneously assigned to another window. If your MAP request specifies a virtual
storage location, via the AREA parameter, that is part of another window, the
system rejects the request.
You cannot free virtual storage that is mapped into a window as long as the map
exists. Attempts to do this will cause your program to abend. Subsequent attempts
to reference the mapped virtual space will cause an ABEND.
RETAIN: The RETAIN parameter determines what data you can view in the window.
It can be either the contents of the virtual storage area (that corresponds to the
window) the way it was before you invoked MAP, or it can be the contents of the
object. The following table shows how using the RETAIN parameter with MAP
affects the contents of the window.
RETAIN=
Window view
NO (default)
YES
If you specify RETAIN=NO, or do not specify the RETAIN parameter at all (which
defaults to RETAIN=NO), the contents of the object replace the contents of the
virtual storage whenever your program references a page in the window. Virtual
storage that corresponds to a range beyond the end of the object appears as binary
zeroes when referenced. You can use RETAIN=NO to change some data and save
it back to the object.
If you specify RETAIN=YES, the window retains the contents of virtual storage. The
contents of the window are not replaced by data from the object. If you issue a
subsequent SAVE, the data in the window replaces the data on the object. If the
window extends beyond the object and your program has not referenced the pages
in the extending part of the window, the system does not save the extending pages.
However, if your program has referenced the extending pages, the system does
save them on the object, extending the object so it can hold the additional data.
You can also use RETAIN=YES to reduce the size of (truncate) the object. If the
part you want to truncate is mapped with RETAIN=YES and the window consists of
freshly obtained storage, the data object size is reduced at SAVE time.
If you want to have zeroes written at the end of the object, the corresponding virtual
storage must be explicitly set to zero prior to the SAVE.
STOKEN: To reference an entire linear data set through a single window, a program
might require a considerable amount of virtual storage. In this case, the program
can use a data space or hiperspace to contain the window. If you want the virtual
Chapter 14. Data-in-Virtual
14-13
PFCOUNT: PFCOUNT is useful for referencing sequential data. Because you get a
page fault the first time you reference each page, preloading successive pages
decreases the number of page faults.
The PFCOUNT parameter (nnn) is an unsigned decimal number up to 255. When
an application references a mapped object, PFCOUNT tells the system that the
program will be referencing this object in a sequential manner. PFCOUNT might
improve performance because it asks the system to preload nnn pages, if possible.
The system reads in nnn successive pages only to the end of the virtual range of
the mapped area containing the originally referenced page, and only as resources
are available.
You can use REFPAT INSTALL to define a reference pattern for the mapped area.
In response to REFPAT, the system brings multiple pages into central storage when
referenced. In this case, the PFCOUNT value you specify on DIV is not in effect as
long as the reference pattern is in effect. When REFPAT REMOVE removes the
definition of the reference pattern, the PFCOUNT you specify on DIV is again in
effect. For information on the REFPAT macro, see Defining the Reference Pattern
(REFPAT) on page 19-5.
14-14
beyond the object area are not also being saved. In either case, the new object size
is returned to your program if you specify the SIZE parameter.
When the system writes the pages from the window to the object, it clears (sets to
zeroes) blocks in the object that are mapped to freshly obtained pages in the
window if either one of the following conditions is true:
v There are subsequent pages in the range being saved that are not freshly
obtained
v The blocks mapped to the freshly obtained pages are not at the end of the
object. That is, they are imbedded in the object somewhere before the last block
of the object. If the blocks mapped to freshly obtained pages do extend to the
end of the object and no subsequent non-freshly obtained pages are being
saved, then the object is truncated by that number of blocks.
If you specified RETAIN=YES with MAP, SAVE treats pages in the window that you
have not previously saved as changed pages and will write them to the object.
Notes:
1. Do not specify SAVE for a storage range that contains DREF or page fixed
storage.
2. If data to be saved has not changed since the last SAVE, no I/O will be
performed. The performance advantages of using data-in-virtual are primarily
because of the automatic elimination of unnecessary read and write I/O
operations.
3. The range specified with SAVE can extend beyond the end of the object.
4. The system does not save pages of an object that is not mapped to any
window.
5. The system does not save pages in a window that lies outside the specified
range.
The following example shows how to code the SAVE service for a hiperspace or
data set object.
DIV SAVE,ID=DIVOBJID,SPAN=SPAVAL,OFFSET=*,SIZE=OBJSIZE
ID: The ID parameter tells the SAVE service which data object the system is writing
to under which request. Use ID to specify the storage location containing the unique
eight-byte name that was returned by IDENTIFY. You must have previously
accessed the object with MODE=UPDATE under the same ID as the one specified
for SAVE.
OFFSET and SPAN: Use the OFFSET and SPAN parameters to select a
continuous range of object blocks within which the SAVE service can operate.
OFFSET indicates the first block and SPAN indicates the number of blocks in the
range. As in the MAP service, the offset and span parameters refer to object blocks;
they do not refer to pages in the window. You cannot specify OFFSET and SPAN
when you specify LISTADDR and LISTSIZE.
Specifying OFFSET=* or omitting OFFSET causes the system to use the default
offset (zero). The zero offset does not omit or skip over any of the object blocks,
and it causes the range to start right at the beginning of the object. Specifying
SPAN=0, SPAN=*, or omitting SPAN gives you the default span. The default span
includes the first object block after the part skipped by the offset, and it includes the
entire succession of object blocks up to and including the object block that
corresponds to the last page of the last window.
Chapter 14. Data-in-Virtual
14-15
When SAVE executes, it examines each virtual storage window established for the
object. In each window, it detects every page that corresponds to an object block in
the selected range. Then, if the page has changed since the last SAVE, the system
writes the page on the object. (If the page has not changed since the last SAVE, it
is already identical to the corresponding object block and there is no need to save
it.) Although SAVE discriminates between blocks on the basis of whether they have
changed, it has the effect of saving all window pages that lie in the selected range.
Specifying both OFFSET=* and SPAN=* or omitting both causes the system to save
all changed pages in the window without exceptions.
To use the OFFSET parameter, specify the storage location containing the block
offset of the first block to be saved. The offset of the first block in the object is zero.
To use the SPAN parameter, specify the storage location containing the number of
blocks in the range to be saved.
SIZE: When you specify SIZE after the SAVE completes, the system returns the
size of the data object in the virtual storage location specified by the SIZE
parameter. If you omit SIZE or specify SIZE=*, the system does not return the size
value. If TYPE=DA, invoking SAVE can change the size of the object. If TYPE=HS,
invoking SAVE has no effect on the size of the object.
LISTADDR: The LISTADDR parameter specifies the address of the first entry in the
user list. Use this parameter and the LISTSIZE parameter when you specify a user
list as input for SAVE.
LISTSIZE: The LISTSIZE parameter specifies the number of entries in the user list.
Use this parameter and the LISTADDR parameter when you specify a user list as
input for SAVE.
STOKEN: If you specify a user list as input for SAVE and a data space or
hiperspace contains the window, you must specify STOKEN when you invoke
SAVE. When you specify STOKEN, you provide an eight-byte input parameter that
identifies the data space or hiperspace, and that was returned from DSPSERV
CREATE.
14-16
ID: Use ID to specify the storage location containing the unique eight-byte name
that was returned by IDENTIFY, which connects a particular user with a particular
object.
LISTADDR: The LISTADDR parameter specifies the address of the first entry in the
user list.
LISTSIZE: The LISTSIZE parameter specifies the number of entries in the list. The
size of the list must be a minimum of three entries and a maximum of 255 entries.
The SAVELIST service can place addresses in all but the last two entries, which the
macro uses as a work area.
RESET results
NO (default)
The data in the window matches the object data as of the last
SAVE.
YES
Unless saved, the data in the window become freshly obtained. Any
pages previously saved re-appear in their corresponding window. All
other pages appear freshly obtained.
14-17
The following example shows how to code the RESET service for a hiperspace or
data set object:
DIV RESET,ID=DIVOBJID,SPAN=SPANVAL,OFFSET=*,RELEASE=YES
ID: The ID parameter tells the RESET service what data object is being written to.
Use ID to specify the storage location containing the unique eight-byte name that
was returned by IDENTIFY and used with previous MAP requests. You must have
previously accessed the object (with either MODE=READ or MODE=UPDATE)
under the same ID as the one currently specified for RESET.
OFFSET and SPAN: The OFFSET and SPAN parameters indicate the RESET
range, the part of the object that is to supply the data for the RESET. As with MAP
and SAVE, OFFSET indicates the first object block in the range, while SPAN
indicates how many contiguous blocks make up the range, starting from the block
indicated by OFFSET. The first block of the object has an offset of zero.
To use OFFSET, specify the storage location containing the block offset of the first
block to be reset. To use SPAN, specify the storage location containing the number
of blocks in the range to be RESET. Specifying OFFSET=* or omitting OFFSET
causes the system to use a default OFFSET of zero. Specifying SPAN=* or omitting
SPAN sets the default to the number of blocks needed to reset all the virtual
storage windows that are mapped under the specified ID starting only with the block
number indicated by OFFSET. Specifying both OFFSET=* and SPAN=* or omitting
both resets all windows that are currently mapped under the specified ID.
RELEASE: RELEASE=YES tells the system to release all pages in the reset range.
RELEASE=NO does not replace unchanged pages in the window with a new copy
of pages from the object. It replaces only changed pages. Another ID might have
changed the object itself while you viewed data in the window. Specify
RELEASE=YES to reset all pages. Any subsequent reference to these pages
causes the system to load a new copy of the data page from the object.
ID: The ID parameter you specify is the address of an eight-byte field in storage.
That field contains the identifier associated with the object. The identifier is the
same value that the IDENTIFY service returned, which is also the same value you
specified when you issued the corresponding MAP request.
14-18
AREA: The AREA parameter specifies the address of a four-byte field in storage
that contains a pointer to the start of the virtual storage to be unmapped. This
address must point to the beginning of a window. It is the same address that you
provided when you issued the corresponding MAP request.
RETAIN: RETAIN specifies the state that virtual storage is to be left in after it is
unmapped, that is, after you remove the correspondence between virtual storage
and the object.
Specifying RETAIN=NO with UNMAP indicates that the data in the unmapped
window is to be freshly obtained.
If your object is a hiperspace, you cannot specify RETAIN=YES. If your object is a
data set, you can specify RETAIN=YES.
Specifying RETAIN=YES on the corresponding UNMAP transfers the data of the
object into the unchanged pages in the window. In this case, RETAIN=YES with
UNMAP specifies that the virtual storage area corresponding to the unmapped
window is to contain the last view of the object. After UNMAP, your program can still
reference and change the data in this virtual storage but can no longer save it on
the object unless the virtual area is mapped again.
Notes:
1. If you issue UNMAP with RETAIN=NO, and there are unsaved changes in the
virtual storage window, those changes are lost.
2. If you issue UNMAP with RETAIN=YES, and there are unsaved changes in the
window, they remain in the virtual storage.
3. Unmapping with RETAIN=YES has certain performance implications. It causes
the system to read unreferenced pages, and maybe some unchanged ones,
from the object. You must not unmap with RETAIN=YES if your object is a
hiperspace.
4. If the window is in a deleted data space, UNMAP works differently depending on
whether you specify RETAIN=YES or RETAIN=NO. If you specify RETAIN=YES,
the unmap fails and the program abends. Otherwise, the unmap is successful.
STOKEN: If you issued multiple maps under the same ID with different STOKENs,
use STOKEN with UNMAP. If you do not specify STOKEN in this case, the system
will scan the mapped ranges and unmap the first range that matches the specified
virtual area regardless of the data space it is in. Issuing UNACCESS or
UNIDENTIFY automatically unmaps all mapped ranges.
14-19
only parameter for UNIDENTIFY, and it must designate the same ID as the one
specified in the corresponding ACCESS. As in the other services, use ID to specify
the storage location containing the unique eight-byte name that was returned by
IDENTIFY.
The following example shows how to code the UNACCESS and UNIDENTIFY
services for a hiperspace or data set object:
DIV UNACCESS,ID=DIVOBJID
DIV UNIDENTIFY,ID=DIVOBJID
14-20
2. If the object contains any data (the size returned by ACCESS is non-zero), the
program issues a DIV MAP to associate the object with storage the program
acquires using GETMAIN. The size of the MAP (and the acquired storage area)
is the same as the size of the object.
3. The program now processes the input statements from SYSIN. The processing
depends upon the function requests (S, D, or E). If the program encounters an
end-of-file, it treats it as if an E function was requested.
S function Set a character in the object
4. If the byte to change is past the end of the mapped area, the user asked to
increase the size of the object. Therefore:
a. If any changes have been made in the mapped virtual storage area but not
saved to the object, the program issues a DIV SAVE. This save writes the
changed 4K pages in the mapped storage to the object.
b. The program issues a DIV UNMAP for the storage area acquired with
GETMAIN, and then releases that area using FREEMAIN. The program
skips this is step if the current object size is 0.
c. The program acquires storage using GETMAIN to hold the increased size of
the object, and issues a DIV MAP for this storage.
5. The program changes the associated byte in the mapped storage. Note that this
does not change the object. The program actually writes the changes to the
object when you issue a DIV SAVE.
D function Display a character in the object
6. If the requested location is within the MAP size, the program references the
specified offset into the storage area. If the data is not already in storage, a
page fault occurs. Data-in-virtual processing brings the required 4K block from
the object into storage. Then the storage reference is re-executed. The contents
of the virtual storage area (i.e. the contents of the object) are displayed.
E function End the program
7. If the program has made any changes in the mapped virtual storage area but
has not saved them to the object, the program issues a DIV SAVE.
8. The program issues a DIV UNIDENTIFY to terminate usage of the object. Note
that data-in-virtual processing internally generates a DIV UNMAP and
DIV UNACCESS.
9. The program terminates.
14-21
DIV
TITLE Data-in-Virtual Sample Program
DIVSAMP CSECT ,
DIVSAMP AMODE 31
Program runs in 31-bit mode
DIVSAMP RMODE 24
Program resides in 24-bit storage
SAVE (14,12),,DIVSAMP -- Sample Program
LR
R11,R15
Establish base register
USING DIVSAMP,R11
*
LA
R2,VSVEAREA
Chain save areas together
ST
R13,4(,R2)
*
ST
R2,8(,R13)
*
LR
R13,R2
*
* IDENTIFY and ACCESS the object pointed to by DD DIVDD.
* Save the objects token in VTOKEN, and its size in VSIZEP.
DIV IDENTIFY,TYPE=DA,ID=VTOKEN,DDNAME=CDIVDD Specify DDNAME
LA
R2,1
Error code
LTR R15,R15
IDENTIFY work ok ?
BNZ LERROR
* No -- quit
DIV ACCESS,ID=VTOKEN,MODE=UPDATE,SIZE=VSIZEP Open the object
LA
R2,2
Error code
LTR R15,R15
ACCESS work ok ?
BNZ LERROR
* No -- quit
* If object not empty (VSIZEP > 0), get workarea to hold the object,
* and issue a MAP to it. The area must start on page boundary.
* Referencing byte "n" of this workarea gets byte "n" of the object.
L
R2,VSIZEP
Current size (in 4K blocks)
SLA R2,12
Current size (in bytes)
ST
R2,VSIZEB
VSIZEB = object size in bytes
BZ
LEMPTY
If object not empty, get MAP area =
GETMAIN RU,LV=(R2),LOC=(ANY,ANY),BNDRY=PAGE object size
ST
R1,VAREAPTR
Save MAP area
DIV MAP,ID=VTOKEN,AREA=VAREAPTR,SPAN=VSIZEP
LA
R2,3
Error code
LTR R15,R15
MAP work ok ?
BNZ LERROR
* No -- quit
LEMPTY EQU *
Mapped, unless empty
* OPEN the SYSIN input data set, and SYSPRINT listing data set.
* Must be in 24-bit mode for this. Then return to 31-bit mode.
LA
R4,L31B01
Return to L31B01 in 31-bit mode
LA
R1,L24B01
Go to L24B01 in 24-bit mode
BSM R4,R1
R4 = A(X80000000+L31B01)
L24B01 OPEN (VSYSIN,(INPUT),VSYSPRT,(OUTPUT)) OPEN SYSIN/SYSPRINT
BSM 0,R4
Return to 31-bit mode at next instr
L31B01 LA
R2,4
Error code from SYSIN OPEN
LTR R15,R15
OPEN ok ?
BNZ LERROR
* No -- quit
14-22
*
* Loop reading from SYSIN. Process the statements.
* Treat EOF as if the user specified "E" as the function to perform.
*
LREAD
EQU *
Read first/next card
MVI VCARDF,CE
EOF will appear as "E" function
LA
R4,L31B02
Return to L31B02 in 31-bit mode
LA
R1,L24B02
Go to L24B02 in 24-bit mode
BSM R4,R1
R4 = A(X80000000+L31B02)
L24B02 GET VSYSIN,VCARD
Get the next input request.
LEOF
EQU *
End-of-file branches here
BSM 0,R4
Return to 31-bit mode at next instr
L31B02 EQU *
Get here in 31-bit mode
*
* Process request:
* E
- End processing
* S aaaaaaaa v
- Set location Xaaaaaaaa to v
* D aaaaaaaa
- Display location Xaaaaaaaa
*
CLI VCARDF,CE
EOF function or EOF on data set ?
BE
LCLOSE
* Yes -- go cleanup and terminate
TRT VCARDA,CTABTRT
Ensure A-F, 0-9
BNZ LINVADDV
* If not, is error
MVC VTEMP8,VCARDA
Save address
TR
VTEMP8,CTABTR
Convert to X0A-X0F, X00-X09
PACK VCHGADDR(5),VTEMP8(9) Make address
L
R1,VCHGADDR
Address
LA
R1,0(,R1)
Clear hi-bit
ST
R1,VCHGADDR
Save address to change/display
CLI VCARDF,CD
Display requested ?
BE
LDISP
* Yes -- go process
CLI VCARDF,CS
Set requested ?
BNE LINVFUNC
* No -- is invalid statement
14-23
* SET: See if the location to change is within the range of the current
* MAP. If not, save any changes, get a larger area and issue a new MAP.
C
R1,VSIZEB
Area to change within current MAP?
BL
LGUPDCHR
* Yes -- continue
C
R1,CSIZEMX
Area to change within max allowed?
BNL LINVADDR
* No -- is error
CLI VSWUPDT,0
Any updates to current MAP ?
BE
LNOSVE1
* Yes -- then
DIV SAVE,ID=VTOKEN
Save any changes
LA
R2,5
Error code from SAVE
LTR R15,R15
SAVE ok ?
BNZ LERROR
* No -- quit
MVI VSWUPDT,0
Clear update flag
LNOSVE1 L
R3,VSIZEB
Eliminate old map and storage
LTR R3,R3
Any to free ?
BZ
LNOFREE
* Yes -- then
DIV UNMAP,ID=VTOKEN,AREA=VAREAPTR Release the MAP
LA
R2,6
Error code from UNMAP
LTR R15,R15
UNMAP ok ?
BNZ LERROR
* No -- quit
L
R1,VAREAPTR
R1 -> acquired storage
FREEMAIN RU,A=(1),LV=(R3) Free the storage
LNOFREE L
R2,VCHGADDR
Address of byte to change
SRL R2,12
R2 = page number - 1
LA
R2,1(,R2)
R2 = page number to use
ST
R2,VSIZEP
VSIZEP = MAP area in 4K units
SLL R2,12
R2 = size in bytes
ST
R2,VSIZEB
VSIZEB = MAP area in bytes
GETMAIN RU,LV=(R2),LOC=(ANY,ANY),BNDRY=PAGE get MAP area
ST
R1,VAREAPTR
Save MAP area
DIV MAP,ID=VTOKEN,AREA=VAREAPTR,SPAN=VSIZEP
LA
R2,3
Error code
LTR R15,R15
MAP work ok ?
BNZ LERROR
* No -- quit
LGUPDCHR L
R1,VCHGADDR
R1 = byte to change
A
R1,VAREAPTR
R1 -> byte to change
MVC 0(1,R1),VCARDV
Change the byte
MVI VSWUPDT,XFF
Show change made
B
LGOODINP
Go print accept message
LDISP
EQU *
Display location contents
L
R1,VCHGADDR
R1 = location to display
C
R1,VSIZEB
Ensure within current MAP
BNL LINVADDR
* If not, is error
A
R1,VAREAPTR
R1 -> location to display
MVC VCARDV,0(R1)
Put into the card
14-24
LGOODINP EQU *
MVC M1A,VCARDA
Address changed/displayed
MVC M1B,VCARDV
Storage value
CLI M1B,X00
If X00 (untouched),
BNE LGOODIN1
* change to "?".
MVI M1B,C?
*
LGOODIN1 LA
R2,M1
R2 -> message to print
B
LTELL
Go tell user status
LINVFUNC LA
R2,M2
Unknown function
B
LTELL
Go tell user status
LINVADDV LA
R2,M3
Invalid address
B
LTELL
Go tell user status
LINVADDR LA
R2,M4
Address out of range
LTELL
EQU *
R2 -> message to print
LA
R4,L31B03
Return to L31B03 in 31-bit mode
LA
R1,L24B03
Go to L24B03 in 24-bit mode
BSM R4,R1
R4 = A(X80000000+L31B03)
L24B03 PUT VSYSPRT,(R2)
Print the message
BSM 0,R4
Return to 31-bit mode at next instr
L31B03 B
LREAD
Continue
* End-of-file on SYSIN, or "E" function requested.
* Save any changes (DIV SAVE). Then issue UNIDENTIFY, which internally
* issues UNMAP and UNIDENTIFY.
LCLOSE EQU *
CLI VSWUPDT,0
Any updates outstanding ?
BE
LCLOSE1
* No -- skip SAVE
DIV SAVE,ID=VTOKEN
Save any changes
LA
R2,5
Error code from SAVE
LTR R15,R15
SAVE ok ?
BNZ LERROR
* No -- quit
LCLOSE1 DIV UNIDENTIFY,ID=VTOKEN All done with object
LA
R2,6
Error code from UNIDENTIFY
LTR R15,R15
UNIDENTIFY ok ?
BNZ LERROR
* No -- quit
L
R13,4(,R13)
Unchain save areas and return
LM
R14,R12,12(R13)
*
SR
R15,R15
*
BR
R14
*
LERROR ABEND (R2),DUMP
Take a dump
14-25
14-26
DIVSAMPL reads statements from SYSIN that tell the program what to do. The
format of each statement is f aaaaaaaa v, where:
f
Function to perform:
S
Set a character in the object.
D
Display a character in the object.
E
End the program.
aaaaaaaa
The hexadecimal address of the storage to set or display. Leading
0s are required. The value must be less than X'003E8000'.
v
For Set, the character to put into the object.
Note: The program actually saves the change requested by the S function when
either the user asks to change a byte past the current size of the object, or
the user asks to terminate the program (E function).
14-27
14-28
Access
Registers 0
General
Purpose
Registers
14 15
ARs are used when fetching and storing data, but they are not used when doing
branches.
What is address space control (ASC) mode? The ASC mode controls where the
system looks for the data that the program is manipulating. Two ASC modes are
available for your use: primary mode and access register (AR) mode.
v In primary mode, your program can access data that resides in the programs
primary address space. When it resolves the addresses in data-referencing
instructions, the system does not use the contents of the ARs.
v In AR mode, your program can access data that resides in the address space or
data space that the ARs indicate. For data-referencing instructions, the system
uses the AR and the GPR together to locate an address in an address space or
data space.
How does your program switch ASC mode? Use the SAC instruction to change
ASC modes:
v SAC 512 sets the ASC mode to AR mode.
v SAC 0 sets the ASC mode to primary mode.
What does an AR contain? An AR contains a token, an access list entry token
(ALET). An ALET is an index to an entry on the access list. An access list is a
table of entries, each one of which points to an address space, data space, or
hiperspace to which a program has access.
Copyright IBM Corp. 1988, 2002
15-1
Figure 15-1 shows an ALET in the AR and the access list entry that points to an
address space or a data space. It also shows the address in the GPR that points to
the data within the address/data space.
Address/Data Space
Access List
AR
ALET
GPR
@
Data
15-2
Access Lists
When the system creates an address space, it gives that address space an access
list (PASN-AL) that is empty. Programs add entries to the DU-AL and the PASN-AL.
The entries represent the data spaces and hiperspaces that the programs want to
access.
Space Z
Space Z
Space Y
Space Y
Data Space X
TCB A
PGM1
DU-AL
Data
ALETX DC F Space X
ALETY DC F
The differences between a DU-AL and a PASN-AL are significant and you need to
understand them. The following table summarizes the characteristics of DU-ALs and
PASN-ALs as they relate to problem state programs with PSW key 8 - F.
15-3
PASN-AL
When the work unit terminates, the DU-AL is When the owning jobstep task terminates,
purged.
the PASN-AL is purged.
15-4
Address Space
AR
GPR
ALET ALET
X
Y
...
MVC A(LEN,1),B(2)
...
Access List
Space Y
Space X
Space Y
Space X
B
GPR 1 is used as a base register to locate the destination of the data, and AR 1 is
used to identify space X. GPR 2 is used to locate the source of the data, and AR 2
identifies Space Y. In AR mode, a program can use a single MVC instruction to
move data from one address/data space to another. Note that the address space
that contains the MVC instruction does not have to be either Space X or Space Y.
In similar ways, you can use instructions that compare, test-under-mask, copy,
move, and perform arithmetic operations.
When the instructions reference data in the primary address space, the ALET in the
AR must indicate that the data is in that address space. For this purpose, the
system provides a special ALET with a value of zero. Other than using this value to
identify the primary address space, a program should never depend on the value of
an ALET.
An ALET of zero designates the primary address space.
Loading the Value of Zero into an AR on page 15-7 shows several examples of
loading a value of zero in an AR.
15-5
Because ARs that are associated with index registers are ignored, when you code
assembler instructions in AR mode, place the commas very carefully. In those
instructions that use both a base register and an index register, the comma that
separates the two values is very important. Table 15-2 shows four examples of how
a misplaced comma can change how the processor resolves addresses on the load
instruction.
Table 15-2. Base and Index Register Addressing in AR Mode
Instruction
Address Resolution
L 5,4(,3) or L 5,4(0,3)
L 5,4(3) or L 5,4(3,0)
L 5,4(6,8)
L 5,4(8,6)
For their syntax and help with how to use these instruction, see Principles of
Operation.
15-6
*
DSALET
LAM
DS
2,2,DSALET
5,5
5,5
5,5,=F0
LAM
DC
5,5,ZERO
F0
5,12
COPY AR 12 INTO AR 5
Example 4: Set AR 12 to zero and set GPR 12 to the address contained in GPR
15. This sequence is useful to establish a programs base register GPR and AR
from an entry point address contained in register 15.
PGMA
CSECT
.
.
LAE 12,0(15,0)
USING PGMA,12
ENTRY POINT
ESTABLISH PROGRAMS BASE REGISTER
5,0(0,0)
15-7
Using the DSECT that the program established, the program can easily manipulate
data in the data space.
It is possible to use ALESERV ADD to obtain an entry for a hiperspace. For
information on how hiperspaces use ALETs, see Obtaining Additional HSPSERV
Performance on page 16-29. Do not use ALESERV ADD for hiperspaces unless
the move-page facility feature is installed on the processor.
If the program does not delete an entry, the entry remains on the access list until
the work unit terminates. At that time, the system frees the access list entry.
15-8
The LINKX macro generates different code and addresses, depending on the ASC
mode of the caller. During the assembly of LINKX, the LINKX macro service checks
the setting of the global bit. Because the global bit indicates that the caller is in AR
mode, LINKX generates code and addresses that are appropriate for callers in AR
mode.
The STORAGE macro generates the same code and addresses whether the caller
is in AR mode or primary mode. Therefore, the STORAGE macro service does not
check the global bit.
When the program changes back to primary mode, it should issue the following:
SAC
0
SYSSTATE ASCENV=P
Using X-Macros
Some macro services, such as LINK and LINKX, offer two macros, one for callers
in primary mode and one for callers in either primary or AR mode. The names of
the two macros are the same, except the macro that supports both primary and AR
mode caller ends with an X. This book refers to these macros as X-macros. The
rules for using all X-macros, except ESTAEX, are:
v Callers in primary mode can invoke either macro.
Some parameters on the X-macros, however, are not valid for callers in primary
mode. Some parameters on the non X-macros are not valid for callers in AR
mode. Check the macro descriptions in z/OS MVS Programming: Assembler
Chapter 15. Using Access Registers
15-9
15-10
Address Space
User programs
and data
2 gigabytes
User data
4 kilobytes
to
2 gigabytes
System programs
and data
User programs
and data
The major difference between a data space and a hiperspace is the way your
program accesses data in the two areas. This difference is described later in this
chapter. But before you can understand the differences, you need to understand
what your program can do with these virtual storage areas.
16-1
16-2
Because data spaces and hiperspaces belong to TCBs, keep in mind the
relationship between the program and the TCB under which it runs. For simplicity,
however, this chapter describes hiperspaces and data spaces as if they belong to
programs. For example, a programs data space means the data space that
belongs to the TCB under which a program is running.
16-3
Address Space
Program
Data Space
A
B
CLC A,B
MVC C,D
C
CLC and MVC access data
while data is in data space.
In contrast, a program does not directly access data in a hiperspace. MVS provides
a system service, the HSPSERV macro, to transfer the data between an address
space and a hiperspace in 4K byte blocks. The HSPSERV macro read operation
transfers the blocks of data from a hiperspace into an address space buffer where
the program can manipulate the data. The HSPSERV write operation transfers the
data from the address space buffer area to a hiperspace for storage. You can think
of hiperspace storage as a high-speed buffer area where your program can store
4K byte blocks of data.
Figure 16-2 on page 16-5 shows a program in an address space using the data in a
hiperspace. The program uses the HSPSERV macro to transfer an area in the
16-4
hiperspace to the address space, compares the values at locations A and B, and
uses the MVC instruction to move data at location D to location C. After it finishes
using the data in those blocks, the program transfers the area back to the
hiperspace. The program could be in either primary or AR ASC mode.
Hiperspace
Address Space
Program
HSPSERV...
ion
t
ra
CLC A,B
MVC C,D
HSPSERV...
ad
re
e
op
V
o
ER
ite
wr
H
RV
SE
P
HS
io
at
r
pe
S
SP
A
B
D
C
On one HSPSERV macro, the program can transfer the data in more than one area
between the hiperspace and the address space.
16-5
If your program can easily handle the data in 4K byte blocks, a hiperspace might
give you the best performance. Use a hiperspace if the program needs a place to
store data, but not to manipulate data. A hiperspace has other advantages:
v The program can stay in primary mode and ignore the access registers.
v The program can benefit from the high-speed access.
v The system can use the unused processor storage for other needs.
16-6
Rules
CREATE
DELETE
Can delete the data spaces it creates or owns, provided the PSW
key of the program matches the storage key of the data space.
RELEASE
EXTEND
Can add entries to its DU-AL for the data spaces it created or
owns.
16-7
Table 16-1. Rules for How Problem State Programs with Key 8-F Can Use Data
Spaces (continued)
Function
Rules
Can add entries to the PASN-AL for the data spaces it created or
owns, providing an entry is not already on the PASN-AL as a result
of an ALESERV ADD by a problem state program with PSW key 8 F. If the ALET is already on the PASN-AL, the system does not
create a duplicate entry, but the program can still access the data
space using the ALET that already exists.
Can access a data space through its DU-AL and PASN-AL. The
entry for a SCOPE=ALL or SCOPE=COMMON data space
accessed through the PASN-AL must have been added to the
PASN-AL by a program in supervisor state or PSW key 0 - 7. This
program would have passed an ALET to the problem state PSW
key 8 - F program.
LOAD
Can page areas into central storage from a data space created by
any other task in that address space.
OUT
There are other things that programs can do with data spaces. To do them,
however, your program must be supervisor state or have a PSW key 0 - 7. For
information on how these programs can use data spaces, see z/OS MVS
Programming: Extended Addressability Guide.
16-8
task in the job step as well as the creating task, assign ownership of the data
space to the job step task. Sharing Data Spaces among Problem-State
Programs with PSW Keys 8 - F on page 16-18 describes a program that
requests the TTOKEN of the job step task and then assigns ownership of a data
space to the job step task. To request the TTOKEN of the job step task, issue the
TCBTOKEN macro using the TYPE=JOBSTEP option.
Example 1: If PAY is the name you supply on the NAME parameter and you
code GENNAME=YES, the system generates the following name:
nccccPAY
where the system generates the digit n and the characters cccc, and appends the
characters PAY that you supplied.
Example 2: If J is the name you supply on the NAME parameter and you
code GENNAME=YES, the system generates the following name:
nccccJ
16-9
The data spaces and hiperspaces your programs create have a storage key greater
than 7. The system adds the initial size of these spaces to the cumulative total of all
data spaces and hiperspaces for the address space and checks this total against
the installation limit. For information on the IBM defaults, see Can an Installation
Limit the Use of Data Spaces and Hiperspaces? on page 16-3.
The BLOCKS parameter allows you to specify a maximum size and initial size
value.
v The maximum size identifies the largest amount of storage you will need in the
data space.
v An initial size identifies the amount of the storage you will immediately use.
As you need more space in the data space or hiperspace, you can use the
DSPSERV EXTEND macro to increase the available storage. The amount of
available storage is called the current size. (At the creation of a data space or
hiperspace, the initial size is the same as the current size.) When it calculates the
cumulative total of data space and hiperspace storage, the system uses the current
size.
If you know the default size and want a data space or hiperspace smaller than or
equal to that size, use the BLOCKS=maximum size or omit the BLOCKS parameter.
If you know what size data space or hiperspace you need and are not concerned
about exceeding the installation limit, set the maximum size and the initial size the
same. BLOCKS=0, the default, establishes a maximum size and initial size both set
to the default size.
If you do not know how large a data space or hiperspace you will eventually need
or you are concerned with exceeding the installation limit, set the maximum size to
the largest size you might possibly use and the initial size to a smaller amount, the
amount you currently need.
Use the NUMBLKS parameter to request that the system return the size of the
space it creates for you. You would use NUMBLKS, for example, if you did not
specify BLOCKS and do not know the default size.
Figure 16-3 on page 16-11 shows an example of using the BLOCKS parameter to
request a data space with a maximum size of 100,000 bytes of space and a current
size (or initial size) of 20,000 bytes. You would code the BLOCKS parameter on
DSPSERV as follows:
DSPSERV CREATE,. . .,BLOCKS=(DSPMAX,DSPINIT)
.
DSPMAX DC A((100000+4095)/4096)
DATA SPACE MAXIMUM SIZE
DSPINIT DC A((20000+4095)/4096)
DATA SPACE INITIAL SIZE
16-10
Data Space
Maximum size
100,000 bytes
Current size
20,000 bytes
As your program uses more of the data space storage, it can use DSPSERV
EXTEND to extend the current size. Extending the Current Size of a Data Space
on page 16-14 describes extending the current size and includes an example of
how to extend the current size of the data space in Figure 16-3.
16-11
DSPCORG DS F
DATA SPACE ORIGIN RETURNED
DSPCSIZE EQU 10000000
10 MILLION BYTES OF SPACE
DSPBLCKS DC A((DSPCSIZE+4095)/4096) NUMBER OF BLOCKS NEEDED FOR
*
A 10 MILLION BYTE DATA SPACE
AR/GR 2
AR/GR 3
GR 4
The routines can be called in either primary or AR mode; however, during the time
they manipulate data in a data space, they must be in AR mode. The source and
target locations are assumed to be the same length (that is, the target location is
not filled with a padding character).
Example 1: Using the MVC Instruction: The first COPYDATA example uses the
MVC instruction to move the specified data in groups of 256 bytes:
16-12
COPYDATA DS
BAKR
LAE
BALR
USING
.
.
*
0D
14,0
12,0(0,0)
12,0
*,12
LTR
BNP
4,4
COPYDONE
S
BNP
4,=F256
COPYLAST
.
COPYLOOP DS
MVC
LA
LA
S
BP
*
COPYLAST DS
LA
EX
*
B
COPYINST MVC
COPYDONE DS
.
* EXIT CODE
LA
PR
0H
0(256,2),0(3)
2,256(,2)
3,256(,3)
4,=F256
COPYLOOP
0H
4,255(,4)
4,COPYINST
COPYDONE
0(0,2),0(3)
0H
EXECUTED INSTRUCTION
15,0
Example 2: Using the MVCL Instruction: The second COPYDATA example uses the
MVCL instruction to move the specified data in groups of 1048576 bytes:
COPYDATA DS
BAKR
LAE
BALR
USING
.
LA
LA
LTR
BNP
.
LAE
L
SR
BNP
*
.
COPYLOOP DS
LR
LR
MVCL
ALR
ALR
LR
LR
SR
BP
*
.
COPYLAST DS
AR
0D
14,0
12,0(0,0)
12,0
*,12
6,0(,2)
7,0(,3)
8,4
COPYDONE
COPY
COPY
COPY
EXIT
4,0(0,3)
9,COPYLEN
8,9
COPYLAST
0H
3,9
5,9
2,4
6,9
7,9
2,6
4,7
8,9
COPYLOOP
0H
8,9
TARGET ADDRESS
SOURCE ADDRESS
AND TEST LENGTH
IF LENGTH NEGATIVE OR ZERO
16-13
LR
LR
MVCL
B
COPYLEN DC
COPYDONE DS
.
* EXIT CODE
LA
PR
3,8
5,8
2,4
COPYDONE
F1048576
0H
15,0
16-14
DSPSERV EXTEND,STOKEN=DSSTOK,BLOCKS=DSPDELTA
.
DSPDELTA DC A((30000+4095)/4096)
DATA SPACE ADDITIONAL SIZE
DSSTOK DS CL8
DATA SPACE STOKEN
The program can now use 50,000 bytes in the 100,000-byte data space, as shown
in Figure 16-4:
Data Space
Maximum size
100,000 bytes
Current size
50,000 bytes
Because the example did not include the VAR parameter, the system uses the
default, VAR=NO.
Paging Data Space Storage Areas into and out of Central Storage
If you expect to be processing through one or more 4K blocks of data space
storage, you can use DSPSERV LOAD to load these pages into central storage. By
loading an area of a data space into central storage, you reduce the number of
page faults that occur while you sequentially process through that area. DSPSERV
LOAD requires that you specify the STOKEN of the data space (on the STOKEN
Chapter 16. Data Spaces and Hiperspaces
16-15
parameter), the beginning address of the area (on the START parameter), and the
size of the area (on the BLOCKS parameter). The beginning address has to be on
a 4K-byte boundary, and the size has to be an increment of 4K blocks. (Note that
DSPSERV LOAD performs the same action for a data spaces as the PGSER
macro with the LOAD parameter does for an address space.)
Issuing DSPSERV LOAD does not guarantee that the pages will be in central
storage; the system honors your request according to the availability of central
storage. Also, after the pages are loaded, page faults might occur elsewhere in the
system and cause the system to move those pages out of central storage.
If you finish processing through one or more 4K blocks of data space storage, you
can use DSPSERV OUT to page the area out of central storage. The system will
make these real storage frames available for reuse. DSPSERV OUT requires that
you specify the STOKEN, the beginning address of the area, and the size of the
area. (Note that DSPSERV OUT corresponds to the PGSER macro with the OUT
parameter.)
Any task in an address space can page areas into (and out of) central storage from
(or to) a data space created by any other task in that address space. Therefore,
you can attach a subtask that can preload pages from a data space into central
storage for use by another subtask.
When your program has no further need for the data in a certain area of a data
space, it can use DSPSERV RELEASE to free that storage.
16-16
and get their addresses. For more information on how to use the services and an
example that includes assembler instructions, see Chapter 13, Callable Cell Pool
Services.
Example of Using Callable Cell Pool Services with a Data Space: Assume that you
have an application that requires up to 4,000 records 512 bytes in length. You have
decided that a data space is the best place to hold this data. Callable cell pool
services can help you build a cell pool, each cell having a size of 512 bytes. The
steps are as follows:
1. Create a data space (DSPSERV CREATE macro)
Specify a size large enough to hold 2,048,000 bytes of data (4000 times 512)
plus the data structures that the callable cell pool services need.
2. Add the data space to an access list (ALESERV macro)
The choice of DU-AL or PASN-AL depends on how you plan to share the data
space.
3. Reserve storage for the anchor and obtain its address
The anchor (of 64 bytes) can be in the address space or the data space. For
purposes of this example, the anchor is in the data space.
4. Initialize the anchor (CSRPBLD service) for the cell pool
Input to CSRPBLD includes the ALET of the data space, the address of the
anchor, the name you assign to the pool, and the size of each cell (in this case,
512 bytes). Because the anchor is in the data space, the caller must be in AR
mode.
5. Reserve storage for the extent and obtain the address of the extent
The size of the extent is 128 bytes plus 1 byte for every eight cells. 128 bytes
plus 500 (4000 8) bytes equals 628 bytes. Callable cell pool services rounds
this number to the next doubleword 632 bytes.
6. Obtain the address of the beginning of the cell storage
Add the size of the anchor (64 bytes) and the size of the extent (628 bytes) to
get the location where the cell storage can start. You might want to make this
starting address on a given boundary, such as a doubleword or page.
7. Add an extent for the cell pool and establish a connection between the extent
and the cells (CSRPEXP service)
Input to CSRPEXP includes the ALET for the data space, the address of the
anchor, the address of the extent, the size of the extent (in this case, 632
bytes), and the starting address of the cell storage. Because the extent is in the
data space, the caller must be in AR mode.
At this point, the cell pool structures are in place and users can begin to request
cells. Figure 16-5 on page 16-18 describes the areas you have defined in the data
space.
16-17
Data Space
Access List
AR
ALET
The pool of
4000 cells,
each 512
bytes in size
2048000 bytes
extent
632 bytes
anchor
64 bytes
Figure 16-5. Example of Using Callable Cell Pool Services for Data Spaces
A program that has addressability to the data space can then obtain a cell (or cells)
through the CSRPGET service. Input to CSRPGET includes the ALET of the space
and the address of the anchor. CSRPGET returns the address of the cell (or cells) it
allocates.
16-18
on the DU-AL at the time of the attach. The ALCOPY=YES parameter on the
ATTACH or ATTACHX macro allows a problem-state program to pass a copy of its
DU-AL to the subtask the problem-state program is attaching. Passing only a part of
the DU-AL is not possible.
A program can use the ETXR option on ATTACH or ATTACHX to specify the
address of an end-of-task routine to be given control after the new task is normally
or abnormally terminated. The exit routine receives control when the originating task
becomes active after the subtask is terminated. The routine runs asynchronously
under the originating task. Upon entry, the routine has an empty dispatchable unit
access list (DU-AL). To establish addressability to a data space created by the
originating task and shared with the terminating subtask, the routine can use the
ALESERV macro with the ADD parameter, and specify the STOKEN of the data
space.
In the following example, shown in Figure 16-6, assume that program PGM1
(running under TCBA) has created a SCOPE=SINGLE data space DS1 and
established addressability to it. PGM1s DU-AL has several entries on it, including
one for DS1. PGM1 uses the ATTACHX macro with the ALCOPY=YES parameter to
attach subtask TCBB and pass a copy of its DU-AL to TCBB. It can also pass
ALETs in a parameter list to PGM2. Upon return from ATTACHX, PGM1 and PGM2
have access to the same data spaces.
The figure shows the two programs, PGM1 and PGM2, sharing the same data
space.
DS1
Address Space
SCOPE=SINGLE
DU-AL
TCBA
PGM1
DS1
ATTACHX..ALCOPY=YES
ALETDS1DSF
DU-AL
TCBB
PGM2
DS1
An example of the code that attaches TCBB and passes a copy of the DU-AL is as
follows:
DSPSERV CREATE,NAME=DSNAME,BLOCKS=DSSIZE,STOKEN=DSSTOK,
ORIGIN=DSORG
ALESERV ADD,STOKEN=DSSTOK,ALET=DSALET
ATTACHX EP=PGM2,ALCOPY=YES
.
.
DSNAME
DSSTOK
DC
DS
CL8TEMP
CL8
16-19
DSALET
DSORG
DSSIZE
DS
DS
DC
F
F
F2560
The DU-ALs do not necessarily stay identical. After the attach, PGM1 and PGM2
can add and delete entries on their own DU-ALs; these changes are not made to
the other DU-AL.
If TCBA terminates, the system deletes the data space that belonged to TCBA and
terminates PGM2.
Unless PGM1 or a program running under the job step TCB explicitly deletes the
data space, the system deletes the data space when the job step task terminates.
Note that when PGM1 issues the ALESERV ADD to add the entry for DS1 to the
PASN-AL, the system checks to see if an entry for DS1 already exists on the
PASN-AL. If an entry already exists, and a problem-state program with PSW key 8 F added the entry, the system rejects the ALESERV ADD request. However, PGM1
can still access the data space. The system will simply not create a duplicate entry.
16-20
The task that issues the DIV IDENTIFY owns the pointers and structures associated
with the ID that DIV returns. Any program can use DIV IDENTIFY; however, the
system checks the authority of programs that try to use subsequent DIV services for
the same ID.
For problem-state programs with PSW key 8 - F, data-in-virtual allows only the
issuer of the DIV IDENTIFY to use other DIV services for the ID. That means, for
example, that if a problem-state program with PSW key 8 issues the DIV IDENTIFY,
another problem-state program with PSW key 8 cannot issue DIV MAP for the
same ID. The issuer of DIV IDENTIFY can use DIV MAP to map a VSAM linear
data set to a data space window, providing the program owns or created the data
space.
Your program can map one data-in-virtual object into more than one data space. Or,
it can map several data-in-virtual objects within a single data space. In this way,
data spaces can provide large reference areas available to your program.
16-21
OBJDD
OBJAREA
OBJWORD1
OBJWORD2
DC AL1(7),CL7MYDD
DSECT
DS F
DS F
*
*
*
*
16-22
LAE 12,0
SET BASE REGISTER AR
BASR 12,0
SET BASE REGISTER GPR
USING *,12
.
DSPSERV CREATE,NAME=DSPCNAME,STOKEN=DSPCSTKN,
X
BLOCKS=DSPBLCKS,ORIGIN=DSPCORG
ALESERV ADD,STOKEN=DSPCSTKN,ALET=DSPCALET,AL=WORKUNIT
.
ESTABLISH ADDRESSABILITY TO THE DATA SPACE
.
LAM 2,2,DSPCALET
LOAD ALET OF SPACE INTO AR2
L
2,DSPCORG
LOAD ORIGIN OF SPACE INTO GPR2
USING DSPCMAP,2
INFORM ASSEMBLER
.
MANIPULATE DATA IN THE DATA SPACE
.
L
3,DATAIN
ST
3,DSPWRD1
STORE INTO DATA SPACE WRD1
.
MVC DSPWRD2,DATAIN
COPY DATA FROM PRIMARY SPACE
INTO THE DATA SPACE
MVC DSPWRD3,DSPWRD2
COPY DATA FROM ONE LOCATION
IN THE DATA SPACE TO ANOTHER
MVC DATAOUT,DSPWRD3
COPY DATA FROM DATA SPACE
INTO THE PRIMARY SPACE
.
DELETE THE ACCESS LIST ENTRY AND THE DATA SPACE
.
ALESERV DELETE,ALET=DSPCALET
REMOVE DS FROM AL
DSPSERV DELETE,STOKEN=DSPCSTKN DELETE THE DS
.
PR
RETURN TO CALLER
.
DSPCNAME
DSPCSTKN
DSPCALET
DSPCORG
DSPCSIZE
DSPBLCKS
*
DATAIN
DATAOUT
DSPCMAP
DSPWRD1
DSPWRD2
DSPWRD3
DS 0D
DC CL8TEMP
DS CL8
DS F
DS F
EQU 10000000
DC A((DSPCSIZE+4095)/4096)
DC CL4ABCD
DS CL4
.
DSECT
DS
F
DS
F
DS
F
END
Note that you cannot code ACCESS=PRIVATE on the ALESERV macro when you
request an ALET for a data space; all data space entries are public.
Using Checkpoint/Restart
A program can use checkpoint/restart while it has one or more entries for a data
space on its access list (DU-AL or PASN-AL). If the program has specified on the
ALESERV macro that the system is to ignore entries made to the access list for the
data space for checkpoint/restart processing (CHKPT=IGNORE), the CHKPT macro
processes successfully.
A program that specifies CHKPT=IGNORE assumes full responsibility for managing
the data space storage. Managing the data space storage includes the following:
v If any program depends on the contents of the data space and the data cannot
be recreated or obtained elsewhere, the responsible program must save the
contents of the data space prior to the checkpoint operation.
v Once the checkpoint operation has completed, the responsible program must
perform the following during restart processing to successfully manage the data
space storage.
1. Ensure that the data space exists. The original data space might or might not
exist. If the original data space does not exist, the responsible program must
issue DSPSERV CREATE to recreate the data space.
2. Issue ALESERV ADD of the data space, original or recreated, to the
programs access list to obtain a new ALET.
3. If, in addition to having a dependency on the data space, any program also
depends on the contents of the data space storage, the responsible program
must refresh the contents of the data space storage. The program must use
the new ALET to reference the data space.
16-23
4. The responsible program must make the new ALET available to any program
that has a dependency on the data space. The STOKEN, changed or
unchanged, must be made available to any program that needs to issue
ALESERV ADD to access the data space.
See z/OS DFSMS Checkpoint/Restart information about the CHKPT macro.
Address Space
Hiperspace
HSPSERV...
HSPSERV...
data area
buffer area
wr
ite
on
ati
er
n
op
ati
er
p
do
re
The data in the hiperspace and the buffer area in the address space must both start
on a 4K byte boundary.
Use this section to help you create, use, and delete hiperspaces. It describes some
of the characteristics of hiperspaces, how to move data in and out of a hiperspace;
and how data-in-virtual can help you control data in hiperspaces. In addition, z/OS
MVS Programming: Assembler Services Reference ABE-HSP contains the syntax
and parameter descriptions for the macros that are mentioned in this section.
16-24
Standard Hiperspaces
Your program can create a standard hiperspace, one that is backed with expanded
storage and auxiliary storage, if necessary. Through the buffer area in the address
space, your program can view or scroll through the hiperspace. Scrolling allows
you to make interim changes to data without changing the data on DASD.
HSTYPE=SCROLL on DSPSERV creates a standard hiperspace. HSPSERV
SWRITE and HSPSERV SREAD transfer data to and from a standard hiperspace.
The data in a standard hiperspace is predictable; that is, your program can write
data to a standard hiperspace and count on retrieving it.
The best way to describe how your program can scroll through a standard
hiperspace is through an example. Figure 16-7 shows a hiperspace that has four
scroll areas, A, B, C, and D. After the program issues an HSPSERV SREAD for
hiperspace area A, it can make changes to the data in the buffer area in its address
space. HSPSERV SWRITE then saves those changes. In a similar manner, the
program can read, make changes, and save the data in areas B, C, and D. When
the program reads area A again, it finds the same data that it wrote to the area in
the previous HSPSERV SWRITE to that area.
Address Space
Hiperspace
area A
HSPSERV SREAD...
HSPSERV SWRITE...
HSPSERV SREAD...
HSPSERV SWRITE...
area B
area C
area D
buffer area
16-25
Yes
Creating a Hiperspace
To create a non-shared standard hiperspace, issue the DSPSERV CREATE macro
with the TYPE=HIPERSPACE and HSTYPE=SCROLL parameters. The HSTYPE
parameter tells the system you want a standard hiperspace. HSTYPE=SCROLL is
the default. MVS allocates contiguous 31-bit virtual storage of the size you specify
and initializes the storage to hexadecimal zeroes. The entire hiperspace has the
storage key 8. Because many of the same rules that apply to creating data spaces
also apply to creating hiperspaces, this section sometimes refers you to sections
earlier in Creating a Data Space.
On the DSPSERV macro, you are required to specify:
v The name of the hiperspace (NAME parameter)
To ask DSPSERV to generate a hiperspace name unique to the address space,
use the GENNAME parameter. DSPSERV will return the name it generates at
the location you specify on the OUTNAME parameter. Specifying a name for a
hiperspace follows the same rules as specifying a name for a data space. See
Choosing the Name of a Data Space on page 16-9.
v A location where DSPSERV is to return the STOKEN of the hiperspace
(STOKEN parameter)
DSPSERV CREATE returns a STOKEN that you can use to identify the
hiperspace to other DSPSERV services and to the HSPSERV and DIV macros.
16-26
DSPSERV CREATE,NAME=HSNAME,TYPE=HIPERSPACE,HSTYPE=SCROLL,
BLOCKS=20,STOKEN=HSSTOKEN
*
HSNAME DC
HSSTOKEN DS
CL8SCROLLHS
CL8
16-27
Address Space
Hiperspace
HSPSERV...
HSPSERV...
data area
buffer area
on
ati
er ion
p
t
o
era
ite
wr d op
a
re
On the HSPSERV macro, you identify the hiperspace and the areas in the address
space and the hiperspace:
v STOKEN specifies the STOKEN of the hiperspace.
v NUMRANGE specifies the number of data areas the system is to read or write.
v RANGLIST specifies a list of ranges that indicate the boundaries of the buffer
areas in the address space and the data area in the hiperspace.
HSPSERV has certain restrictions on these areas. Two restrictions are that the data
areas must start on a 4K byte boundary and their size must be in multiples of 4K
bytes. Other requirements are listed in the description of HSPSERV in z/OS MVS
Programming: Assembler Services Reference ABE-HSP. Read the requirements
carefully before you issue the macro.
The system does not always preserve the data in the areas that are the source for
the read and write operations. Figure 16-8 tells you what the system does with the
areas after it completes the transfer.
16-28
auxiliary storage) that backs the source area in the hiperspace. RELEASE=YES
tells the system that your program does not plan to use the source area in the
hiperspace as a copy of the data after the read operation.
See Example of Creating a Standard Hiperspace and Using It on page 16-33 for
an example of the HSPSERV SREAD and HSPSERV SWRITE macros.
STOKEN is the eight-byte identifier of the hiperspace, and ALET is the four-byte
index into the DU-AL, the access list that is associated with the task. The STOKEN
is input to ALESERV ADD; the ALET is output.
Before you issue the HSPSERV macro with the HSPALET parameter, obtain a
144-byte workarea for the HSPSERV macro service and place the address of this
area in GPR 13 and a zero in AR 13.
Note: When the HSPALET parameter is specified, the applications RANGLIST
data may be modified by the system.
Do not specify RELEASE=YES with the HSPALET parameter.
16-29
.
.
.
* DSPSERV CREATES A NON-SHARED STANDARD HIPERSPACE OF 20 4096-BYTE BLOCKS
*
DSPSERV CREATE,NAME=HSNAME,TYPE=HIPERSPACE,BLOCKS=20,
X
STOKEN=HSSTOKEN,ORIGIN=HSORIG1
*
* ALESERV RETURNS AN ALET ON THE DU-AL FOR THE HIPERSPACE
*
ALESERV ADD,STOKEN=HSSTOKEN,ALET=HSALET,AL=WORKUNIT
*
* THE STORAGE MACRO OBTAINS FOUR PAGES OF ADDRESS SPACE STORAGE,
* THE BNDRY=PAGE PARAMETER ALIGNS PAGES ON A 4K BOUNDARY
* - THE FIRST AND SECOND PAGES ARE THE SWRITE SOURCE
* - THE THIRD AND FOURTH PAGES ARE THE SREAD TARGET
* COPY INTO FIRST AND SECOND PAGES THE DATA TO BE WRITTEN TO HIPERSPACE
.
STORAGE OBTAIN,LENGTH=4096*4,BNDRY=PAGE
ST 1,ASPTR
* SAVE ADDR SPACE STORAGE ADDRESS
MVC 0(20,1),SRCTEXT1
* INIT FIRST ADDR SPACE PAGE
A
1,ONEBLK
* COMPUTE PAGE TWO ADDRESS
MVC 0(20,1),SRCTEXT2
* INIT SECOND ADDR SPACE PAGE
.
* SET UP THE SWRITE RANGE LIST TO WRITE FROM THE FIRST AND SECOND
* ADDRESS SPACE PAGES INTO THE HIPERSPACE
.
L
1,ASPTR
* GET FIRST ADDR PAGE ADDRESS
ST 1,ASPTR1
* PUT ADDRESS INTO RANGE LIST
.
* SAVE CONTENTS OF AR/GPR 13 BEFORE RESETTING THEM FOR HSPSERV
.
ST 13,SAVER13
* SAVE THE CONTENTS OF GPR 13
EAR 13,13
* LOAD GPR 13 FROM AR 13
ST 13,SAVEAR13
* SAVE THE CONTENTS OF AR 13
.
* ESTABLISH ADDRESS OF 144-BYTE SAVE AREA, AS HSPALET ON HSPSERV REQUIRES
* AND WRITE TWO PAGES FROM THE ADDRESS SPACE TO THE HIPERSPACE
.
SLR 13,13
* SET GPR 13 TO 0
SAR 13,13
* SET AR 13 TO 0
LA 13,WORKAREA
* SET UP AR/GPR 13 TO WORKAREA ADDR
HSPSERV SWRITE,STOKEN=HSSTOKEN,RANGLIST=RANGPTR1,HSPALET=HSALET
.
* AFTER THE SWRITE, THE FIRST TWO ADDRESS SPACE PAGES MIGHT BE OVERLAID
.
16-30
SRCTEXT2 DC
CL20 INVENTORY SURPLUSES
DS
0F
RANGPTR1 DC
A(SWRITLST)
* ADDRESS OF SWRITE RANGE LIST
RANGPTR2 DC
A(SREADLST)
* ADDRESS OF SREAD RANGE LIST
DS
0F
16-31
SWRITLST
ASPTR1
HSORIG1
NUMBLKS1
DS
DS
DS
DC
DS
SREADLST DS
ASPTR2 DS
HSORIG2 DS
NUMBLKS2 DC
DS
0CL12
F
F
F2
0F
0CL12
F
F
F2
0F
*
*
*
*
*
*
*
*
Deleting a Hiperspace
When a program doesnt need the hiperspace any more, it can delete it. Your
program can delete only the hiperspaces it owns, providing the programs PSW key
matches the storage key of the hiperspace.
Example of Deleting a Hiperspace: The following example shows you how to delete
a hiperspace:
16-32
HSSTKN
DSPSERV DELETE,STOKEN=HSSTKN
.
DS CL8
DELETE THE HS
HIPERSPACE STOKEN
IBM recommends that you explicitly delete a hiperspace before the owning task
terminates to free resources as soon as they are no longer needed, and to avoid
excess processing at termination time. However, if you do not delete the
hiperspace, the system automatically does it for you.
Address Space
PROG1
ITE
SWR
DSPSERV
HSPSERV SWRITE
HSPSERV SREAD
SWRITE range list
SREAD range list
AD
SRE
16-33
DS
DS
DC
DC
DS
SREADLST DS
ASPTR2 DS
HSPTR2 DC
NUMBLKS2 DC
0CL12
F
F4096
F2
0F
0CL12
F
F4096
F2
16-34
The task that issues the DIV IDENTIFY owns the pointers and structures associated
with the ID that DIV returns. Any program can use DIV IDENTIFY. However, the
system checks the authority of programs that try to use the other DIV services for
the same ID. For problem-state programs with PSW key 8 - F, data-in-virtual allows
only the issuer of the DIV IDENTIFY to use subsequent DIV services for the same
ID. That means, for example, that if a problem-state program with PSW key 8
issues the DIV IDENTIFY, another problem-state program with PSW key 8 cannot
issue DIV MAP for the same ID.
Problem-state programs with PSW key 8 - F can use DIV MAP to:
v Map a VSAM linear data set to a window in a hiperspace, providing the program
owns the hiperspace.
v Map a non-shared hiperspace object to an address space window, providing:
The program owns the hiperspace,
The program or its attaching task obtained the storage for the window, and
No program has ever issued ALESERV ADD for the hiperspace
The rules for using data-in-virtual and HSPSERV with the HSPALET parameter (for
additional performance) are as follows:
v Your program can use HSPSERV with the HSPALET parameter with non-shared
hiperspaces when a data-in-virtual object is mapped to a hiperspace, providing a
DIV SAVE is not in effect.
v Once any program issues ALESERV ADD for a hiperspace, that hiperspace
cannot be a data-in-virtual object.
v If a program issues ALESERV ADD for a hiperspace that is currently a data
object, the system rejects the request.
For information on the use of ALETs with hiperspaces, see Obtaining Additional
HSPSERV Performance on page 16-29.
The following two sections describe how your program can use the data-in-virtual
services with hiperspaces.
16-35
Standard Hiperspace
Address Space
Program
DSPSERV...
DIV IDENTIFY...
DIV ACCESS...
DIV MAP...
Permanent Object
HSPSERV SWRITE...
HSPSERV SREAD...
HSPSERV SREAD
window
VSAM linear
data set
HSPSERV SWRITE
Initially, the window in the hiperspace and the buffer area in the address space are
both 4K bytes. (That is, the window takes up the entire initial size of the
hiperspace.) The data-in-virtual object is a VSAM linear data set on DASD.
* CREATE A STANDARD HIPERSPACE
.
DSPSERV CREATE,TYPE=HIPERSPACE,HSTYPE=SCROLL,NAME=HS1NAME,
STOKEN=HS1STOK,BLOCKS=(ONEGIG,FOURK),ORIGIN=HS1ORG
.
The program can read the data in the hiperspace window to a buffer area in the
address space through the HSPSERV SREAD macro. It can update the data and
write changes back to the hiperspace through the HSPSERV SWRITE macro. For
an example of these operations, see Example of Creating a Standard Hiperspace
and Using It on page 16-33.
Continuing the example, the following code saves the data in the hiperspace
window on DASD and terminates the mapping.
* SAVE THE DATA IN THE HIPERSPACE WINDOW ON DASD AND END THE MAPPING
.
DIV
SAVE,ID=OBJID
DIV
UNMAP,ID=OBJID,AREA=HS1ORG
DIV
UNACCESS,ID=OBJID
DIV
UNIDENTIFY,ID=OBJID
.
* PROGRAM FINISHES USING THE DATA IN THE HIPERSPACE
16-36
.
* DELETE THE HIPERSPACE
.
DSPSERV DELETE,STOKEN=HS1STOK
.
Address Space
Program
DSPSERV...
DIV MAP...
DIV SAVE...
Non-shared
Standard Hiperspace
temporary
object
window
16-37
DIV
DIV
DIV
.
HS2NAME
HS2STOK
ONEBLOCK
OBJID
OBJAREA
IDENTIFY,ID=OBJID,TYPE=HS,STOKEN=HS2STOK
ACCESS,ID=OBJID,MODE=UPDATE
MAP,ID=OBJID,AREA=OBJAREA
DC
DS
DC
DS
DS
CL8MHSNAME
CL8
F1
CL8
CL8
HIPERSPACE NAME
HIPERSPACE STOKEN
HIPERSPACE SIZE OF 1 BLOCK
DIV OBJECT ID
WINDOW IN ADDRESS SPACE
When the hiperspace is a data-in-virtual object, your program does not need to
know the origin of the hiperspace. All addresses refer to offsets within the
hiperspace. Note that the example does not include the ORIGIN parameter on
DSPSERV.
After you finish making changes to the data in the address space window, you can
save the changes back to the hiperspace as follows:
* SAVE CHANGES TO THE OBJECT
.
DIV
SAVE,ID=OBJID
The following macro refreshes the address space window. This means that if you
make changes in the window and want a fresh copy of the object (that is, the copy
that was saved last with the DIV SAVE macro), you would issue the following:
DIV
RESET,ID=OBJID
When you finish using the hiperspace, use the DSPSERV macro to delete the
hiperspace.
* DELETE THE HIPERSPACE
.
DSPSERV DELETE,STOKEN=HS2STOK
Using Checkpoint/Restart
A program can use checkpoint/restart while it has one or more entries for a
hiperspace on its access list (DU-AL or PASN-AL). If the program has specified on
the ALESERV macro that the system is to ignore entries made to the access list for
the hiperspace for checkpoint/restart processing (CHKPT=IGNORE), the CHKPT
macro processes successfully.
A program that specifies CHKPT=IGNORE assumes full responsibility for managing
the hiperspace storage. Managing the hiperspace storage includes the following:
v If any program depends on the contents of the hiperspace and the data cannot
be recreated or obtained elsewhere, the responsible program must save the
contents of the hiperspace prior to the checkpoint operation.
v Once the checkpoint operation has completed, the responsible program must
perform the following during restart processing to successfully manage the
hiperspace storage.
1. Ensure that the hiperspace exists. The original hiperspace might or might not
exist. If the original hiperspace does not exist, the responsible program must
issue DSPSERV CREATE TYPE=HIPERSPACE to recreate the hiperspace.
2. Issue ALESERV ADD of the hiperspace, original or recreated, to the
programs access list to obtain a new ALET.
3. If, in addition to having a dependency on the hiperspace, any program also
depends on the contents of the hiperspace storage, the responsible program
16-38
must refresh the contents of the hiperspace storage. The program must use
the new ALET to reference the hiperspace.
4. The responsible program must make the new ALET available to any program
that has a dependency on the hiperspace. The STOKEN, changed or
unchanged, must be made available to any program that needs to issue
ALESERV ADD to access the hiperspace.
See z/OS DFSMS Checkpoint/Restart information about the CHKPT macro.
16-39
16-40
Data Objects
Permanent
A permanent data object is a virtual storage access method (VSAM) linear data set
that resides on DASD. (This type of data set is also called a data-in-virtual object.)
You can read data from an existing permanent object and also update the content
of the object. You can create a new permanent object and when you are finished,
save it on DASD. Because you can save this type of object on DASD, window
services calls it a permanent object. Window services can handle very large
permanent objects that contain as many as four gigabytes (4294967296 bytes).
Note: Installations whose high level language programs, such as FORTRAN, used
data-in-virtual objects prior to MVS/SP 3.1.0 had to write an Assembler
language interface program to allow the FORTRAN program to invoke the
data-in-virtual program. Window services eliminates the need for this
interface program.
17-1
Mapping the window to the blocks means that window services makes the data
from those blocks available in the window when you reference the data. You can
map a window to all or part of a data object depending on the size of the object and
the size of the window. You can examine or change data that is in the window by
using the same instructions that you use to examine or change any other data in
your program storage.
The following figure shows the structure of a data object and shows a window
mapped to two of the objects blocks.
your address
space
window
data object
1st block
4096 bytes
2nd block
4096 bytes
1st block
3rd block
4096 bytes
2nd block
4th block
4096 bytes
.
/
last block
4096 bytes
17-2
Notes:
1. Window services does not transfer data from the object on DASD, from the
scroll area, or from the temporary object until your program references the data.
Then window services transfers the blocks that contain the data your program
requests.
2. The expanded storage that window services uses for a scroll area or for a
temporary object is called a hiperspace. A hiperspace is a range of contiguous
virtual storage addresses that a program can use like a buffer. Window services
uses as many hiperspaces as needed to contain the data object.
your address
space
permanent object
on DASD
1st block
window
1st block
2nd block
2nd block
3rd block
.
.
last block
17-3
your address
space
permanent object
on DASD
scroll area
1st block
2nd block
window
3rd block
3rd block
4th block
4th block
DIV
object
.
/
last block
your address
space
temporary object
1st block
2nd block
1st block
3rd block
2nd block
4th block
window
.
/
last block
17-4
your address
space
temporary object
1st block
2nd block
first
window
2nd block
3rd block
3rd block
4th block
.
.
second
window
last block
/
/
.
.
/
/
last block
17-5
temporary object
1st block
2nd block
3rd block
4th block
your address
space
first
window
second
window
.
/
2nd block
last block
4th block
scroll area
5th block
Permanent object
on DASD
1st block
DIV
object
2nd block
3rd block
4th block
5th block
/
last block
17-6
changes. In that case, you can have window services refresh the changed data.
To refresh the window or the scroll area, window services replaces changed data
with data from the object as it appears on DASD.
v Replace the view in a window After you finish using data thats in a window,
you can have window services replace the view in the window with a different
view of the object. For example, if you are viewing the third, fourth, and fifth
blocks of an object and are finished with those blocks, you might have window
services replace that view with a view of the sixth, seventh, and eighth blocks.
v Update the object on DASD If you have changes available in a window or in
the scroll area, you can save the changes on DASD. Window services replaces
blocks on DASD with corresponding changed blocks from the window and the
scroll area. Updating an object on DASD does not alter data in the window or in
the scroll area.
17-7
v Update a scroll area or a temporary object with changes you have made in a
window
v Refresh changes that you no longer need in a window or a scroll area
v Update a permanent object on DASD with changes that are in a window or a
scroll area
v Terminate access to an object
The window services programs that you call and the sequence in which you call
them depends on your use of the data object. For descriptions of the window
services, see z/OS MVS Programming: Assembler Services Reference ABE-HSP.
For an example of invoking window services from an assembler language program,
see Window Services Coding Example on page 17-19.
The first step in using any data object is to gain access to the object. To gain
access, you call CSRIDAC. The object can be an existing permanent object, or a
new permanent or temporary object you want to create. For a permanent object,
you can request an optional scroll area. A scroll area enables you to make interim
changes to an objects data without affecting the data on DASD. When CSRIDAC
grants access, it provides an object identifier that identifies the object. You use that
identifier to identify the object when you request other services from window service
programs.
After obtaining access to an object, you must define one or more windows and
establish views of the object in those windows. To establish a view of an object, you
tell window services which blocks you want to view and in which windows. You can
view multiple objects and multiple parts of each object at the same time. To define
windows and establish views, you call CSRVIEW or CSREVW. After establishing a
view, you can examine or change data that is in the window using the same
instructions you use to examine or change other data in your programs storage.
After making changes to the part of an object that is in a window, you will probably
want to save those changes. How you save changes depends on whether the
object is permanent, is temporary, or has a scroll area.
If the object is permanent and has a scroll area, you can save changes in the scroll
area without affecting the object on DASD. Later, you can update the object on
DASD with changes saved in the scroll area. If the object is permanent and has no
scroll area, you can update it on DASD with changes that are in a window. If the
object is temporary, you can update it with changes that are in a window. To update
an object on DASD, you call CSRSAVE. To update a temporary object or a scroll
area, you call CSRSCOT.
After making changes in a window and possibly saving them in a scroll area or
using them to update a temporary object, you might decide that you no longer need
those changes. In this case, you can refresh the changed blocks. After refreshing a
block of a permanent object or a scroll area to which a window is mapped, the
refreshed block contains the same data that the corresponding block contains on
DASD. After refreshing a block of a temporary object to which a window is mapped,
the block contains binary zeroes. To refresh a changed block, you call CSRREFR.
After finishing with a view in a window, you can use the same window to view a
different part of the object or to view a different object. Before changing the view in
a window, you must terminate the current view. If you plan to view a different part of
the same object, you terminate the current view by calling CSRVIEW. If you plan to
view a different object or will not reuse the window, you can terminate the view by
calling CSRIDAC.
17-8
When you finishing using a data object, you must terminate access to the object by
calling CSRIDAC.
The following restrictions apply to using window services:
1. When you attach a new task, you cannot pass ownership of a mapped virtual
storage window to the new task. That is, you cannot use the ATTACH or
ATTACHX keywords GSPV and GSPL to pass the mapped virtual storage.
2. While your program is in cross-memory mode, your program cannot invoke
data-in-virtual services; however, your program can reference and update data
in a mapped virtual storage window.
3. The task that obtains the ID (through DIV IDENTIFY) is the only one that can
issue other DIV services for that ID.
4. When you identify a data-in-virtual object using the IDENTIFY service, you
cannot request a checkpoint until you invoke the corresponding UNIDENTIFY
service.
Requirement for NEW Objects: If you specify NEW as the value for object_state,
your system must include SMS, and SMS must be active.
Temporary Object: To identify a temporary object, specify TEMPSPACE as the value
for object_type. Window services assumes that a temporary object is new and must
be created. Therefore, window services ignores the value assigned to object_state.
17-9
17-10
Identifying a Window
You must identify the window through which you will view the object. The window is
a virtual storage area in your address space. You are responsible for obtaining the
storage, which must meet the following requirements:
v The storage must not be page fixed.
v Pages in the window must not be page loaded (must not be loaded by the
PGLOAD macro).
v The storage must start on a 4096 byte boundary and must be a multiple of 4096
bytes in length.
To identify the window, use the window_name parameter. The value supplied for
window_name must be the symbolic name you assigned to the window storage
area in your program.
Defining a window in this way provides one window through which you can view the
object. To define multiple windows that provide simultaneous views of different parts
of the object, see Defining Multiple Views of an Object on page 17-13.
Replace Option: If you specify the replace option, the first time you reference a
block to which a window is mapped, window services replaces the data in the
window with corresponding data from the object. For example, assume you have
requested a view of the first block of a permanent object and have specified the
replace option. The first time you reference the window, window services replaces
the data in the window with the first 4096 bytes (the first block) from the object.
If youve selected the replace option and then call CSRSAVE to update a
permanent object, or call CSRSCOT to update a scroll area, or call CSRSCOT to
update a temporary object, window services updates only the specified blocks that
have changed and to which a window is mapped.
Select the replace option when you want to examine, use, or change data thats
currently in an object.
Retain Option: If you select the retain option, window services retains data that is
in the window. When you reference a block in the window the first time, the block
contains the same data it contained before the reference.
When you select the retain option, window services considers all of the data in the
window as changed. Therefore, if you call CSRSCOT to update a scroll area or a
temporary object, or call CSRSAVE to update a permanent object, window services
updates all of the specified blocks to which a window or scroll area are mapped.
Select the retain option when you want to replace data in an object without regard
for the data that it currently contains. You also use the retain option when you want
to initialize a new object.
17-11
17-12
Span
0
0
1
1
2
0
1
0
1
2
the
the
the
the
the
entire object
first block only
second block through the last block
second block only
third and fourth blocks only
17-13
v An overlapping view means that two or more windows view the same block of
the object. For example, the view overlaps when the second window in the
previous example views the second and third blocks. Both windows view a
common block, the second block.
Non-Overlapping Views
To define multiple windows that have a non-overlapping view, call CSRIDAC once
to obtain the object identifier. Then call CSRVIEW or CSREVW once to define each
window. On each call, specify BEGIN to define the type of operation, and specify
the same object identifier for object_id, and a different value for window_name.
Define each windows view by specifying values for offset and span that create
windows with non-overlapping views.
Overlapping Views
To define multiple windows that have an overlapping view of a permanent object,
define each window as though it were viewing a different object. That is, define
each window under a different object identifier. To obtain the object identifiers, call
CSRIDAC once for each identifier you need. Only one of the calls to CSRIDAC can
specify an access mode of UPDATE. Other calls to CSRIDAC must specify an
access mode of READ.
After calling CSRIDAC, call CSRVIEW or CSREVW once to define each window.
On each call, specify BEGIN to define the operation, and specify a different object
identifier for object_id, and a different value for window_name. Define each
windows view by specifying values for offset and span that create windows with the
required overlapping views.
To define multiple windows that have an overlapping view, define each window as
though it were viewing a different object. That is, define each window under a
different object identifier. To obtain the object identifiers, call CSRIDAC once for
each identifier you need. Then call CSRVIEW or CSREVW once to define each
window. On each call, specify the value BEGIN for the operation type, and specify a
different object identifier for object_id, and a different value for window_name.
Define each windows view by specifying values for offset and span that create
windows with the required overlapping views.
17-14
v The value assigned to span specifies the number of blocks to save. A span of 1
means one block; a span of 2 means two blocks, and so forth. A span of 0 has
special meaning: it requests that window services save all changed blocks to
which a window is mapped.
Window services replaces each block within the range specified by offset and span
providing the block has changed and a window is mapped to the block.
17-15
v The value assigned to span specifies the number of blocks to save. A span of 1
means one block; a span of 2 means two blocks, and so forth. A span of 0 has
special meaning: it requests that window services refresh all changed blocks to
which a window is mapped, or refresh all changed blocks that have been saved
in a scroll area.
Window services refreshes each block within the range specified by offset and span
providing the block has changed and a window or a scroll area is mapped to the
block. At the completion of the refresh operation, blocks from a permanent object
that have been refreshed appear the same as the corresponding blocks on DASD.
Refreshed blocks from a temporary object contain binary zeroes.
17-16
To identify the object, supply an object identifier for object_id. The value supplied for
object_id must be the value you supplied when you established the view.
To identify the window, supply the window name for window_name. The value
supplied for window_name must be the same value you supplied when you
established the view.
To identify the blocks you are currently viewing, supply values for offset and span.
The values you supply must be the same values you supplied for offset and span
when you established the view.
To specify a disposition for the data you are currently viewing, supply a value for
disposition. The value determines what data will be in the window after the CALL to
CSRVIEW completes.
v For a permanent object that has no scroll area:
To retain the data thats currently in the window, supply a value of RETAIN for
disposition.
To discard the data thats currently in the window, supply a value of REPLACE
for disposition. After the operation completes, the window contents are
unpredictable.
For example, assume that a window is mapped to one block of a permanent
object that has no scroll area. The window contains the character string
AAA......A and the block to which the window is mapped contains BBB......B. If
you specify a value of RETAIN, upon completion of the CALL, the window still
contains AAA......A, and the mapped block contains BBB......B. If you specify a
value of REPLACE, upon completion of the CALL, the window contents are
unpredictable and the mapped block still contains BBB......B.
v For a permanent object that has a scroll area or for a temporary object:
To retain the data thats currently in the window, supply a value of RETAIN for
disposition. CSRVIEW or CSREVW also updates the mapped blocks of the
scroll area or temporary object so that they contain the same data as the
window.
To discard the data thats currently in the window, supply a value of REPLACE
for disposition. Upon completion of the operation, the window contents are
unpredictable.
For example, assume that a window is mapped to one block of a temporary
object. The window contains the character string AAA......A and the block to
which the window is mapped contains BBB......B. If you specify a value of
RETAIN, upon completion of the CALL, the window still contains AAA......A and
the mapped block of the object also contains AAA......A. If you specify a value of
REPLACE, upon completion of the CALL, the window contents are unpredictable
and the mapped block still contains BBB......B.
CSRVIEW ignores the values you assign to the other parameters.
When you terminate the view of an object, the type of object that is mapped and
the value you specify for disposition determine whether CSRVIEW updates the
mapped blocks. CSRVIEW updates the mapped blocks of a temporary object or a
permanent objects scroll area if you specify a disposition of RETAIN. In all other
cases, to update the mapped blocks, call the appropriate service before terminating
the view:
17-17
JOB accountinfo,name,CLASS=x,
MSGCLASS=x,NOTIFY=userid,MSGLEVEL=(1,1),REGION=4096K
EXEC PGM=HEWL,PARM=LIST,LET,XREF,REFR,RENT,NCAL,
SIZE=(1800K,128K)
DD
SYSOUT=x
DD
DSNAME=userid.LOADLIB,DISP=SHR
DD
UNIT=SYSDA,SPACE=(TRK,(5,2))
DD
*
OBJDD1(userpgm)
OBJDD2(CSRIDAC,CSRREFR,CSREVW,CSRSCOT,CSRSAVE,CSRVIEW)
userpgm(R)
DD
DSN=userid.OBJLIB,DISP=SHR
DD
DSN=SYS1.CSSLIB,DISP=SHR
The example JCL assumes that the program you are link-editing is reentrant.
17-18
17-19
17-20
DC CL7REPLACE
DC F524288
DC F50
DS CL8
DS F
DS F
DS F
DS F
DS 18F
DS F
DSECT
DS 204800C
END
Name/Token Pairs
A name/token pair consists of a 16-byte character string (name) with 16 bytes of
user data (token). One program creates the name/token pair, assigns the name,
and initializes the token field. Typically, the token is an address of a data structure.
Figure 18-1 shows the name/token pair and indicates its intended use.
Name
Token
Name chosen by
program
Program data
16 bytes
16 bytes
The bytes of the name can have any hexadecimal value and consist of alphabetic
or numeric characters. The name may contain blanks, integers, or addresses.
Names must be unique within a level. Here are some examples.
18-1
v Two task-level name/token pairs owned by the same task cannot have the same
name. However, two task-level name/token pairs owned by different tasks can
have the same name.
v Two home-address-space-level name/token pairs in the same address space
cannot have the same name. However, two home-address-space-level
name/token pairs in different address spaces can have the same name.
Because of these unique requirements you must avoid using the same names that
IBM uses for name/token pairs. Do not use the following names:
v Names that begin with A through I
v Names that begin with X'00'.
The token can have any value.
18-2
Service
Level of pairs
Create (IEANTCR)
v Task
v Home
v Primary
Retrieve (IEANTRT)
v
v
v
v
Task
Home
Primary
System
Level of pairs
Delete (IEANTDL)
v Task
v Home
v Primary
Note: Unauthorized programs cannot delete any pairs
created by authorized programs.
T1
ADDRESS SPACE
TASK 1
18-3
1. Creates the task-level name/token pair (N1,T1) using the IEANTCR callable
service.
2. Retrieves the token at a later time by calling its name (N1) using the IEANTRT
callable service.
3. Deletes the name/token pair by calling its name (N1) using the IEANTDL
callable service.
T2
N3
T3
T1
TASK 1
TASK 2
18-4
18-5
18-6
19-1
DSPSERV LOAD loads specified virtual storage areas of a data space into
central storage.
DSPSERV OUT pages out specified virtual storage areas of a data space
from central storage.
v Request that the system preload multiple pages on a page fault.
REFPAT causes the system to preload pages according to a programs
reference pattern. REFPAT is intended for numerically intensive programs.
Releasing Storage
When your program is finished using an area of virtual storage, it can release the
storage to make the central, expanded, or auxiliary storage that actually holds the
data available for other uses. The decision to release the storage depends on the
size of the storage and when the storage will be used again:
v For large areas (over 100 pages, for example) that will not be used for five or
more seconds of processor time, consider releasing the storage. If you do not
release those pages after you are finished using them:
Your program might be using central storage that could better be used for
other purposes.
Your program might have delays later when the system moves your pages
from central storage to expanded or auxiliary storage.
v Generally, for smaller amounts of storage that will be used again in five seconds
or less, do not release the storage.
Note that releasing storage does not free the virtual storage.
When releasing storage for an address space, use PGRLSE or PGSER with the
RELEASE parameter. As shown in Figure 19-1, if the specified addresses are not
on page boundaries, the low address is rounded up and the high address is
rounded down; then, the pages contained between the addresses are released.
19-2
1 page
address 1
(low)
Figure 19-1. Releasing Virtual Storage
When releasing storage for a data space or hiperspace, use the DSPSERV
RELEASE macro to release the central, expanded or auxiliary storage that actually
holds the data. PGSER RELEASE rejects any attempt to release protected storage,
including storage that is dynamically protected through PGSER PROTECT. The
starting address must be on a 4K-byte boundary and you can release data space
storage only in increments of 4K bytes.
For both address spaces and data spaces, the virtual space remains, but its
contents are discarded. When the using program can discard the contents of a
large virtual area (one or more complete pages) and reuse the virtual space without
the necessity of paging operations, the page release function may improve
operating efficiency.
Loading and paging for address spaces: With the page load function, you have the
option of specifying that the contents of the virtual area is to remain intact or be
released. If you specify RELEASE=Y with PGLOAD or PGSER LOAD, the current
contents of entire virtual 4K pages to be brought in may be discarded and new real
frames assigned without page-in operations; if you specify RELEASE=N, the
contents are to remain intact and be used later. If you specify RELEASE=Y, the
Chapter 19. Processor Storage Management
19-3
page release function will be performed before the page load function. That is, no
page-in is needed for areas defining entire virtual pages since the contents of those
pages are expendable.
Loading and paging for data spaces: DSPSERV LOAD requests the starting
address of the data space area to be loaded and the number of pages that the
system is to load. It does not offer a RELEASE=Y or a RELEASE=N function.
PGOUT, PGSER OUT, and DSPSERV OUT initiate page-out operations for
specified virtual areas that are in central storage. For address spaces, the real
frames will be made available for reuse upon completion of the page-out operation
unless you specify the KEEPREL parameter in the macro. An area that does not
encompass one or more complete pages will be copied to auxiliary storage, but the
real frames will not be freed. DSPSERV LOAD does not have the KEEPREL
function.
The proper use of the page load and page out functions tend to decrease system
overhead by helping the system keep pages currently in use, or soon to be in use,
in central storage. An example of the misuse of the page load function is to load ten
pages and then use only two.
For more information on DSPSERV LOAD and DSPSERV OUT, see Paging Data
Space Storage Areas into and out of Central Storage on page 16-15.
0
FLAGS
1
START
ADDRESS
Byte 0 Flags:
Bit 0
3
FLAGS
(1... ....)
4
END
ADDRESS + 1
Start Address:
The address of the origin of the virtual area to be processed.
Byte 4 Flags:
Bit 0
(1... ....)
This flag indicates the last entry of the list. It is set in
the last doubleword entry in the list.
Bit 1
(.1.. ....)
When this flag is set, the entry in which it is set is
ignored.
Bit 3
(...1 ....)
This flag indicates that a return code of 4 was issued
from a page service function other than PGRLSE.
End Address + 1:
The address of the byte immediately following the end of the virtual area.
19-4
Meaning
0-3
4-7
Flags set by the caller as follows. The flag bits that are described
are the only flag bits intended for customer use.
9-11
Bit
Meaning
19-5
.
.
.
.
.
.
.
.
.
.
.
.
. . .
. . .
. . .
3073
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
.
..
..
..
..
..
..
.....
.....
.....
.....
.....
.....
.....
1024
2048
.
.
.
3072
1048576
First, consider how the system brings data into central storage without using the
information REFPAT provides. At the first reference of the array, the system takes a
page fault and brings into central storage the page (of 4096 bytes) that contains the
19-6
first element. After the program finishes processing the 512th element (40968) in
the array, the system takes another page fault and brings in a second page. To
provide the data for this program, the system takes two page faults for each row.
The following linear representation shows the elements in the array and the page
faults the system takes as the program processes through the array.
1st row
2nd row
3rd row
4th row
last row
...
512th 1024th . . .
element element
1048576th
element
...
By bringing in one page at a time, the system takes 2048 page faults
(83886084096), each page fault adding to the elapsed time of the program.
Suppose, through REFPAT, the system knew in advance that a program would be
using the array in a consistently forward direction. The system could then assume
that the programs use of the pages of the array would be sequential. To decrease
the number of page faults, each time the program requested data that was not in
central storage, the system could bring in more than one page at a time. Suppose
the system brought the next 20 consecutive pages (81920 bytes) of the array into
central storage on each page fault. In this case, the system takes not 2048 page
faults, but 103 (838860881920=102.4). Page faults occur in the array as follows:
rows 1-10
rows 11-20
rows 21-30
rows 31-40
rows 1021-1024
...
The system brings in successive pages only to the end of the array.
Consider another way of referencing this same array. The program references the
first twenty elements in each row, then skips over the last 1004 elements, and so
forth through the array. REFPAT allows you to tell the system to bring in only the
pages that contain the data in the first 20 columns of the array, and not the pages
that contain only data in columns 21 through 1024. In this case, the reference
pattern includes a repeating gap of 8032 bytes (10048) every 8192 bytes
(10248). The pattern looks like this:
skip
skip
skip
skip
. . .
21
1
elements ...
1025
1045
2049
2069
3073
3093
19-7
v The reference unit is 20 elements in size 160 consecutive bytes that the
program references.
v The gap is 1004 elements in size 8032 consecutive bytes that the program
skips over.
Figure 19-3 illustrates this reference pattern and shows the pages that the system
does not bring into central storage.
1st
page
2nd
page
3rd
page
4th
page
5th
page
6th
page
7th
page
2048th
page
Every other page of the data does not come into central storage; those pages
contain only the skipped over data.
Example 2: The reference pattern includes a reference unit of 4800 bytes and a
gap of 3392 bytes. The example assumes that the area to be referenced starts on a
page boundary.
reference units
1st
page
2nd
page
3rd
page
4th
page
5th
page
6th
page
7th
page
2048th
page
Because each page contains data that the program references, the system brings in
all pages.
Example 3: The area to be referenced does not begin on a page boundary. The
reference pattern includes a reference unit of 2000 bytes and a gap of 5000 bytes.
Because the reference pattern includes a gap, the first byte of the reference pattern
must begin a reference unit, as the following illustration shows:
19-8
Start of
reference
pattern
1st
page
2nd
page
3rd
page
4th
page
5th
page
6th
page
7th
page
Because the gap is larger than 4095 bytes, some pages do not come into central
storage. Notice that the system does not bring in the fifth page.
Summary of how the size of the gap affects the pages the system brings into
central storage:
v If the gap is less than 4096 bytes, the system has to bring into central storage all
pages of the array. (See Example 2.)
v If the gap is greater than 4095 bytes and less than 8192, the system might not
have to bring in certain pages. Pages that contain only data in the gap are not
brought in. (See Examples 1 and 3.)
v If the gap is greater than 8191 bytes, the system definitely does not have to bring
in certain pages that contain the gap.
19-9
Figure 19-4 illustrates a reference pattern that includes a reference unit of 2000
bytes and a gap of 5000 bytes. When direction is forward, PSTART must be the
beginning of a reference unit. PEND can be any part of a gap or reference unit.
forward direction
PSTART
1st
page
PEND
2nd
page
3rd
page
4th
page
5th
page
7th
page
6th
page
Figure 19-5 illustrates the same reference pattern and the same area; however, the
direction is backward. Therefore, PSTART must be the last byte of a reference unit
and PEND can be any part of a gap or reference unit.
backward direction
PEND
1st
page
PSTART
2nd
page
3rd
page
4th
page
5th
page
6th
page
7th
page
If the data area is in a data space, use the STOKEN parameter to identify the data
space. You received the STOKEN of the data space from another program or from
the DSPSERV macro when you created the data space. STOKEN=0, the default,
tells the system that the data is in the primary address space.
19-10
Pattern #1:
No uniform gap
xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx ...
20480
16384
12288
8192
0
4096
Characteristics of pattern:
- No uniform gap
- Reference in regular intervals (such as every element) or in irregular intervals
Pattern #2:
xxxxx
xxxxx
0
Uniform gap
20
bytes
5020 5040
bytes bytes
xxxxx
10040
bytes
10060
bytes
xxxxx
15060
bytes
15080
bytes
...
20080
bytes
Characteristics of pattern:
- Gaps of uniform size
- Reference units, uniform in size, that occur in a repeating pattern
How you define the reference pattern depends on whether your programs
reference pattern is like Pattern #1 or Pattern #2.
v With Pattern #1 where no uniform gap exists, the program uses every
element, every other element, or at least most elements on each page of array
data. No definable gap exists. Do not use REFPAT if the reference pattern is
irregular and includes skipping over many areas larger than a page.
The UNITSIZE parameter alone identifies the reference pattern. (Either omit
the GAP parameter or take the default, GAP=0.) UNITSIZE indicates the
number of bytes you want the system to use as a reference unit. Look at
logical groupings of bytes, such as one row, a number of rows, or one
element, if the elements are large in size. Or, you might choose to divide up
the total area, bringing in all the data on a certain number of page faults.
The UNITS parameter tells the system how many reference units to try to
bring in on a page fault. For a reference pattern that begins on a page
boundary and has no gap, the total number of bytes the system tries to bring
into central storage at a time is the value on UNITSIZE times the number on
UNITS, rounded up to the nearest multiple of 4096. See Choosing the
Number of Bytes on a Page Fault on page 19-12 for more information on how
to choose the total number of bytes.
v With Pattern #2 where a uniform gap exists, you tell the system the sizes of
reference units and gaps.
UNITSIZE and GAP parameters identify the reference pattern. Pattern #2 in
Figure 19-6 includes a reference unit of 20 bytes and a gap of 5000 bytes.
Because the gap is greater than 4095, some pages of the array might not
come into central storage.
The UNITS parameter tells the system how many reference units to try to
bring into central storage at a time. What Pages Does the System Bring in
When a Gap Exists? on page 19-8 can help you understand how many bytes
come into central storage at one time.
Chapter 19. Processor Storage Management
19-11
Although the system brings in pages 4096 bytes at a time, you do not have to
specify GAP, UNITS, and UNITSIZE values in increments of 4096.
What if you specify too many bytes? What if you ask the system to bring in so
many pages that, by the time your program needs to use some of those pages,
they have left central storage? The answer is that the system will have to bring
them in again. This action causes an extra page fault and extra system overhead
and reduces the benefit of reference pattern services.
For example, suppose you ask the system to bring in 204800 bytes, or 50 pages, at
a time. But, by the time your program begins referencing the data on the 30th page,
the system has moved that page and the ones after it out of central storage. (It
moved them out because the program did not use them soon enough.) In this case,
your program has lost the benefit of moving the last 21 pages in. Your program
would get more benefit by requesting fewer than 30 pages.
What if you specify too few bytes? If you specify too small a number, the system
will take more page faults than it needs to and you are not taking full advantage of
reference pattern services.
For example, suppose you ask the system to bring in 40960 bytes (10 pages) at a
time. Your programs use of each page is not time-intensive, meaning that the
19-12
program finishes using the pages quickly. The program can request a number
greater than 10 without causing additional page faults.
IBM recommends that you use one of the following approaches, depending on
whether you want to involve your system programmer in the decision.
v The first approach is the easier one. Choose a conservative number of bytes,
around 81920 (20 pages), and run the program. Look for an improvement in the
elapsed time. If you like the results, you might increase the number of bytes. If
you continue to increase the number, at some point you will notice a diminishing
improvement or even an increase in elapsed time. Do not ask for so much that
your program or other programs suffer from degraded performance.
v A second approach is for the program that needs very significant performance
improvements those programs that require amounts in excess of 50 pages. If
you have such a program, you and your system programmer must examine the
programs elapsed time, paging speeds, and processor execution times. In fact,
the system programmer can tune the system with your program in mind and
provide needed paging resources. See z/OS MVS Initialization and Tuning Guide
for information on tuning the system.
REFPAT affects movement of pages from auxiliary and your system programmer
will need the kind of information that the SMF Type 30 record provides. A Type
30 record reports counts of pages moved (between expanded and central and
between auxiliary and central) in anticipation of your programs use of those
pages. It also provides elapsed time values. Use this information to calculate
rates of movement in determining whether to specify a very large number of
bytes for example, an amount greater than 204800 bytes (50 pages).
Each time the system takes a page fault, it brings in 4096 bytes, the systems
reference unit. It brings in one reference unit at a time.
INSTALL,PSTART=FIRSTB,PEND=LASTB,UNITSIZE=4000,GAP=0,UNITS=20
Example 2: The program performs the same process as in the first example, except
the program references few elements on each page. The program runs during the
night hours when contention for the processor and for central storage is light. In this
case, a reasonable value to choose for the number of bytes to come into central
storage on a page fault might be 200000 bytes (around 50 pages). UNITSIZE can
be 4000 bytes and UNITS can be 500. The following REFPAT macro communicates
this pattern:
REFPAT
INSTALL,PSTART=FIRSTB,PEND=LASTB,UNITSIZE=4000,GAP=0,UNITS=500
Chapter 19. Processor Storage Management
19-13
0
bytes
LASTB
8192 12288
bytes bytes
20480
bytes
24576
bytes
32768 36864
bytes bytes
. . .
INSTALL,PSTART=FIRSTB,PEND=LASTB,UNITSIZE=8192,GAP=4096,UNITS=4
where the system is to bring into central storage 32768 (48192) bytes on a page
fault.
19-14
REMOVE,PSTART=FIRSTB,PEND=LASTB
20-1
data1
source
Data Space
X
Addr Space
B
Addr Space
A
S
H
A
R
E
data1
data1
SHARE
target
target
Suppose that Addr Space A contains data that is required by programs in Addr
Space B. A program in Addr Space A can use IARVSERV to define that data to be
shared; that data and the storage it resides in are called the source. The program
also defines storage in Addr Space B to receive a copy of the source; that storage
and its copy of source data are called the target.
The source and its corresponding target form a sharing group. A sharing group
can consist of several target areas and one source. For example, suppose another
program in Addr Space A defines a portion of data1 (in Addr Space A) as source,
and defines a target in Data Space X. That target becomes a member of the
sharing group established previously.
All sharing of data is done on a page (4K) basis. If the source page is already a
member of an existing sharing group, the target becomes a member of that existing
sharing group. A page is called a sharing page if it is a member of a sharing
group.
Programs that access the source or targets are called sharing programs. Each
sharing program accesses the shared virtual storage as it would any other storage,
and may not need to know that the storage is being shared. So, you can allow
programs to share data through IARVSERV without having to rewrite existing
programs.
20-2
20-3
Source View
READONLY
SHAREDWRITE
UNIQUEWRITE
TARGETWRITE
HIDDEN
READONLY
Yes
No
Yes
Yes
Yes
Yes
SHAREDWRITE
Yes
Yes
Yes
Yes
Yes
Yes
UNIQUEWRITE
Yes
Yes
Yes
Yes
Yes
Yes
TARGETWRITE
No
No
Yes
No
No
Yes
HIDDEN (Shared)
No
No
No
No
No
Yes
Non-Shared
Yes
Yes
Yes
Yes
Yes
Yes
No
No
No
No
Yes
HIDDEN (Non-Shared) No
LIKESOURCE
The following apply when using IARVSERV SHARE when changing storage access:
v For source views to be either UNIQUEWRITE or TARGETWRITE, the processor
must have the Suppression-On-Protection (SOP) hardware feature, and a
previous IARVSERV SHARE must have created a view of UNIQUEWRITE or
TARGETWRITE.
20-4
v For target views to be TARGETWRITE, the processor must have the SOP
hardware feature. If a request is made to create a TARGETWRITE view and the
SOP feature is not installed, the request fails with a return code of 8.
v For target views to be UNIQUEWRITE, the SOP hardware feature must be
installed. Also, the request must not specify COPYNOW. If the request specifies
COPYNOW, or the SOP feature is not installed, a UNIQUEWRITE view is not
established, and a separate copy of the data is made.
v For target views created with LIKESOURCE on IARVSERV SHARE, the system
propagates explicit page protection from the source to the target view.
v For source pages that are not shared, if the page is page-protected, the view
created for that page is a SHAREDWRITE view, but the view is flagged as an
explicitly protected view (one that cannot be modified).
The following apply when changing the storage access with IARVSERV
CHANGEACCESS:
v To remove hidden status, you must use an IARVSERV CHANGEACCESS,
FREEMAIN, or DSPSERV DELETE macro.
v To remove explicit read-only protection status, you must use an IARVSERV
CHANGEACCESS, FREEMAIN, DSPSERV DELETE, or PGSER UNPROTECT
macro.
v If a hidden page is hidden because of loss of access to mapped data (such as
through DIV UNMAP), and, if the page is changed from hidden, the data in the
page might be lost.
v Hidden pages cannot be released via a PGSER RELEASE or DSPSERV
RELEASE macro. An attempt would result in an abend with the same reason
code as is used for protected pages.
v Issuing an IARVSERV UNSHARE macro for the original mapped page causes
the data to be retained for that page. The data for the other sharing pages is lost.
References to hidden pages cause an X'0C4' abend, and references to lost
pages cause in a X'028' abend.
v Page-fixed pages and DREF pages cannot be made TARGETWRITE,
UNIQUEWRITE, or HIDDEN.
20-5
IARVRL Fields That You Must Initialize for IARVRL Fields That You Must Initialize for
SHARE
UNSHARE
VRLSVSA
VRLSSTKN (for STOKEN)
VRLSALET (for ALET)
VRLNUMPG
VRLTVSA
VRLTSTKN (for STOKEN)
VRLTALET (for ALET)
VRLNUMPG
VRLTVSA
VRLTSTKN (for STOKEN)
VRLTAKET (for ALET)
For IARVSERV SHARE, if the target area contains pages that belong to an existing
sharing group, MVS performs an implicit UNSHARE to pull those pages out of the
existing sharing group before proceeding. Also, MVS automatically performs an
UNSHARE on any sharing page when the page is being freed by FREEMAIN,
STORAGE RELEASE, or DSPSERV DELETE, or when the pages address space is
ended.
Also, when MVS finds that one page of a range is not acceptable for sharing, MVS
will not complete the SHARE request for that page, nor the rest of the range or
ranges not already processed. You can assume that all pages up to that point were
processed successfully. An abend will be issued and GPR 2 and 3 will contain the
address range list associated with the error page and the storage address of the
page in error, respectively. To remove the SHARE on the successful pages, issue
IARVSERV UNSHARE for the storage ranges up to, but excluding, the error page.
The parameter TARGET_VIEW is required with SHARE only, to tell IARVSERV how
you plan to share the data contained in the source. You have three choices
described in Defining Storage for Sharing Data and Access on page 20-3.
v READONLY does not allow any program accessing the target area to write to it.
An abend results if a program attempts to write to a READONLY target.
v SHAREDWRITE allows any sharing program to write to the target. All those
sharing the target area instantly receive the updates. This view could be very
useful as a communication method for programs.
v UNIQUEWRITE has the property of copy-on-write, which means that MVS
creates a copy of a page for the updating program once the program writes to
that page. The only program that has the change is the program that changed it;
all others continue to use the original page unmodified. This is true whether the
program writes to a source or target page.
A copy-on-write hardware facility is provided for additional performance
improvement. If you need to determine if your processor has the feature, you can
use the CVT mapping macro, and test the CVTSOPF bit. See z/OS MVS Data
Areas, Vol 1 (ABEP-DALT) for details on the CVT mapping macro.
RETAIN is a parameter available only with UNSHARE. RETAIN=NO requests that
MVS remove the target from sharing. The target data is lost. RETAIN=YES requests
that MVS leave the data in the target untouched.
20-6
20-7
Addr Space
Data Space
Buffer31
data
target
16 meg
data
source
Buffer24
data
target
0
20-8
20-9
20-10
1. External time reference (ETR) is the MVS generic name for the IBM Sysplex Timer.
Copyright IBM Corp. 1988, 2002
21-1
Converting Between Time of Day and Date and TOD Clock Formats
You can use the STCKCONV macro to convert a TOD clock value to time of day
and date, specifying the format in which the information will be returned. This
conversion is useful, for example, for producing a report that requires the time and
date to be printed in a certain format.
You can use the CONVTOD macro to convert a time of day and date value to TOD
or ETOD clock format. The macro accepts a time of day and date value in any of
the formats returned by the STCKCONV and TIME macros, and converts that value
to either TOD clock format.
It is recommended that you begin to convert your applications to using the ETOD
format. The extended time-of-day format was required both to address the time
wrapping problem that would occur in the year 2042 and also to provide inproved
resolution necessary for the faster processors as they become available.
Note that if you request ETOD information and your processor is not configured
with the 128-bit extended time-of-day clock, timer services will return the contents of
the 64-bit TOD and will simulate the remaining 64 bits of the ETOD. Conversely, if
you request TOD information and your processor is configured with the extended
time-of-day clock, timer services will return only that portion of the 128-bit ETOD
that corresponds to the 64-bit TOD.
Interval Timing
Time intervals can be established for any task in the job step through the use of the
STIMER or STIMERM SET macros. The time remaining in an interval established
via the STIMER macro can be tested or cancelled through the use of TTIMER
macro. The time remaining in an interval established via the STIMERM SET macro
can be cancelled or tested through the use of the STIMERM CANCEL or STIMERM
TEST macros.
The value of the CPU timer can be obtained by using the CPUTIMER macro. The
CPU timer is used to track task-related time intervals.
The TASK, REAL, or WAIT parameters of the STIMER macro and the
WAIT=YES|NO parameter of the STIMERM SET macro specify the manner in which
the time interval is to be decreased. REAL and WAIT indicate the interval is to be
decreased continuously, whether the associated task is active or not. TASK
indicates the interval is to be decreased only when the associated task is active.
STIMERM SET can establish real time intervals only.
If REAL or TASK is specified on STIMER or WAIT=NO is specified on STIMERM
SET, the task continues to compete with the other ready tasks for control; if WAIT is
specified on STIMER, or WAIT=YES is specified on STIMERM SET, the task is
placed in a WAIT condition until the interval expires, at which time the task is
placed in the ready condition.
When TASK or REAL is specified on STIMER or WAIT=NO is specified on
STIMERM SET, the address of an asynchronous timer completion exit routine can
also be specified. This routine is given control sometime after the time interval
completes. The delay is dependent on the systems work load and the relative
dispatching priority of the associated task. If an exit routine is not specified, there is
21-2
no notification of the completion of the time interval. The exit routine must be in
virtual storage when specified, must save and restore registers as well as return
control to the address in register 14.
Timing services does not serialize the use of asynchronous timer completion
routines.
When you cancel a timer request that specified a timer exit:
1. Specify the TU or MIC parameters to determine whether the cancel operation
was successful. If the STIMERM or TTIMER macro returns a value of zero to
the storage area designated by TU or MIC, then the asynchronous timer
completion exit routine has run or will run because its interval expired before the
cancel operation completed.
2. It is your responsibility to set up a program to determine whether the timer exit
has run; you can have the exit set an indicator to tell you that it has run.
If the STIMERM or TTIMER macro returns a non-zero value to the storage area
designated by TU or MIC, then the time interval was cancelled and the
asynchronous exit will not run.
Figure 21-1 shows the use of a time interval when testing a new loop in a program.
The STIMER macro sets a time interval of 5.12 seconds, which is to be decreased
only when the task is active, and provides the address of a routine called FIXUP to
be given control when the time interval expires. The loop is controlled by a BXLE
instruction.
.
.
STIMER
LOOP
...
TM
BC
BXLE
TTIMER
.
.
NG
...
.
.
USING
FIXUP SAVE
OI
.
.
RETURN
.
.
TIME
DC
TIMEXP DC
TASK,FIXUP,BINTVL=TIME
TIMEXP,X01
1,NG
12,6,LOOP
CANCEL
FIXUP,15
(14,12)
TIMEXP,X01
Provide addressability
Save registers
Time interval expired, set switch in loop
(14,12)
Restore registers
X00000200
X00
The loop continues as long as the value in register 12 is less than or equal to the
value in register 6. If the loop stops, the TTIMER macro causes any time remaining
in the interval to be canceled; the exit routine is not given control. If, however, the
loop is still in effect when the time interval expires, control is given to the exit
routine FIXUP. The exit routine saves registers and turns on the switch tested in the
loop. The FIXUP routine could also print out a message indicating that the loop did
not go to completion. Registers are restored and control is returned to the control
Chapter 21. Timing and Communication
21-3
program. The control program returns control to the main program and execution
continues. When the switch is tested this time, the branch is taken out of the loop.
Caution should be used to prevent a timer exit routine from issuing an STIMER
specifying the same exit routine. An infinite loop may occur.
The priorities of other tasks in the system may also affect the accuracy of the time
interval measurement. If you code REAL or WAIT, the interval is decreased
continuously and may expire when the task is not active. (This is certain to happen
when WAIT is coded.) After the time interval expires, assuming the task is not in the
wait condition for any other reason, the task is placed in the ready condition and
then competes for CPU time with the other tasks in the system that are also in the
ready condition. The additional time required before the task becomes active will
then depend on the relative dispatching priority of the task.
EBCDIC
Character
Hex
Code
EBCDIC
Character
Hex
Code
EBCDIC
Character
Hex
Code
EBCDIC
Character
40
4A
4B
4C
(space)
>
.
<
7B
7C
7D
7E
#
@
99
A2
A3
A4
r
s
t
u
D5
D6
D7
D8
N
O
P
Q
21-4
EBCDIC
Character
(
+
|
&
!
$
*
)
;
/
,
%
>
?
:
Hex
Code
7F
81
82
83
84
85
86
87
88
89
91
92
93
94
95
96
97
98
EBCDIC
Character
"
a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
p
q
Hex
Code
A5
A6
A7
A8
A9
C1
C2
C3
C4
C5
C6
C7
C8
C9
D1
D2
D3
D4
EBCDIC
Character
v
w
x
y
z
A
B
C
D
E
F
G
H
I
J
K
L
M
Hex
Code
D9
E2
E3
E4
E5
E6
E7
E8
E9
F0
F1
F2
F3
F4
F5
F6
F7
F8
EBCDIC
Character
R
S
T
U
V
W
X
Y
Z
0
1
2
3
4
5
6
7
8
Notes:
1. If the display device or printer is managed by JES3, the following characters are
also translated to blanks:
|
"
21-5
21-6
properly presented on, and deleted from, display devices. The descriptor code is
not printed or displayed as part of the message text.
If the user supplies a descriptor code in the WTO macro, an indicator is inserted at
the start of the message. The indicators are: a blank, an at sign (@), an asterisk (*),
or a blank followed by a plus sign (+). The indicator inserted in the message
depends on the descriptor code that the user supplies and whether the user is a
privileged or APF-authorized program or a non-authorized problem program.
Table 21-2 shows the indicator that is used for each descriptor code.
Table 21-2. Descriptor Code Indicators
Descriptor Code
Non-Authorized
Problem Program
1
2
3-10
11
12-13
@
@
blank+
@
blank+
A critical eventual action is an action that the operator must perform, as soon as
possible, in response to a critical situation during the operation of the system. For
example, if the dump data set is full, the operator is notified to mount a new tape on
a specific unit. This is considered a critical action because no dumps can be taken
until the tape is mounted; it is eventual rather than immediate because the system
continues to run and processes jobs that do not require dumps.
Action messages to the operator, which are identified by the @ or * indicator, can
be individually suppressed by the installation. When a program invokes WTO or
WTOR to send a message, the system determines if the message is to be
suppressed. If the message is to be suppressed, the system writes the message to
the hardcopy log and the operator does not receive it on the screen. For more
information on suppressing messages, see z/OS MVS Planning: Operations.
If a program issues a message with descriptor code of 1 or 2, the message is
deleted at address space or task termination. For more information concerning
routing and descriptor codes, see z/OS MVS Routing and Descriptor Codes.
If an application that uses WTO needs to alter a message each time the message
is issued, the list form of the WTO macro may be useful. You can alter the message
area, which is referenced by the WTO parameter list, before you issue the WTO.
The message length, which appears in the WTO parameter list, does not need to
be altered if you pad out the message area with blanks.
A sample WTO macro is shown in Figure 21-2.
21-7
TRACKING COMPLETED.,
(SUBROUTINES CALLED,C),
(ROUTINE TIMES CALLED,L),(SUBQUER,D),
(ENQUER,D),(WRITER,D),
(DQUER,DE),
ROUTCDE=(2,14),DESC=(7,8,9),MF=L
21-8
.
.
XC
WTOR
ECBAD
REPLY
WAIT
.
.
DC
DC
ECBAD,ECBAD
Clear ECB
STANDARD OPERATING CONDITIONS?
REPLY,3,ECBAD,ROUTCDE=(1,15)
ECB=ECBAD
F0
Cbbb
When a WTOR macro is issued, any console receiving the message has the
authority to reply. The first reply received by the system is returned to the issuer of
the WTOR, providing the syntax of the reply is correct. If the syntax of the reply is
not correct, another reply is accepted. The WTOR is satisfied when the system
moves the reply into the issuers reply area and posts the event control block. Each
console that received the original WTOR also receives the accepted reply unless it
is a security message. A security message is a WTO or WTOR message with
routing code 9. No console receives the accepted reply to a security message. A
console with master authority may answer any WTOR, even if it did not receive the
original message.
21-9
There may be some unsolicited messages that will not be queued to any console at
a receiving system. In this case, all of the messages are written to the system log,
and action messages are sent to the consoles with the UD attribute.
21-10
21-11
Using console names rather than IDs can also avoid confusion when a console ID
might change. If your installation has set up a sysplex environment, and uses
console IDs to identify consoles, those IDs can change from one IPL to the next, or
when systems are added or removed from the sysplex. A console ID is not
guaranteed to be associated with one console for the life of a sysplex.
To determine the name of a console when you supply the ID, do the following:
1. Clear the CONVCON parameter list by setting it to zeros.
2. Initialize the following fields in the parameter list:
v The version ID (CONVVRSN)
v The acronym (CONVACRO)
v The console ID (CONVID)
v The flag indicating that you are supplying the console ID (flag CONVPID in
CONVFLGS)
3. Issue the CONVCON macro.
When CONVCON completes, the console name is in the parameter list field
CONVNAME, and register 15 contains a return code.
To determine the ID of a console when you supply the name, do the following:
1. Clear the CONVCON parameter list by setting it to zeros.
2. Initialize the following fields in the parameter list:
v The version ID (CONVVRSN)
v The acronym (CONVACRO)
v The console name (CONVFLD)
v The flag bit indicating that you are supplying the console name (flag
CONVPFLD in CONVFLGS)
If the console name in CONVFLD is less than 10 characters, pad the name with
blanks.
The installation defines console names at initialization time in the CONSOLxx
member of Parmlib. You can use the DISPLAY CONSOLES command to
receive a list of defined names.
3. Issue the CONVCON macro.
When CONVCON completes, the console ID will be in the parameter field CONVID.
21-12
21-13
21-14
22-1
group messages for each program, component, or other category into separate
PDS members. These data sets are the applications install message files. The
logical record length of the data set should be variable length of 259, and the
block size 23476. IBM recommends that you put IBM messages first in a PDS
concatenation. If you are not translating IBM messages, you can still use the
same recommended logical record length and block size.
2. Validate the applications install message files by running each PDS through the
message compiler. See Compiling Message Files on page 22-8 for details on
using the compiler. The MMS message compiler replaces the entire run-time
message file, so create a test run-time message file for each language, using
names different from those containing IBM-supplied messages. Creating a test
run-time message file enables you to verify the new messages without
disturbing the existing system run-time message files and current message
translation.
3. After a clean compile, add your PDS members into the systems install message
files as new members.
4. Update the system run-time message files by running the systems install
message files through the message compiler. See Updating the System
Run-Time Message Files on page 22-11 for details on updating the system
run-time message files.
Figure 22-1 illustrates the process of preparing messages for translation.
IBM
Installmessagefiles
IBMmessages
Install
MVS
Tape
PDS
PDS
Eng
Msgs
JPN
Msgs
PDS
Lang
X
Run-time
messagefiles
formatted
messages
Application
installmessagefiles
PDS
PDS
Eng
Msgs
JPN
Msgs
MMS
message
compiler
Lang
X
PDS
Lang
X
Error
Report
(Sysout
dataset)
22-2
Eng
Msgs
JPN
Msgs
1&2
3-5
7-14
15-22
23-38
Service level applicable to the member, padded on the right with blanks.
22-3
Example
Description
1&2
.V
Version record
3-5
ENU
DBCS indicator
7-14
JBB44N1
FMID
15-22
5695-047
Product identifier
23-38
005
1-10
Message identifier (msgid). A message identifier can be 1 to 10 characters long, padded with EBCDIC
blanks, if necessary, so that it totals ten characters. The first character must be alphabetic. A message
identifier cannot contain double-byte characters and cannot contain embedded blanks.
Ensure that the message identifiers for your application program messages do not conflict with existing MVS
message identifiers. To avoid conflict, do not begin a message identifier with the letters A through I.
Examples of message identifiers are:
v IKJ52301I
v IEF12345W
v HASP000
v IEF123I
v OLDMSGID
Note that MMS will remove the first character of any message identifier in the form xmsgid before
processing, and will replace it after processing. x is any character that is not uppercase alphabetic, such as
$ or 1.
22-4
11 & 12
Line number (ll). If the message is a single-line message, leave columns 11 and 12 blank. For a multi-line
message, assign line numbers sequentially within the message. Line numbers do not have to be contiguous.
Valid numbers are 01 to 99.
Ensure that message line numbers for a translated skeleton match the line numbers of the corresponding
U.S. English message skeleton.
Note: Ensure that corresponding skeletons (same message identifier and line number) of multi-line
messages contain the same substitution tokens. For example, if substitution tokens &1. and &2=date. are on
line 01 of a two-line U.S. English message skeleton, these tokens must appear on line 01 of a translated
skeleton. The following is an example of a multi-line message skeleton:
MSGID01
MSGID01
MSGID01
13-15
01
02
03
Format number (fff). If only one format is defined for a particular message identifier, leave columns 13-15
blank.
Use format numbers to maintain compatibility with existing messages. Using format numbers for new
messages is not recommended.
Format numbers distinguish among message skeletons that have one message identifier but have several
different text strings or substitution tokens. The message identifier alone cannot identify the message as
unique in these cases. The format number, together with the message identifier, identifies the message.
If more than one format is defined for a particular message identifier, assign a unique format number to each
skeleton for that message identifier. Valid numbers are 001 to 999. You do not have to assign the numbers
sequentially. Ensure that the format number in the translated skeleton matches the format number in the
U.S. English message skeleton.
Each message ID might have several format numbers if that message has variable text.
16
17 & 18
IEFP0001
You can also use translated line numbers for English message skeletons if your input to the TRANMSG
macro is an MPB (message parameter block). In this case, TRANMSG will return all message lines in
English for a given message ID.
If a line of a U.S. English message translates to only one line, leave the translated line number blank.
19
20 +
llfffmm text
HASP001
IACT0012W
IACT0012W
HASP999I
HASP999I
HASP999I
001
002
01
02
03
22-5
IEFA003F
001
IEFA003F
002
001
002
Substitution tokens indicate substitution, or variable, data, such as a data set name
or a date in the message text. Substitution tokens must start with a token start
trigger character, an ampersand (&), and end with a token end trigger character, a
period (.). These characters are part of the token and are not included in the
message text display. You may include an ampersand (&) in the text as long as it
does not have a period following it in the format of a substitution token. Substitution
tokens must be SBCS characters and follow the form &name[=format] where:
name
format
The total length of name and =format must not be greater than 16 bytes.
If you do not include a format descriptor for a particular substitution token, the MVS
message service treats the token as TEXT.
The date and time tokens are formatted according to the language. There are no
defaults. You must supply your own formats in the CNLcccxx member.
22-6
22-7
The following is a sample job that invokes IDCAMS to create the linear data set
named SYS1.ENURMF on the volume called MMSPK1. When IDCAMS creates the
data set, it is empty. Note that there is no RECORDS parameter; linear data sets do
not have records.
//DEFCLUS JOB MSGLEVEL=(2,0),USER=IBMUSER
//*
//*
DEFINE DIV CLUSTER
//*
//DCLUST EXEC PGM=IDCAMS,REGION=4096K
//SYSPRINT DD SYSOUT=*
//MMSPK1 DD UNIT=3380,VOL=SER=MMSPK1,DISP=OLD
//SYSIN
DD *
DELETE (SYS1.ENURMF) CL PURGE
DEFINE CLUSTER (NAME(SYS1.ENURMF) VOLUMES(MMSPK1) CYL(1 1) SHAREOPTIONS(1,3) LINEAR) DATA
(NAME(SYS1.ENURMF.DATA))
/*
Figure 22-2. Sample job to invoke IDCAMS to obtain a data set for the run-time message
files
EXEC
DD
DD
DD
PGM=CNLCCPLR,
PARM=(lang,dbcs)
DSN=msg_pds,DISP=SHR
DSN=msg_div_obj,DISP=(OLD,KEEP,KEEP)
SYSOUT=*
Figure 22-3. Using JCL to Invoke the Compiler with a single PDS as input
22-8
Figure 22-4. Using JCL to Invoke the Compiler with a concatenation of partitioned Data Sets
as input
PROC 0
FREE DD(SYSUT1,SYSUT2,SYSPRINT)
ALLOC DD(SYSUT1) DSN(msg_pds) SHR
ALLOC DD(SYSUT2) DSN(msg_div_obj) OLD
ALLOC DD(SYSPRINT) DSN(*)
CALL SYS1.LINKLIB(CNLCCPLR) lang,dbcs
SET &RCODE = &LASTCC
FREE DD(SYSUT1,SYSUT2,SYSPRINT)
EXIT CODE(&RCODE)
/*
/*
/*
/*
FREE DDS
ALLOC INPUT FILE
ALLOC OUTPUT FILE
ALLOC SYSPRINT
*/
*/
*/
*/
Figure 22-5. Using a TSO/E CLIST to Invoke the Compiler with a single PDS input
PROC 0
FREE DD(SYSUT1,SYSUT2,SYSPRINT)
ALLOC DD(SYSUT1) DSN(msg_pds1 +
ALLOC DD(SYSUT1) DSN msg_pds1 +
:
:
ALLOC DD(SYSUT1) DSN msg_pdsn) SHR
ALLOC DD(SYSUT2) DSN(msg_div_obj) OLD
ALLOC DD(SYSPRINT) DSN(*)
CALL SYS1.LINKLIB(CNLCCPLR) lang,dbcs
SET &RCODE = &LASTCC
RETURN CODE
*/
FREE DD(SYSUT1,SYSUT2,SYSPRINT)
EXIT CODE(&RCODE)
/* FREE DDS
/* ALLOC INPUT FILE
/* ALLOC INPUT FILE
*/
*/
*/
*/
*/
*/
*/
*/
Figure 22-6. Using a TSO/E CLIST to Invoke the Compiler with a concatenation of partitioned
Data Set as input
22-9
Figure 22-7. Using a REXX exec to Invoke the Compiler with a single PDS as input
Figure 22-8. Using a REXX exec to Invoke the Compiler with a concatenation of partitioned
Data Sets as input
The lowercase variables used in the preceding examples are defined as follows:
msg_pds
is the name of the install message file containing all the applications message
skeletons for a specific language. msg_pds must be a partitioned data set.
msg_pds1
is the name of the install message file containing the the first applications
message skeletons for a specific language. msg_pds1 must be a partitioned
data set.
msg_pds2
is the name of the install message file containing the the second applications
message skeletons for a specific language. msg_pds2 must be a partitioned
data set.
22-10
msg_pdsn
is the name of the install message file containing the the last applications
message skeletons, in the message skeleton PDS concatenation, for a specific
language. msg_pdsn must be a partitioned data set.
Note: When you specify a concatenation of partitioned data set as input to the
MVS message service (MMS) compiler, all members within the
partitioned data set will be processed. The MMS compiler will process all
members within the concatenation of partitioned data sets without regard
to uniqueness of member names. If two partitioned data sets specified in
the concatenation have members with the same name, both members
will be processed by the MMS compiler.
msg_div_obj
specifies the name of the run-time message file that is to contain the compiled
message skeletons for the language. msg_div_obj must be a linear VSAM data
set suitable for use as a data-in-virtual object.
lang,dbcs
specifies two parameters. lang is the 3-character language code of the
messages contained in the install message file. dbcs indicates whether this
language contains double-byte characters. The values for dbcs are y for yes
and n for no.
After creating run-time message files by compiling the install message file,
determine the amount of storage the run-time message files used. This calculation
is necessary when compiling these messages in the systems run-time message
files. The following JCL example shows you how to run a report showing the
storage used.
//LISTCAT JOB MSGLEVEL=(1,1)
//MCAT
EXEC PGM=IDCAMS,REGION=4096K
//SYSPRINT DD SYSOUT=*
//SYSIN
DD *
LISTCAT LEVEL(msg_div_obj) ALL
/*
Meaning
Successful completion.
Processing complete. Run-time message files are complete but the compiler
generated warnings.
Processing complete. The run-time message files are usable but incomplete.
12
You should correct all errors and recompile if you receive any return code other
than 0.
22-11
v Add the applications install message files to the systems install message files,
or add a DD statement to the JCL used to compile the systems install message
files.
v Allocate a data set for the new system run-time message files. Assign unique
names to the run-time message files, ensuring that the names are different from
those your installation is currently using. Use the storage requirements you
received from running the IDCAMS report.
v Compile the systems install message files into new system run-time message
files using the message compiler for each install message file. See Compiling
Message Files on page 22-8.
v Identify your new run-time message files to the system by creating a new
MMSLSTxx parmlib member. See z/OS MVS Initialization and Tuning Reference
for information on creating a parmlib member.
v Activate your new parmlib member and run-time message files by issuing the
SET MMS=xx command. See z/OS MVS System Commands for information on
the SET MMS=xx command.
You are using the same invocations to update the system run-time message files as
you do to verify message skeletons. The difference is that the resulting system
run-time message files are what MMS can use to translate messages for the
system and applications.
22-12
22-13
When you invoke TRANMSG, MMS will process this message as three separate
lines of text.
v Set the MIOCONT flag on the MIO message entry structure for lines subsequent
to the first (lines two and three in the following example). The MIOCONT flag
informs MMS that a specific line of text is associated with the previous line of
text. MMS associates the message identifier of the first line with the message
text of the subsequent lines. z/OS MVS Programming: Assembler Services
Reference IAR-XCT provides a coding example that translates a multi-line
message.
The following is an example of a multi-line message that contains continuation
lines, that is, only the first line contains a message identifier in the skeleton. You
must include all lines in the TRANMSG invocation.
MSGID01 THIS IS LINE ONE OF THIS MULTI-LINE MESSAGE
THIS IS LINE TWO OF THIS MULTI-LINE MESSAGE
THIS IS LINE THREE OF THIS MULTI-LINE MESSAGE
Figure 22-9 shows how an application program uses the TRANMSG macro.
System run-time
message file
Application Program
MIO
Language
code
Address of
English
messages
Address of
output buffer
English messages
MPBs
MTBs
Self-defined
text
TRANMSG
Formatted
messages
MIO
Japanese messages
Address of
Japanese
Messages
MTB
22-14
22-15
you want to invoke TRANMSG several times with one MPB. For example, if you
have an MPB associated with a message that you will translate in several
languages, you can change only the language code in the MIO, and issue
TRANMSG.
Once you have built an MPB for a message, you can issue TRANMSG to return the
text of the message in a message text block (MTB). If the requested language is
not available, TRANMSG returns the message number and its substitution data as
a text string in the output area.
22-16
Code
Language Name
Principal Country
CHT
Traditional Chinese
R.O.C.
CHS
Simplified Chinese
P.R.C.
DAN
Danish
Denmark
DEU
German
Germany
DES
Swiss German
Switzerland
ELL
Greek
Greece
ENG
UK English
United Kingdom
ENU
US English
United States
ESP
Spanish
Spain
FIN
Finnish
Finland
FRA
French
France
FRB
Belgian French
Belgium
FRC
Canadian French
Canada
FRS
Swiss French
Switzerland
Table 22-4. Languages Available to MVS Message Service (continued). These languages
may not necessarily be available to your installation.
Code
Language Name
Principal Country
ISL
Icelandic
Iceland
ITA
Italian
Italy
ITS
Swiss Italian
Switzerland
JPN
Japanese
Japan
KOR
Korean
Korea
NLD
Dutch
Netherlands
NLB
Belgian Dutch
Belgium
NOR
Norwegian
Norway
PTG
Portuguese
Portugal
PTB
Brazil Portuguese
Brazil
RMS
Rhaeto-Romanic
Switzerland
RUS
Russian
USSR
SVE
Swedish
Sweden
THA
Thai
Thailand
TRK
Turkish
Turkey
22-17
***********************************************************************
*
LR
R2,R4
A
R2,MPBL
USING VARS,R2
*
UPDTMPB MPBPTR=(R4),MPBLEN=MPBL,SUBOOFST=VARS,
C
TOKEN=TOKN,TOKLEN=TOKL,TOKTYPE=TOKT,
C
SUBSDATA=SDATA,SUBSLEN=SDATAL
*
USING MIO,R3
LA
R3,VARSLEN
OBTAIN LENGTH OF VARS AREA
AR
R3,R2
CALCULATE ADDRESS MIO
LA
R5,MLEN
GET LENGTH OF MIO
AR
R5,R3
CALCULATE ADDRESS OF OUTPUT BUFFER
ST
R4,VARSINBF
CREATE ADDRESS LIST
*
***********************************************************************
*
ISSUE TRANSLATE TO OBTAIN MESSAGE TEXT REPRESENTED BY THE
*
*
CREATED MPB
*
***********************************************************************
*
TRANMSG MIO=MIO,MIOL=MIOLEN,INBUF=(VARSINBF,ONE),
C
OUTBUF=(R5),OUTBUFL=OUTAREAL,LANGCODE=LC
*
***********************************************************************
*
FREE STORAGE AREA
*
***********************************************************************
*
FREEMAIN RU,LV=STORLEN,SP=SP230,A=(4)
*
L
13,SAVE+4
LM
14,12,12(13)
BR
14
DROP
***********************************************************************
MPBL
DC
A(MPBLEN)
MSGID
DC
CL10MSGID2
MIDLEN DC
A(MIDL)
TOKN
DC
CL3DAY
TOKL
DC
F3
TOKT
DC
CL13
SDATA
DC
CL13
SDATAL DC
A(SDL)
MIOLEN DC
A(MLEN)
OUTAREAL DC
A(STORLEN-(MPBLEN+VARSLEN+MLEN))
ONE
DC
F1
LC
DC
CL3JPN
SAVE
DC
18F0
SP230
EQU 230
STORLEN EQU 512
SDL
EQU 6
MIDL
EQU 6
MPBLEN EQU (MPBVDAT-MPB)+(MPBMID-MPBMSG)+(MPBSUB-MPBSB)+MIDL+SDL
MLEN
EQU (MIOVDAT-MIO)+MIOMSGL
R1
EQU 1
R2
EQU 2
R3
EQU 3
R4
EQU 4
R5
EQU 5
***********************************************************************
DSECT
CNLMMPB
CNLMMCA
CNLMMIO
VARS
DSECT
22-18
VARSINBF DS
F
VARSAREA DS
CL24
VARSLEN EQU *-VARS
END TRANSMPB
22-19
22-20
23-1
To use the data compression and data expansion services, you need the
information that the query service provides. Invoke the query service before
invoking either the data compression or data expansion services.
The query service is available in an MVS/ESA version and an MVS/XA version.
Programs running under MVS/ESA can use either version. Programs running
under MVS/XA can use only the MVS/XA version, and there are certain
restrictions. See Running under an MVS/XA System on page 23-3 for further
details.
Table 23-1 summarizes the services available, and the systems under which these
services can run.
Table 23-1. Summary of Data Compression and Expansion Services
SYSTEM
MVS/ESA
Version of Service
MVS/XA
Version of Service
MVS/ESA
Compression
Expansion
Query
Expansion
Query
MVS/XA
Not applicable
Expansion
Query
Note: These services do not provide a recovery routine (for example, ESTAE or
FRR) because it would not contribute to reliability or availability.
23-2
you do when running under MVS/XA. See Running under an MVS/XA System for
details on invoking the MVS/XA version.
An alternative approach for a program that must expand data on both MVS/ESA
and MVS/XA is to test the level of the MVS system at execution time to determine
which version of the services to use. Figure 23-1 provides an example of the code
you might use to conduct this test.
.
.
.
*
* TEST FOR MVS/ESA
*
TM
CVTDCB,CVTOSEXT
BNO SP2CHK
TM
CVTOSLV0,CVTXAX
BNO SP2CHK
.
.
.
*
* TEST FOR MVS/XA
*
SP2CHK TM
CVTDCB,CVTMVSE
BNO
SP1
.
.
.
*
* CONTINUE CODING
*
SP1
...
.
.
.
*
* MAP THE COMMUNICATIONS VECTOR TABLE (CVT)
*
CVT DSECT=YES
.
.
.
*
Figure 23-1. Testing the Level of the MVS System at Execution Time
23-3
1. Load the CSRCEXA load module from SYS1.MIGLIB, using the LOAD macro.
You must do so while your program is in task mode. See z/OS MVS
Programming: Assembler Services Reference ABE-HSP for LOAD macro
syntax.
2. Save the entry point address and place it in a general purpose register (GPR)
so you can pass it to the CSRCESRV macro.
3. Invoke the query service by coding the CSRCESRV macro specifying
SERVICE=QUERY and VECTOR=(reg), where reg is the GPR containing the
entry point address of CSRCEXA. The macro returns the information you need
to invoke the data expansion service.
4. Invoke the data expansion service by coding the CSRCESRV macro specifying
SERVICE=EXPAND and VECTOR=(reg), where reg is the GPR containing the
entry point address of CSRCEXA.
23-4
Meaning
Symbol size
Symbol size
Symbol size
Symbol size
Symbol size
23-5
(CD), and expansion dictionary (ED), and a DD statement for file OBJS, which
represents the library containing the object decks. The following instructions
linkage editor control statements define a dictionary with the name DICT that,
when loaded, will have the compression dictionary followed by the expansion
dictionary, and will begin on a page boundary.
ORDER CD(P),ED
INCLUDE OBJS(CD)
INCLUDE OBJS(ED)
NAME DICT(R)
23-6
The target/source address and length fields are updated analogously to the
corresponding operands of the MVCL instruction, so that you can tell upon
completion of the operation how much data was processed and where you might
want to resume if you wanted to continue the operation.
Suppose that you had compressed a large area but wanted to expand it back into a
small area of 80-byte records. You might do the expansion as follows:
LA 2,MYCBLOCK
USING CMPSC,2
XC CMPSC(CMPSC_LEN),CMPSC
OI CMPSC_FLAGS_BYTE2,CMPSC_SYMSIZE_1
OI CMPSC_FLAGS_BYTE2,CMPSC_EXPAND
L
3,EDICTADDR
Address of expansion dictionary
ST
3,CMPSC_DICTADDR
Set dictionary address
L
3,EXPADDR
ST
3,CMPSC_SOURCEADDR
Set compression area
L
3,EXPLEN
ST
3,CMPSC_SOURCELEN
Set compression length
LA
3,WORKAREA
ST
3,CMPSC_WORKAREAADDR
Set work area address
DS
0H
Label to continue
MORE
*
* Your code to allocate an 80-byte output area would go here
*
ST x,CMPSC_TARGETADDR
Save target expansion area
LA 3,80
Set its length
ST 3,CMPSC_TARGETLEN
Set expansion length
CSRCMPSC CBLOCK=CMPSC
Expand
C
15,=AL4(CMPSC_RETCODE_TARGET) Not done, target used up
BE MORE
Continue with operation
DROP 2
.
.
DS 0F
Align parameter on word boundary
MYCBLOCK DS (CMPSC_LEN)CL1
CBLOCK Parameter
EXPADDR DS A
Input expansion area
EXPLEN DS F
Length of expansion area
EDICTADDR DS A
Address of expansion dictionary
DS 0D
Doubleword align work area
WORKAREA DS CL192
Work area
CSRYCMPS ,
Get mapping and equates
Note that this code loops while the operation is not complete, allocating a new
80-byte output record. It does not have to update the CMPSC_BITNUM,
CMPSC_SOURCEADDR, or CMPSC_SOURCELEN fields, because the service
sets them up for continuation of the original operation.
If running in AR mode, the example would also have set the
CMPSC_TARGETALET and CMPSC_SOURCEALET fields. The XC instruction
zeroed those fields as needed when running in primary ASC mode.
23-7
The remaining three topics in this chapter describe compression and expansion
processing and the dictionary entries in much greater detail. If you plan to use the
CSRBDICT exec to build your dictionary, you do not need to read these topics. If
you plan to build your own dictionary, you will want to read:
v Compression Processing
v Expansion Processing on page 23-9
v Dictionary Entries on page 23-9
Compression Processing
The compression dictionary consists of a specified number of 8-byte entries. The
first 256 dictionary entries correspond to the 256 possible values of a byte and are
referred to as alphabet entries. The remaining entries are arranged in a downward
tree, with the alphabet entries being the topmost entries in the tree. That is, an
alphabet entry may be a parent entry and contain the index of the first of one or
more contiguous child entries. A child entry may, in turn, be a parent and point to its
own children. Each entry may be identified by its index, meaning the positional
number of the entry in the dictionary; the first entry has an index of 0.
An alphabet entry represents one character. A nonalphabet entry represents all of
the characters represented by its ancestors and also one or more additional
characters called extension characters. For compression, the system uses the first
character of an input string as an index to locate the corresponding alphabet entry.
Then the system compares the next character or characters of the string against
the extension character or characters represented by each child of the alphabet
entry until a match is found. The system repeats this process using the children of
the last matched entry, until the last possible match is found, which might be a
match on only the alphabet entry. The system uses the index of the last matched
entry as the compression symbol.
The first extension character represented by a child entry exists as either a child
character in the parent or as a sibling character. A parent can contain up to four or
five child characters. If the parent has more children than the number of child
characters that can be in the parent, a dictionary entry named a sibling descriptor
follows the entry for the last child character in the parent. The sibling descriptor can
contain up to six additional child characters, and a dictionary entry named a sibling
descriptor extension can contain eight more child characters for a total of fourteen.
These characters are called sibling characters. The corresponding additional child
entries follow the sibling descriptor. If necessary, another sibling descriptor follows
the additional child entries, and so forth. The dictionary entries that are not sibling
descriptors or sibling descriptor extensions are called character entries.
23-8
If a nonalphabet character entry represents more than one extension character, the
extension characters after the first are in the entry; they are called additional
extension characters. The first extension character exists as a child character in the
parent or as a sibling character in a sibling descriptor or sibling descriptor
extension. The nonalphabet character entries represent either:
v If the entry has no children or one child, from one to five extension characters.
v If the entry has more than one child, one or two extension characters. If the entry
represents one extension character, it can contain five child characters. If it
represents two extension characters, it can contain four child characters.
Expansion Processing
The dictionary used for expansion also consists of a specified number of 8-byte
entries. The two types of entries used for expansion are:
v Unpreceded entries
v Preceded entries
The compression symbol, which is an index into the dictionary, locates that indexs
dictionary entry. The symbol represents a character string of up to 260 characters. If
the entry is an unpreceded entry, the expansion process places at offset 0 from the
current processing point the characters designated by that entry. Note that the first
256 correspond to the 256 possible values of a byte and are assumed to designate
only the single character with that byte value.
If the entry is a preceded entry, the expansion process places the designated
characters at the specified offset from the current processing point. It then uses the
information in that entry to locate the preceding entry, which may be either an
unpreceded or a preceded entry, and continues as described previously.
The sibling descriptor extension entries described earlier are also physically located
within the expansion dictionary.
Dictionary Entries
The following notation is used in the diagrams of dictionary entries:
{cc}
...
CCT
16
24
32
40
48
56
63
23-9
{EC}
ACT
3
11
24
32
40
48
56
63
ACT
EC
{EC}
CINDEX
CC
24
63
XXXXX
A 5-bit field (CMPSCDICT_CE_EXCHILD) with the first bit indicating
whether it is necessary to examine the character entry for the child
character (looking either for additional extension characters or more
children). The other bits are ignored when CCT=1.
ACT
CINDEX
A 13-bit field (CMPSCDICT_CE_FIRSTCHILDINDEX) indicating the index of
the first child. The index for child n is then
CMPSCDICT_CE_FIRSTCHILDINDEX + n-1.
EC
CC
CCT
23-10
D
1011
CINDEX
{EC}
24
CC
n
CC
n+8
63
CINDEX
A 13-bit field (CMPSCDICT_CE_FIRSTCHILDINDEX) indicating the index of
the first child. The index for child n is
CMPSCDICT_CE_FIRSTCHILDINDEX + n-1.
EC
CC
SCT
16
{SC}
SC
24
32
40
48
56
63
23-11
000
0
EC
8
{EC}
16
24
32
40
48
56
63
CSL
EC
PSL
PrecIndex
3
EC
16
{EC}
24
Offset
32
40
48
56
63
PrecIndex
A 13-bit field (CMPSCDICT_UE_PRECENTINDEX) indicating the index of
the dictionary entry with which processing is to continue.
23-12
EC
SC
16
24
32
40
48
56
63
Dictionary Restrictions
Set up the compression dictionary so that:
v The algorithm does not create a compression symbol that represents a string of
more than 260 characters.
v No character entry has more than 260 total children, including all sibling
descriptors for that character entry.
v No character entry has a child count greater than 6.
v No character entry has more than 4 additional extension characters when there
are 0 or 1 child characters.
v No sibling descriptor indicates 0 sibling characters.
Set up the expansion dictionary so that:
v Expansion of a compression symbol does not use more than 127 dictionary
entries.
Other Considerations
If the first child character matches, but its additional extension characters do not
match and the next child character is the same as the first, the system continues
compression match processing to try to find a compression symbol that contains
that child character. If, however, the next child character is not the same,
compression processing uses the current compression symbol as the result. You
can set up the child characters for an entry to take advantage of this processing.
If a parent entry does not have the examine child bit (CMPSCDICT_CE_EXCHILD)
on for a particular child character, then the child character entry should not have
any additional extension characters or children. The system will not check the entry
itself for additional extension characters or children.
If a parent or sibling descriptor entry does not have the examine sibling bit
(CMPSCDICT_CE_EXSIB) on for a particular sibling character, then the character
entry for that sibling character should not to have any additional extension
characters or children. The system will not check the entry itself for additional
extension characters or children.
23-13
Example 1
Suppose the dictionary looks like the following:
Hexadecimal Entry
Description
C1
100
101
200
201
Hexadecimal
Entry
C1
CCT
2
0
100
101
XXXXX
11000
CCT
2
3
CCT
0
0
201
YY D
00 0
CINDEX
100
1011
CC
'C'
CC
'B'
24
32
40
63
200
XXXXX
01000
XXXXX
00000
3
CCT
0
0
YY D
00 1
1011
24
32
EC
'1'
11
24
11
24
CC
'E'
40
63
CC
'D''
32
EC
'1'
ACT
4
8
CC
'D''
EC
'1'
ACT
2
XXXXX
00000
3
CINDEX
200
40
56
63
56
63
EC
'4'
EC
'3'
EC
'2'
32
48
40
48
If the input string is AD, the output string will consist of 2 compression symbols: one
for A and one for D. When examining the dictionary entry for character A, the
system determines that none of As children match the next input character, D, and
so returns the compression symbol for A. When examining the dictionary entry for
character D, the system determines that it has no children, and so returns the
compression symbol for D.
23-14
If the input string is AB, the output string will consist of 1 compression symbol for
both input characters. When examining the dictionary input for character A, the
system determines that As first child character matches the next input character, B,
and so looks at entry X'100'. Because that entry has no additional extension
characters, a match is determined. Because there are no further input characters,
the scan concludes.
If the input string is AC, the output string will consist of 2 compression symbols: one
for A and one for C. When examining the dictionary input for character A, the
system determines that As second child character matches the next input
character, C, and so looks at entry X'101'. Because that entry has an additional
extension character, but the input string does not contain this character, no match is
made, and the output is the compression symbol for A. Processing character C
results in the compression symbol for C.
If the input string is AC1, the output string will consist of 1 compression symbol.
When examining the dictionary input for character A, the system determines that As
second child character matches the next input character, C, and so looks at entry
X'101'. Because that entry has an additional extension character, and the input
string does contain this character, 1, a match is made, and the output is the
compression symbol for AC1.
Similarly, the set of input strings longer than one character compressed by this
dictionary are:
Hexadecimal Symbol
String
100
AB
101
AC1
200
AC1D12
201
AC1E1234
The compression symbol is the index of the dictionary entry. Based on this, you can
see that the expansion dictionary must result in the reverse processing; for
example, if a compression symbol of X'201' is found, the output must be the string
AC1E1234. See Expansion Dictionary Example on page 23-19 for expansion
dictionary processing.
Description
C2
400
401-404
405
23-15
23-16
405
406
407-413
414
415
416
Hexadecimal
Entry
C2
CCT
6
0
400
401
402
403
404
405
32
CC
'5'
CC
'4'
CC
'3'
40
Child
Child
Child
Child
Child
Child
Child
Child
Child
Child
Child
Child
character
character
character
character
character
character
character
character
character
character
character
character
32
SC
'J'
24
16
63
SC
'D'
SC
'L'
SC
'K'
40
SC
'F'
56
48
40
32
SC
'E'
SC
'M'
48
63
SC
'N'
56
63
56
63
YYYYYYYYYYYY
000000000000
SCT
2
24
SC
'I'
SC
'H'
SC
'C'
SC
'B'
SC
'A'
16
SC
'G'
0
415
416
CC
'2'
CC
'1'
24
1011
YYYYYYYYYYYY
111111111111
SCT
15
405E
414
CINDEX
400
406
407
408
409
40A
40B
40C
40D
40E
40F
410
411
YY D
11 0
XXXXX
00000
16
SC
'P'
24
32
40
48
The set of input strings longer than one character compressed by this dictionary
are:
Hexadecimal Symbol
String
400-404
406-40B
40C-413
415-416
BO, BP
23-17
There are no compression symbols for 405 and 414. These are the sibling
descriptor entries. Because their sibling descriptor extensions are located at those
indices in the expansion dictionary (not the preceded or unpreceded entries
required for expansion), it is important that no compression symbol have that value.
C3
CCT
4
0
600
601
602
603
Hexadecimal Entry
Description
C3
600
601
602
603
XXXXX
00000
3
YY D
00 0
8
CINDEX
600
1011
CC
'1'
CC
'1'
24
32
CC
'1'
CC
'2'
40
63
The set of input strings longer than one character compressed by this dictionary
are:
Hexadecimal Symbol
String
600
C1ABCD
601
C1ABC
602
C1AB
603
C2
By taking advantage of the special processing when the second and subsequent
child characters match the first, you can reduce the number of dictionary entries
searched to determine the compression symbols. For example, to find that X'601' is
the compression symbol for the characters C1ABC, the processing examines entry
X'C3', then entry X'600', then entry X'601'. Entry X'600' does not match because the
input string does not have all 4 extension characters. There are alternate ways of
setting up the dictionary to compress the same set of input strings handled by this
dictionary.
23-18
Description
C1
101
201
Hexadecimal
Entry
C1
000 CSL
0
000
5
101
201
16
24
48
40
56
24
63
Offset
1
32
32
48
40
EC
'2'
EC
'1'
EC
'E'
16
32
EC
'1'
EC
'C'
PrecIndex
101
3
24
16
PSL
5
0
{EC}
PrecIndex
C1
PSL
2
0
EC
EC
'3'
40
56
Offset
3
EC
'4'
48
63
56
63
23-19
23-20
24-1
v When the time interval expires, the user-specified timer exit routine gets control
and issues the IOCINFO macro to obtain the MVS I/O configuration token that is
current at this later time.
v The program compares the newly-obtained token with the original one.
v If the tokens match, no I/O configuration change has occurred, and the program
resets the time interval for another 10 minutes to check again at that time.
v If the tokens do not match, a configuration change has occurred. The program
then rebuilds its control structures by using the UCBSCAN macro, specifying the
IOCTOKEN parameter to check for any further I/O configuration changes while
the rebuilding process is in progress. After the control structures are rebuilt for
the new I/O configuration, the program resets the time interval for 10 minutes to
check again for I/O configuration changes.
Scanning UCBs
You can use the UCBSCAN macro with the COPY keyword to scan UCBs. On each
invocation, UCBSCAN may return, in caller-supplied storage areas, a copy of one
or more of the following UCB segments:
v UCB common segment
v UCB common extension segment
v UCB prefix extension segment
v UCB device class extension segment
The scan can include all UCBs in the system, or be restricted to a specific device
class. For example, you could use UCBSCAN to find all DASD devices currently
defined to the configuration. It is also possible to restrict the scan to UCBs for static
and installation-static devices, or to include UCBs for dynamic devices as well.
Example of a Program That Obtains Copies of All the UCBs: This example
program obtains copies of all UCBs, including those for devices defined as
dynamic. It uses the MVS I/O configuration token to determine if the I/O
configuration changes during the scan, and it restarts the scan if the I/O
configuration has changed. On each invocation of UCBSCAN, the system returns a
copy of a UCB at the address specified by UCBAREA and return the current MVS
I/O configuration token.
SCANEXMP CSECT
SCANEXMP AMODE 31
SCANEXMP RMODE ANY
DS
0H
BAKR R14,0
Save regs on linkage stack
LR
R12,R15
Set up code reg
USING SCANEXMP,R12
LA
R13,SAVEAREA
Get save area address
MVC SAVEAREA+4(4),FIRSTSAV
First save area in chain
*
*
...
*
RESCANLP DS
0H
IOCINFO IOCTOKEN=TOKEN
Get current IOCTOKEN
XC
SCANWORK,SCANWORK
Clear scan work area
SCANLOOP DS
0H
UCBSCAN UCBAREA=UCBCOPY,WORKAREA=SCANWORK,DYNAMIC=YES,
+
RANGE=ALL,IOCTOKEN=TOKEN
LTR R15,R15
Was a UCB returned?
BNZ SCANDONE
No, either a configuration
*
change has occurred
*
or no more UCBs
*
*
Process UCB
24-2
B
SCANLOOP
SCANDONE DS
0H
LA
R02,12
*
CR
R15,R02
*
BE
RESCANLP
FINISHED DS
0H
*
*
...
*
ENDIT
DS
0H
PR
EJECT
*
* Register equates
*
R02
EQU 2
R03
EQU 3
R09
EQU 9
R12
EQU 12
R13
EQU 13
R14
EQU 14
R15
EQU 15
DS
0F
FIRSTSAV DC
CL4F1SA
SAVEAREA DS
18F
TOKEN
DS
48C
UCBCOPY DS
48C
*
SCANWORK DS
CL100
END SCANEXMP
Return to caller
24-3
24-4
with the unit name or device type, recording mode, and density provided as
input. The maximum eligible device type is the tape device type that contains the
greatest number of eligible devices compatible with the specified recording mode
and density.
24-5
24-6
Notes:
1. INTRDR is an IBM-reserved name identifying the internal reader as the
program to process this data set after it is created and written to.
2. The SYSOUT class on this DD statement becomes the message class for the
submitted job unless you specify MSGCLASS on the JOB statement.
Copyright IBM Corp. 1988, 2002
25-1
v Use the following dynamic allocation text unit keys to dynamically allocate
an internal reader data set:
DALSYSOU define the SYSOUT data set and its class.
DALSPGNM specify the SYSOUT program name (INTRDR).
DALCLOSE request that INTRDR be deallocated at close.
DALRTDDN request the return of the ddname assigned by dynamic
allocation.
DALLRECL specify the record length of any instream data set.
DALRECFM specify the record format of any instream data set.
Note: DALCLOSE, DALRTDDN, DALLRECL and DALRECFM are optional
dynamic allocation text unit keys.
For the format details of dynamic allocation text unit keys, see z/OS MVS
Programming: Authorized Assembler Services Guide.
Notes:
1. An INTRDR data set can contain any number of jobs.
2. The output destination of the INTRDR data set becomes the default print/punch
routing of all jobs contained within it.
3. INTRDR data sets contain sequential, fixed-length, or variable-length records.
Instream data records can be up to 254 bytes long. Note, however, that JCL
images in the data sets must be exactly 80 bytes long.
25-2
internal reader. Note that the RPL cannot have records longer than 80 bytes.
Specify the following options on the RPL macro when creating an RPL:
OPTCD=(ADR,SEQ,SYN,NUP),RECLEN=80
Where:
ADR
SEQ
SYN
NUP
RECLEN=80
Specifies that the submitted JCL records are 80 bytes.
Note that you must issue a CLOSE macro after the last ENDREQ.
JOB D58ELM1,MORRIS
EXEC PGM=IEBGENER
DD
DUMMY
DD
SYSOUT=A,DEST=2NDFLOOR
DD
SYSOUT=(M,INTRDR)
DD
DATA
JOB D58ELM1,MORRIS,MSGLEVEL=(1,1)
Chapter 25. The Internal Reader
25-3
25-4
Then suppose that two different instances of a program each call ASASYMBM, one
with TEST001 as the substitution text for &TCASEID and the other with TEST002
as the substitution text. The resulting data set names are:
TEST.TEST001
TEST.TEST002
Notice that one data set definition produces two unique instances of data sets to be
used in the programs.
Types of Symbols
There are two types of symbols that you can specify in application or vendor
programs:
v System symbols are defined to the system at initialization. Your installation
specifies substitution texts for system symbols or accepts their default values.
When a program calls ASASYMBM, it can accept the installation-defined
substitution texts or override them. There are two types of system symbols:
Static system symbols have substitution texts that are defined at system
initialization and remain fixed for the life of an IPL. Static system symbols
represent fixed values such as system names and sysplex names.
The DISPLAY SYMBOLS command displays the static system symbols and
associated substitution texts that are currently in effect. See z/OS MVS
System Commands or z/OS MVS System Commands for details about
DISPLAY SYMBOLS.
Dynamic system symbols have substitution texts that can change at any point
in an IPL. They represent values that can change often, such as dates and
26-1
DC
C&&DATAID.
You then specify that the user is to provide, as input to the program, the substitution
text for the &DATAID user symbol. For example:
EXEC PGM=MYPGM,PARM=DATA1
Your program provides, as input to ASASYMBM, a symbol table that contains the
&DATAID user symbol, with the substitution text that the user provided as input to
the program:
DATAIDSUBTEXT
26-2
DC
CDATA1
To determine the data set name to be used, your program also provides to
ASAYSMBM the pattern for the data set name, including the symbols for which
substitution is to occur. For example:
SYS1.&SYSNAME..&DATAID..DS1
SYS1.&SYSNAME..&DATAID..DS2
SYS1.&SYSNAME..&DATAID..DS3
The data set names resolve to the following names after symbolic substitution:
SYS1.DATA1.DS1
SYS1.DATA1.DS2
SYS1.DATA1.DS3
The following section explains how to call ASASYMBM to perform the substitution
described in the example above.
Description
SYMBPPATTERN@
SYMBPPATTERNLENGTH
SYMBPTARGET@
SYMBPTARGETLENGTH@
26-3
SYMBPRETURNCODE@
Before calling ASASYMBM, you can optionally code the following fields in the
ASASYMBP mapping macro:
Field
Description
SYMBPSYMBOLTABLE@
SYMBPTIMESTAMP@
After the call to ASASYMBM, the caller can examine the following:
v The fullword pointed to by the SYMBPRETURNCODE@ field
v The fullword pointed to by the SYMBPTARGETLENGTH@ field
v The area pointed to by the SYMBPTARGET@ field.
Description
SYMBTNUMBEROFSYMBOLS
Specifies the number of entries in the symbol table.
The number can be zero.
SYMBTTABLEENTRIES
26-4
Function
CHECKNULLSUBTEXT
26-5
NODEFAULTSYMBOLS
ONLYDYNAMICSYMBOLS
ONLYSTATICSYMBOLS
PTRSAREOFFSETS
MIXEDCASESYMBOLS
TIMESTAMPISGMT
TIMESTAMPISLOCAL
TIMESTAMPISSTCK
WARNNOSUB
WARNSUBSTRINGS
26-6
SYMBP
SYMBPSYMBOLTABLE@
0
SYMBTFLAGS
SYMBTHEADER
04
SYMBTNUMBEROFSYMBOLS
SYMBTE
(Entry 1)
SYMBTE
(Entry 2)
o
o
o
26-7
SYMBP
SYMBPSYMBOLTABLE@
10
0
SYMBTFLAGS
SYMBTHEADER
SYMBTINDIRECTSYMBOLAREA = ON
SYMBOL TABLE
02
SYMBTNUMBEROFSYMBOLS
04
SYMBTESYMBOLAREADDR
SYMBTE
(Entry 1)
SYMBTE
(Entry 2)
o
o
o
26-8
Example 1
Operation: Set up the area that is to contain the substitution text. The caller does
not provide a symbol table or timestamp.
*
*
*
*
*
*
*
*
*
*
LA
USING
XC
LA
ST
LA
ST
LA
ST
MVC
LA
ST
3,MYSYMBP
SYMBP,3
SYMBP(SYMBP_LEN),SYMBP Initialize to zero
4,PATTERN
Address of pattern
4,SYMBPPATTERN@
Save in SYMBP area
4,LPATTERN
Length of pattern
4,SYMBPPATTERNLENGTH
Save in SYMBP area
4,TARGET
Address of target
4,SYMBPTARGET@
Save in SYMBP area
TARGETLENGTH,=A(LTARGET) Set length of target
4,TARGETLENGTH
Address of target length
4,SYMBPTARGETLENGTH@
Save in SYMBP area
Because the caller did not provide a symbol table, we know that
we are using only the system symbols provided by MVS. Since we have
initialized the entire SYMBP area to 0, we do not have to
set up the SYMBPSYMBOLTABLE@ field.
Because the caller did not provide a timestamp, and because we
have initialized the entire SYMBP area to 0, we do not have to
set up the SYMBPTIMESTAMP@ field.
LA
ST
DROP
4,RETURNCODE
4,SYMBPRETURNCODE@
3
..
.
*
* Note that to avoid the assembler substituting
* for &SYSNAME, &YYMMDD, &HHMMSS, two ampersands are specified.
* The resulting pattern, then, is actually
*
USERID.&SYSNAME..D&YYMMDD..T&HHMMSS
*
PATTERN
DC
CUSERID.&&SYSNAME..D&&YYMMDD..T&&HHMMSS
DYNAREA
DSECT
DS
0F
MYSYMBP
DS
CL(SYMBP_LEN)
SYMBP area
RETURNCODE DS
F
Return code
TARGETLENGTH DS
F
Length of target
TARGET
DS
CL80 An area big enough to hold the target no
*
matter what is substituted. Since &DATE
*
and &TIME are not used, it need be no
*
longer than the pattern area.
ASASYMBP ,
Mapping of SYMBP area
Example 2
Operation: Set up the SYMBP area. Provide a symbol table and a timestamp.
LA
USING
XC
LA
ST
3,MYSYMBP
SYMBP,3
SYMBP(SYMBP_LEN),SYMBP
4,PATTERN
4,SYMBPPATTERN@
Initialize to zero
Address of pattern
Save in SYMBP area
26-9
LA
ST
LA
ST
MVC
LA
ST
LA
ST
4,LPATTERN
Length of pattern
4,SYMBPPATTERNLENGTH
Save in SYMBP area
4,TARGET
Address of target
4,SYMBPTARGET@
Save in SYMBP area
TARGETLENGTH,=A(LTARGET) Set length of target
4,TARGETLENGTH
Address of target length
4,SYMBPTARGETLENGTH@
Save in SYMBP area
5,MYSYMBT
Address of symbol table
5,SYMBPSYMBOLTABLE@
Save in SYMBP area
*
* Initialize symbol table to indicate that the input timestamp
* is local time, not GMT, and to contain two system symbols.
*
USING SYMBT,5
XC
SYMBTHEADER,SYMBTHEADER Clear symbol table header
OI
SYMBTFLAGS,SYMBTTIMESTAMPISLOCAL Local timestamp
LA
6,2
Number of symbols
STH 6,SYMBTNUMBEROFSYMBOLS Save in SYMBT area
LA
5,SYMBTTABLEENTRIES
Address of first symbol entry
USING SYMBTE,5
A symbol table entry
*
* Initialize first entry in symbol table.
*
LA
6,SYMBOL1
Address of first symbol
ST
6,SYMBTESYMBOLPTR
Save in SYMBTE area
LA
6,LSYMBOL1
Length of first symbol
ST
6,SYMBTESYMBOLLENGTH
Save in SYMBTE area
LA
6,SYMBOL1SUBTEXT
Address of substitution text
ST
6,SYMBTESUBTEXTPTR
Save in SYMBTE area
LA
6,LSYMBOL1SUBTEXT
Length of substitution text
ST
6,SYMBTESUBTEXTLENGTH
Save in SYMBTE area
*
* Move to next entry in symbol table.
*
LA
5,SYMBTE_LEN(,5)
Address of next symbol entry
*
* Initialize second entry in symbol table.
*
LA
6,SYMBOL2
Address of symbol
ST
6,SYMBTESYMBOLPTR
Save in SYMBTE area
LA
6,LSYMBOL2
Length of symbol
ST
6,SYMBTESYMBOLLENGTH
Save in SYMBTE area
LA
6,SYMBOL2SUBTEXT
Address of substitution text
ST
6,SYMBTESUBTEXTPTR
Save in SYMBTE area
LA
6,LSYMBOL2SUBTEXT
Length of substitution text
ST
6,SYMBTESUBTEXTLENGTH
Save in SYMBTE area
DROP 5
No longer need addressability
*
* Complete parameter area initialization.
*
LA
4,MYTIMESTAMP
Address of timestamp
ST
4,SYMBPTIMESTAMP@
Save in SYMBP area
LA
4,RETURNCODE
Address of return code
ST
4,SYMBPRETURNCODE@
Save in SYMBP area
DROP
3
No longer need addressability
..
.
*
* Note that in order to avoid the assemblers substituting
* for &YYMMDD, &HHMMSS, &S1, &S2, two ampersands are specified.
* The resulting pattern, then, is actually
*
USERID.&YYMMDD..&S1..&S2
* Similarly, the resulting symbol names are
*
&S1; and &S2;
26-10
*
PATTERN
DC
CUSERID.D&&YYMMDD..T&&HHMMSS..&&S1..&&S2
SYMBOL1
DC
C&&S1.
First symbol is &S1
SYMBOL1SUBTEXT DC
CS1V
Substitution text for &S1
SYMBOL2
DC
C&&S2.
Second symbol is &S2
SYMBOL2SUBTEXT DC
CS2V
Substitution text for &S2
* Note that the substitution text values above are no longer than
* the symbol names (counting the "&" but not the "."). This
* helps to ensure that the substituted length is not greater
* than the pre-substitution length.
*
DYNAREA
DSECT
DS
0F
MYSYMBP
DS
CL(SYMBP_LEN)
SYMBP area
DS
0F
MYSYMBT
DS
CL(SYMBT_LEN+2*SYMBTE_LEN) Symbol table with
*
room for two symbol entries
MYTIMESTAMP
DS
CL8 Time stamp that was set previously
*
Assume it represents local time
RETURNCODE
DS
F
Return code
TARGETLENGTH DS
F
Input/Output Target Length
TARGET
DS
CL80 An area big enough to hold the target no
*
matter what is substituted
ASASYMBP ,
Mapping of SYMBP, SYMBT, SYMBTE
Example 3
Operation: Use the LINK macro to invoke the ASASYMBM service:
*. Set up MYSYMBP as in previous examples.
..
LINK EP=ASASYMBM,MF=(E,MYSYMBP)
..
.
DYNAREA DSECT
DS
0F
MYSYMBP DS
CL(SYMBP_LEN)
SYMBP area
ASASYMBP ,
Mapping of SYMBP area
Example 4
Operation: Use the LINKX macro to invoke the ASASYMBM service:
*. Set up MYSYMBP as in previous examples.
..
MVC MYLIST(MYSLIST_LEN),MYSLIST Initialize execute form
LINKX EP=ASASYMBM,MF=(E,MYSYMBP),SF=(E,MYLIST) call service
..
.
MYSLIST LINKX SF=L
Initialized list form
MYSLIST_LEN EQU *-MYSLIST
Length of list form
DYNAREA DSECT
MYLIST LINKX SF=L
List form in dynamic area
DS
0F
MYSYMBP DS
CL(SYMBP_LEN)
SYMBP area
ASASYMBP ,
Mapping of SYMBP area
26-11
26-12
27-1
Application
Instance 1
Log stream
log block
4
log block
3
log block
2
log block
1
Application
Instance
2
27-2
Log stream
Sys 1
Youngest data
Oldest data
Application
Structure
Coupling Facility
Figure 27-2. Log Stream Data on the Coupling Facility and DASD
When a system logger application writes a log block to a coupling facility log
stream, system logger writes it first to a coupling facility list structure. System logger
requires that a coupling facility list structure be associated with each log stream.
When the coupling facility structure space allocated for the log stream reaches the
installation-defined threshold, system logger moves (offloads) the log blocks from
the coupling facility structure to VSAM linear DASD data sets, so that the coupling
facility space for the log stream can be used to hold new log blocks. From a users
point of view, the actual location of the log data in the log stream is transparent.
27-3
Log stream
Sys 1
Youngest data
Oldest data
Application
SYS1 local
storage buffers
Figure 27-3. Log Stream Data in Local Storage Buffers and DASD Log Data Sets
When a system logger application writes a log block to a DASD-only log stream,
system logger writes it first to the local storage buffers for the system and duplexes
it to a DASD staging data set associated with the log stream. When the staging
data set space allocated for the log stream reaches the installation-defined
threshold, system logger offloads the log blocks from local storage buffers to VSAM
linear DASD data sets. From a users point of view, the actual location of the log
data in the log stream is transparent.
Both a DASD-only log stream and a coupling facility log stream can have data in
multiple DASD log data sets; as a log stream fills log data sets on DASD, system
logger automatically allocates new ones for the log stream.
27-4
Sysplex
Sys 1
S
y
s
t
e l
mo
g
Application
g
1
e
r
Local
Storage
buffers
Sys 2
SYS1/TRANSLOG
Staging
Data Set
LOGR
couple
data set
Local
Storage
buffers
S
y
s
t
e l
mo
g
g
e
r
Application
2
SYS2/TRANSLOG
staging
data set
DASD-Only Log Stream Configuration: Figure 27-5 on page 27-6 shows all the
parts involved when a system logger application writes to a DASD-only log stream.
System logger writes the data to the local storage buffers on the system, duplexing
it at the same time to the DASD staging data sets associated with the log stream.
Then, when the staging data set fills with data, system logger offloads the data to
DASD log data sets. Note that where duplexing to DASD staging data sets is an
option for a coupling facility log stream, it is a required automatic part of a
DASD-only log stream. A system logger application uses system logger services to
access the system logger capabilities.
27-5
Sysplex
Sys 1
S
y
s
t
e l
mo
g
g
Application
e
r
SYS1
staging
data
set
Local
Storage
buffers
DASD
staging
data sets
LOGR
couple
data set
27-6
sysplex failure because it has not yet been hardened to DASD log data sets.
System logger duplexes interim storage log data for both coupling facility and
DASD-only log streams.
v Produces SMF record type 88 for system logger accounting on a single system.
Record type 88 focuses on the usage of interim storage (coupling facility or local
storage buffers) and log stream data for a system in the sysplex. Using the
record can help an installation avoid the STRUCTURE FULL or STAGING DATA
SET FULL exceptions, and perform other tuning and/or capacity planning
analysis.
See z/OS MVS System Management Facilities (SMF) for more information on
record type 88 and system logger accounting. Sample program IXGRPT1 in
SYS1.SAMPLIB shows an example of producing a report from SMF record type
88.
v Ensures that:
When the last connection from a system disconnects from the log stream, all
log data written by that system to the log stream is offloaded to DASD log
data sets.
System logger also deletes any staging data sets in use for a system at this
time.
When the last connection to a coupling facility log stream in the sysplex
disconnects, all coupling facility log data is offloaded to DASD log data sets
and the coupling facility space is returned to XES for reallocation.
v Provides recovery support in the event of application, system, sysplex, or
coupling facility structure failure for coupling facility log streams. (See Recovery
Performed for DASD-Only Log Streams on page 27-55 for information about
recovery for DASD-only log streams.)
27-7
Formatting a LOGR couple data set and defining the LOGR policy are steps an
installation must take to prepare for using a system logger application. See Setting
Up the System Logger Configuration on page 27-47.
27-8
27-9
27-10
Access
type
ALTER
RESOURCE(log_stream_name) CLASS(LOGSTRM)
ALTER
RESOURCE(log_stream_name) CLASS(LOGSTRM)
UPDATE
RESOURCE(IXLSTR.structure_name) CLASS(FACILITY)
ALTER
RESOURCE(log_stream_name) CLASS(LOGSTRM)
UPDATE
RESOURCE(like_log_stream) CLASS(LOGSTRM)
RESOURCE(IXLSTR.like_structure_name)
CLASS(FACILITY)
IXGINVNT REQUEST=DEFINE TYPE=STRUCTURE
ALTER
RESOURCE(MVSADMIN.LOGR) CLASS(FACILITY)
UPDATE
RESOURCE(log_stream_name) CLASS(LOGSTRM)
READ
RESOURCE(log_stream_name) CLASS(LOGSTRM)
27-11
the ECB specified on the system logger request is posted. Once the ECB is
posted, the caller can examine the answer area to verify whether the request
completed successfully.
v Choosing MODE=SYNCEXIT
Choose MODE=SYNCEXIT to specify that the request be processed
synchronously, if possible. If the request cannot be completed synchronously,
control returns to the caller with a return and reason code indicating that
processing of the request is not complete. When processing of the request
completes, the exit routine specified at connect time gets control. (The exit
routine is specified on the COMPLETEEXIT parameter on the IXGCONN
request.)
You can use the REQDATA parameter with MODE=SYNCEXIT to specify
user-defined information relating to the request. For example, you can use
REQDATA to specify information about control blocks needed by the complete
exit.
Your application must be in supervisor state, system key to use the
MODE=SYNCEXIT and REQDATA parameters.
v Choosing MODE=ASYNCNORESPONSE
Choose MODE=ASYNCNORESPONSE on the IXGWRITE and IXGDELET
requests to specify that the request be processed asynchronously. The caller will
not be informed when the request completes. The answer area returned in the
ANSAREA parameter and mapped by IXGANSAA is not valid when you specify
MODE=ASYNCNORESPONSE.
When a system logger request cannot be completed synchronously, system logger
schedules an SRB to complete processing of the request before it returns control to
the caller. While the SRB runs independent of the requesting task, the SRB might
encounter an error from which it cannot recover. The SRB ensures that the error
condition is percolated to the task that issued the system logger request.
Note: Depending on the exploiters structure, this task might not be the same task
that originally issued the IXGCONN request to connect to a log stream.
Prior to percolating the error to the requesting task, system logger issues the
SETRP macro, specifying SERIAL=YES. System logger also places additional
diagnostic information in the SDWA, as follows:
SDWACMPC
The completion code, set to X'1C5'.
SDWACRC
The reason code, set to X'85F'.
SDWACOMU
The ECB address specified on the ECB keyword when system logger was
invoked.
If the caller receives a return code indicating that system logger will process the
request asynchronously, the application cannot free certain storage areas.
27-12
CMPLRETCODE
CMPLRSNCODE
CMPLANSAREA@
CMPLSTREAMTOKEN
Environment
The complete exit receives control in the following environment:
Authorization:
Supervisor state, and PSW key 0
Dispatchable unit mode:
SRB
Cross memory mode:
PASN=HASN=SASN. PASN, HASN and SASN are
equal to the PASN at the time of the connect to the
log stream.
AMODE:
31-bit
ASC mode:
Primary ASC mode
Interrupt status:
Enabled for I/O and external interrupts
Locks:
No locks held.
Control parameters:
None.
Input Specifications
System logger services pass information to the complete exit in registers.
Registers at Entry: When the complete exit receives control, the GPRs contain
the following information:
Register
Contents
Does not contain any information for use by the complete exit.
2-12
27-13
13
14
15
When the complete exit receives control, the ARs contain no information for use by
the complete exit.
Return specification: Your exit must return control to the system by branching to
the address provided on entry in register 14. There are no requirements for the
GPRs or ARs to contain any particular value.
Programming Considerations
If you have more than one outstanding system logger request being processed
asynchronously, multiple instances of your complete exit might run concurrently as
system logger services process your request completions. Therefore, you should
consider coding your complete exit as a reentrant program.
You can access the input parameter data area only while your complete exit is
running. If you want to save the parameter information for later processing, make a
copy of it before your complete exit returns control to the system.
In certain instances, the system must quiesce the activity of user exits in order to
perform cleanup processing. The following illustrates scenarios where this
processing occurs:
v Connection Termination
When a user disconnects while a MODE=SYNCEXIT request is outstanding, the
complete exit will not be called.
If the connecting task terminates, the system will issue a PURGEDQ against
SRB that are associated with the connection. Since all complete exit SRBs are
associated with the connecting tasks TCB, any complete exits that are active
when the connecting task terminates could be interrupted with an ABEND x47B
reason code 0.
v System Logger Termination
When the system logger address space terminates, it attempts to inform active
requests of logger termination. If the complete exit has not been scheduled, it is
scheduled at this time with a return code and reason code indicating that the
system logger address space has terminated.
The system logger initializes a recovery environment before it calls the complete
exit. Should the complete exit fail and percolate to the system loggers recovery
routine, the task that did the corresponding connection to the log stream is abended
and retry is not permitted. The abend code will be 1C5 and the abend reason code
00030006.
27-14
Request Results
START SEARCH=search
READBLOCK SEARCH=search
START STARTBLOCKID=startblockid
READBLOCK BLOCKID=blockid
READCURSOR
START OLDEST
When the oldest log block is within a gap of log data, the request
completes with a non-zero return code and reason code. System
logger positions or resets the cursor to the oldest valid block in
the log stream.
RESET POSITION=OLDEST
START YOUNGEST
RESET POSITION=YOUNGEST
Request Results
BLOCKS=ALL
BLOCKS=RANGE
27-15
DIAG(NO)
DIAG(NO_DIAG)
DIAG(NO_DIAG)
DIAG(NO_DIAG)
Yes
NO
YES
--------------------------------IXGCONN CONNECT
NO_DIAG NO
YES
NO_DIAG NO
YES
---------------------------------------------------------------IXGBRWSE START
NO_DIAG
NO
YES
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
yes
IXGDELET
NO_DIAG
NO
YES
no
no
no
no
no
no
no
no
no
no
no
yes
no
no
no
yes
no
yes
27-16
then a new (first) connection is established to the logstream on SYSA, then the new
DIAG options would then be in affect on SYSA.
27-17
ANSAA_ASYNCH_RETCODE
For asynchronously processed requests, system logger returns the return code
in this field.
ANSAA_ASYNCH_RSNCODE
For asynchronously processed requests, system logger returns the reason code
in this field.
ANSAA_DIAGx
Diagnostic data. The content of these fields depend on any return and reason
codes returned for a request.
Specific service indicators include:
ANSAA_BLKFROMINACTIVE
Indicates that the log block returned from an IXGBRWSE request came from
the inactive portion of the log stream. For MULTIBLOCK=YES requests, this
flag indicates that at least one log block returned in the buffer came from an
inactive portion of the log stream. Flag IXGBRMLT_FROMINACTIVE in
IXBRMLT (from the IXGBRMLT macro) indicates which log blocks were in the
inactive portion. This field is only valid for IXGBRWSE requests that result in a
log block being returned.
ANSAA_DYNMGMTOFENTRYTOELACTIVE
Indicates that system logger is dynamically managing the entry-to-element ratio
for the coupling facility structure. The structure was defined in a LOGR couple
data set at an OS/390 Release 3 level or higher. This field is only valid for
IXGCONN requests, and is undefined when ANSA_DASDONLYLOGSTREAM is
on.
ANSAA_DASDONLYLOGSTREAM
This flag in ANSAA_FLAGS1 indicates whether a log stream is DASD-only. It is
output from an IXGCONN REQUEST=CONNECT service.
ANSAA_BROWSEMULTIBLOCK
This flag in ANSAA_FLAGS1 indicates whether this level of system logger
supports IXGBRWSE MULTIBLOCK=YES requests. It is valid only for an
IXGBRWSE REQUEST=START service.
ANSAA_BLKFROMDASD
This flag in ANSAA_FLAGS1 indicates that the log block returned from an
IXGBRWSE request came from a log stream DASD offload data set. For
MULTIBLOCK=YES requests, this flag indicates that at least one log block
returned in the buffer came from a log stream DASD offload data set. Flag
IXGBRMLT_FROMDASD in IXBRMLT (from the IXGBRMLT macro) indicates
which log blocks were read from DASD. This field is only valid for IXGBRWSE
requests that result in a log block being returned.
See z/OS MVS Data Areas, Vol 3 (IVT-RCWK) for a complete description of the
IXGANSAA macro.
27-18
For example, suppose an IXGWRITE request fails with a return and reason code
indicating that some system logger resource is unavailable, perhaps because the
system logger address space has failed or because a structure rebuild is in
progress for the coupling facility structure for the log stream. Before the application
can resume issuing system logger service requests. it must listen for the event code
48 notification that the resource is available again.
In order to listen for ENF code 48 events, you must code an SRB-type listen exit for
event code 48 events to scan the event 48 parameter list for status information on
the system logger component, log streams, and coupling facility structures
associated with log streams. The listen exit must be in place before system logger
applications are activated.
If you use ENF event code 48 to receive information about system logger events,
make sure that you take into account the asynchronous nature of the ENF exit. You
might get notified of events out of sequence, being notified for instance, that a
problem has been resolved before you get a return and reason code describing a
problem.
For example, if you issue IXGWRITE to write data to the log stream while the
coupling facility structure space allocated for the log stream is full, you might get an
ENF 48 notification that the structure is no longer full before you get the return and
reason code from IXGWRITE to say that the structure is full.
Applications that do not want to use ENF event code 48 or that are unauthorized
and cannot use ENFREQ will still receive logger service return and reason codes
indicating failure or resource shortages. These applications can then simply set a
timer and then retry the requests to see if the problem has resolved itself.
References:
v See Writing an ENF Event 48 Listen Exit on page 27-47 for information on ENF
48 events, and coding your ENF event 48 listen exit.
v See z/OS MVS Programming: Assembler Services Guide for guidance about
using the ENFREQ macro.
v See z/OS MVS Programming: Authorized Assembler Services Reference
ENF-IXG for reference information on the ENFREQ macro.
Figure 27-6 shows an example of how to issue the ENFREQ service to listen for
ENF event code 48 and specify a listen exit to analyze the event 48 parameter list:
ENFREQ ACTION=LISTEN,
CODE=ENFPC048,
ESTBNME=THISMOD,
EXITNME=LOGLISTEN,
SRBEXIT=(R02),
EOM=YES,
DTOKEN=ENFREQ_DTOKEN,
RETCODE=ENFREQ_RETCODE
27-19
27-20
IXGINVNT REQUEST=DEFINE
TYPE=LOGSTREAM,
STREAMNAME=MODEL1,
STRUCTNAME=STRUCT1,
MODEL=YES,
HLQ=SYSPLEX1,
STG_DUPLEX=YES,
DUPLEXMODE=COND,
STG_DATACLAS=STGDATA,
STG_MGMTCLAS=STGMGMT,
STG_STORCLAS=STGSTOR,
LS_MGMTCLAS=LSMGMT,
LS-STORCLAS=LSSTOR,
LS_DATACLAS=LSDATA,
STG_MGMTCLAS=LSMGMT,
STG_STORCLAS=LSSTOR,
ANSAREA=ANSAREA,
ANSLEN=ANSLEN,
RETCODE=RETCODE,
RSNCODE=RSNCODE
IXGINVNT REQUEST=DEFINE
TYPE=LOGSTREAM,
STREAMNAME=STREAM1,
LS_DATACLAS=LSDATA1
LIKE=MODEL1,
ANSAREA=ANSARE1,
ANSLEN=ANSLE1,
RETCODE=RETCDE,
RSNCODE=RSNCDE
Figure 27-7. Define a Log Stream as a Model and then Model a Log Stream After It
You cannot connect to a model log stream or use it to store log data. It is strictly
for use as a model to streamline the process of defining log streams.
You can use the LIKE parameter to reference a log stream that has not been
defined as a model log stream using the MODEL parameter. Any log stream can be
referenced on the LIKE parameter.
27-21
For set up steps for a DASD-only log stream, see the system logger chapter in
z/OS MVS Setting Up a Sysplex.
27-22
27-23
and can use the same stream token to issue other system logger services. Any
task in the address space can disconnect the entire address space from the log
stream by issuing the IXGCONN REQUEST=DISCONNECT service.
v One Connection Per Program: One or more tasks in a single address space
can issue IXGCONN REQUEST=CONNECT individually to connect to the same
log stream and receive separate stream tokens. Each program must disconnect
from the log stream individually.
v Multiple Systems Connecting to a Log Stream: Multiple address spaces on
one or more MVS systems can connect to a single coupling facility log stream,
but each one must issue IXGCONN individually to connect and then disconnect
from the log stream. Each one receives a unique stream token; address spaces
cannot share a stream token.
When an application issues IXGCONN to connect to a coupling facility log stream,
the system logger address space connects to the coupling facility list structure for
the log stream.
Each task that issues IXGCONN REQUEST=CONNECT to connect to a log stream
must later issue IXGCONN REQUEST=DISCONNECT to disconnect from the log
stream. When a task disconnects from the log stream, the stream token that
identified the connection is invalidated. Any requests that use the stream token after
the disconnect will be rejected.
If a task that issued the IXGCONN REQUEST=CONNECT request ends before
issuing a disconnect request, system logger will automatically disconnect the task
from the log stream. This means that the unique log stream connection identifier, or
the STREAMTOKEN, will no longer be valid. The application will receive an expired
logstream token error response if it then uses this same STREAMTOKEN after the
task has been disconnected on subsequent logger service requests.
27-24
log stream that has an IXGCONN service issued against it gets 100% of the
coupling facility structure space available. When a second log stream mapping to
the coupling facility structure has an IXGCONN service issued against it, system
logger divides the structure evenly between the two log streams. The first log
streams available coupling facility space will be reduced by half to reapportion the
rest of the space to the second log stream. This can result in some of the data
being off-loaded to DASD if the coupling facility space allocated to a log stream
reaches its high threshold as a result of the reapportionment of the structure space.
For example, if an installation defines two log streams to a single structure in the
LOGR policy, but only one of the log streams actually has a connected application,
then that one log stream can use the entire coupling facility structure. When the
second log stream connect occurs against the coupling facility structure, the space
is gradually divided between the two log streams. Likewise, when the last
disconnect is issued against one of the two log streams, all coupling facility
structure space is again available to the first log stream.
Note that this process of reallocation of coupling facility space and subsequent
offloading of coupling facility data might not take place immediately after the log
stream connect. The reallocation of space might occur gradually, with an offloading
taking place some time after the original log stream connect.
27-25
set. You can specify one resource manager name for a log stream in the log stream
definition. See z/OS MVS Setting Up a Sysplex for setting up a log stream definition
in the LOGR couple data set.
If you specify a resource manager name for a log stream in the LOGR policy, the
resource manager specified must connect to the log stream. If the resource
manager does not connect, system logger will not process any IXGDELET requests
to delete log data. This is so that the resource manager will not miss any
information about deletes issued against the log stream.
The resource manager connects to the log stream it manages using the RMNAME,
RMEXIT, RMDATA, and RMEVENTS parameters on the IXGCONN service. You
must be running in supervisor state and a system key to use these parameters. The
connect request must be issued from the resource manager address space. The
resource manager address space must be non-swappable with an authorization
index (AX) value of 1, or all invocations of the resource manager exit will fail.
Note that only one resource manager can connect to a log stream from a given
system. The resource manager can connect to multiple log streams.
Use the resource manager parameters as follows:
RMNAME
Specifies the name of the resource manager program connecting to the log
stream. This is the same name specified on the RMNAME parameter in the
LOGR couple data set log stream definition.
RMEXIT
Specifies the name of a resource manager user exit. The resource manager
exit is called when write and/or delete requests (as specified on the
RMEVENTS parameter) are issued against the log stream that the resource
manager manages. The RMEXIT keyword is required with RMNAME. For
information on the resource manager exit, see Coding a Resource
Manager Exit for IXGCONN on page 27-28.
RMEVENTS
Specifies that write or delete requests issued against the log stream are to
trigger the resource manager exit. RMEVENTS is required with RMNAME.
You can specify RMEVENTS=LBWRITE, RMEVENTS=LBDELETE, or
RMEVENTS=(LBWRITE,LBDELETE).
RMDATA
Specifies user-defined data to the resource manager. This data is then
passed to the resource manager user exit when the exit is called.
RMDATA is required with RMNAME.
Using ENF Event Code 48 With a Resource Manager: System logger issues
many ENF event code 48 of use to a resource manager application.
See:
v Using ENF Event Code 48 in System Logger Applications on page 27-18 for
using ENF event code 48 events.
v Writing an ENF Event 48 Listen Exit on page 27-47 for ENF event code 48
events and coding an ENF listen exit.
27-26
27-27
Last Disconnection for Log Stream on a System: System logger rejects any
new requests from the system for that log stream. All the log data from this system
is then offloaded to DASD log stream data sets. This may include log data written
from other systems connected to the log stream. For coupling facility log streams,
the coupling facility resident data is offloaded to DASD log data sets. For
DASD-only log streams, the log data in local storage buffers is written to DASD log
data sets.
If the application disconnects with outstanding asynchronous requests, the
disconnect is accepted. Asynchronous requests then complete without notifying the
disconnecting application.
Last Disconnection for a System in the Sysplex: System logger offloads all the
log data to DASD log stream data sets.
For coupling facility log streams, the coupling facility resident data is offloaded to
DASD log data sets. Any coupling facility resources allocated for a coupling facility
log stream are released. If a coupling facility structure is being shared among
multiple log streams, the structure space is re-divided evenly among coupling facility
log streams with connected applications at that time.
For DASD-only log streams, the log data in local storage buffers is offloaded to
DASD log data sets. If there are no other log streams allocated to this coupling
facility structure and no failed persistent connections exist, system logger returns
the coupling facility space to XES.
27-28
When a write or delete request occurs against the log stream, system logger gives
control to the resource manager exit, passing a parameter list. The resource
manager exit runs in the resource manager address space.
The resource manager exit is called as follows:
v For a write request, the resource manager exit is called after the write request
completes. If staging data sets are in use for the connection, the exit is called
after the write to the staging data set completes.
v For a delete request, the resource manager exit is called before the delete
request is processed. This allows the resource manager exit to accept, reject, or
override the delete request on behalf of the log stream. See Overriding Delete
Requests on page 27-31.
The resource manager exit is always invoked before the request completion is
reported to the system logger application that issued the request.
27-29
27-30
Contents
Does not contain any information for use by the resource manager
exit.
1
2-13
14
15
When the resource manager exit receives control, the ARs contain no information
for use by the resource manager exit.
Return specification: Your exit must return control to the system by branching to
the address provided on entry in register 14. Registers 2-13 must contain the same
information at output that they did on input.
Programming Considerations:
v The resource manager exit is called before write or delete event completion is
reported to the unit of work that initiated the IXGWRITE or IXGDELET service
request. Any additional processing by the exit that results in thread suspension or
affects thread response time should be performed under a different work unit.
v The resource manager exit must be prepared to receive control in either SRB or
task mode. The exit should run with an EUT FRR for recovery. While the FRR
remains in effect, no SVCs can be issued, no new asynchronous exits are
dispatched, and no vector instructions can be executed. See z/OS MVS
Programming: Authorized Assembler Services Reference SET-WTO for
information on the SETFRR service.
v All storage obtained by the resource manager exit should be associated with the
TCB that owns the cross-memory resources for that address space, whose
address is the ASCBXTCB.
v You can access the input parameter data area only while your resource manager
exit is running. If you want to save the parameter information for later processing,
make a copy of it before your resource manager exit returns control to the
system.
Overriding Delete Requests: Your resource manager can override parameters
specified on an IXGDELET request by manipulating the
RMEPLDELETEOVERRIDEBLOCKID field mapped by the IXGRMEPL mapping
macro. The resource manager manipulates the field in the parameter list (RMEPL)
passed to the resource manager exit as follows:
v Proceed with the delete operation as requested on the IXGDELET request. This
is specified by placing a return code of binary zeros in register 15.
v Do not proceed with the delete operation requested on the IXGDELET request.
This results in no log blocks being marked for deletion in the log stream. This is
specified by placing a return code of X'08' in register 15.
v Override the log block identifier specified on the IXGDELET request with one
specified by the resource manager. The overriding log block identifier must be
less than or equal to the log block identifier specified on the IXGDELET request.
This is specified by placing a return code of X'04' in register 15.
If you specify FORCE=YES on a delete request, the resource manager exit is
called, but cannot override the delete request.
If you specify AUTODELETE=YES for a log stream and you also manage that log
stream with a resource manager and a resource manager exit, note that the
automatic deletion processing takes precedence over the delete override processing
performed by the resource manager exit. Log data that is deleted by automatic
Chapter 27. Using System Logger Services
27-31
deletion does not trigger the resource manager exit, so the exit cannot override the
delete request. IBM recommends AUTODELETE=NO for a log stream managed by
a resource manager that needs to override delete requests.
When the Resource Manager Exit Hangs: If the resource manager exit hangs,
the system logger application that issued the write or delete request that triggered
the exit might not be able to complete. Do the following to resolve the hang:
v
v
v
v
v
If the resource manager abends and percolates the error back to system loggers
recovery environment, the resource manager is disabled. When a resource
manager is disabled, the exit for the resource manager is no longer called by write
or delete requests against the log stream on the system where the resource
manager abended. An ENF 48 event is issued when the resource manager exit is
disabled.
27-32
For each log block written to the log stream, IXGWRITE returns a unique log block
identifier which can be used on subsequent IXGDELET and IXGBRWSE requests to
search for, delete, read, or set the browse cursor position to that log block.
27-33
generally ensures that data gets written to DASD before the coupling facility
structure fills up, this condition can occur due to sudden bursts of activity or when
another log stream is activated and defined to the coupling facility. When this
happens, system logger will offload data from the coupling facility to DASD
immediately. Applications should not issue any further write requests until receiving
the ENF event 48 signal indicating that the storage problem is resolved. In the
event 48 parameter list mapped by macro IXGENF, bits
IXGENFLogStreamsAvailable and IXGENFLogStreamStorageAvailable will be on
and field IXGENFLogStreamNames will contain the names of affected log streams.
IXGBRWSE Terminology
Before you can read information from the log stream, you start a browse session
using the REQUEST=START request of IXGBRWSE. A browse session lasts from
the time that an application issues IXGBRWSE REQUEST=START until it issues
IXGBRWSE REQUEST=END. A log stream can have multiple browse sessions
occurring at the same time.
The REQUEST=START request returns a browse token, which is a unique 4-byte
identifier for a particular browse session. Subsequent IXGBRWSE requests in a
browse session use the browse token to identify the session to system logger. Once
27-34
an application issues the REQUEST=END request, the browse session ends and
system logger will no longer accept IXGBRWSE requests with the browse token for
that session.
The browse cursor indicates where in the log stream IXGBRWSE will resume
browsing on the next request. Each browse session has a browse cursor.
IXGBRWSE Requests
REQUEST=START starts the browse session for the application and sets the
browse cursor to the desired starting point. You can specify the browse cursor
position for a session using one of the following optional parameters:
v OLDEST - which is the default, starts the browse session at the oldest (earliest)
log block.
v YOUNGEST - starts the browse session at the youngest (latest) log block. Note
that the record that is the youngest when the browse session starts might no
longer be the youngest record at the end of the browse session because of
concurrent write activity to the log stream.
v STARTBLOCKID - specifies that the browse session start at a specified log block
identifier. The block identifier for a log block is returned by system logger when it
is written to the log stream (IXGWRITE) in the field specified by the
RETBLOCKID parameter.
v SEARCH - specifies that the browse session start at the log block with the
specified time stamp. See Browsing for a Log Block by Time Stamp on
page 27-36 for details on how IXGBRWSE processes time stamps.
Field ANSAA_BROWSEMULTIBLOCK in the answer area will be set on if the level
of system logger supports MUTLIBLOCK=YES requests for
REQUEST=READCURSOR.
REQUEST=RESET positions the browse cursor to either the oldest or youngest
(POSITION=OLDEST or POSITION=YOUNGEST) log block in the log stream.
REQUEST=READBLOCK reads a selected log block in the log stream. You identify
the block you want to read by either the block identifier (BLOCKID parameter) or
the time stamp (SEARCH parameter). The block identifier for a log block is returned
by system logger in the field specified by the RETBLOCKID parameter when the log
block is written to the log stream (IXGWRITE).
REQUEST=READCURSOR reads the next oldest or youngest log block or blocks in
the log stream, depending on the direction specified on the request
(DIRECTION=OLDTOYOUNG or YOUNGTOOLD). The block or blocks read also
depends on the position of the cursor at the time you issue the request. The
MULTIBLOCK value determines whether one or more blocks will be returned.
Applications must take into account that reading a series of consecutive log blocks
using REQUEST=READCURSOR might not yield blocks in sequence by local time
stamp. This can happen, for example, because of daylight savings time.
27-35
VIEW=ACTIVE
Specifies that the browse request browse just active data. VIEW=ACTIVE is
the default.
VIEW=ALL
Specifies that the browse request browse all data, both active and inactive.
The flag ANSAA_BLKFROMINACTIVE in the answer area indicates if the returned
log block (or any of the returned log blocks when MULTIBLOCK=YES is specified)
came from inactive data. If MULTIBLOCK=YES is specified,
IXGBRMLT_FROMINACTIVE will indicate if a particular log block came from
inactive data.
The VIEW parameter can be specified on both the REQUEST=START and
REQUEST=RESET requests of IXGBRWSE. For the duration of a browse session,
the VIEW specification remains in effect.
27-36
Logstream
9:00
10:00
11:00
Browse direction:
OLDEST
YOUNGEST
Given the example log stream in Figure 27-8, system logger would do the following:
v If you specify 8:00 on the SEARCH keyword, this is older (earlier) than any log
block in the log stream and IXGBRWSE will set the cursor at or returns the
oldest time stamp, in this case, 9:00.
v If you specify 10:30 on the SEARCH keyword, IXGBRWSE sets the cursor at or
returns the next latest (youngest) log block, 11:00.
v If you specify 12:00 on the SEARCH keyword, this time stamp is younger (later)
than any existing log block and IXGBRWSE rejects the request with a return
code of X'08' and a reason code of X'0804'.
27-37
The following return and reason codes may be issued to indicate the particular
condition:
v IXGBRWSE MODE=SYNCECB or MODE=SYNCEXIT requests that are
processed asynchronously will result in a return code of X'04' and a reason code
of X'401', and will be handled in the same manner as MULTIBLOCK=NO
requests.
v When an IXGBRWSE request results in a return code of X'0' with a reason code
of X'0', then the return and reason codes are always 0 for each IXGBMRLT for
the log blocks, and data is always returned.
v When an IXGBRWSE request results in a return code of X'04' with a reason
code of X'416', data is always returned. Any combination of return code 4/reason
code 4xx or return code 0/reason code 0 may be returned in the output buffer
area.
v If a return code of X'04' with a reason code of X'417' is returned, then only the
last IXGBMRLT has a return code of 08. There may be an earlier log record with
an IXGBMRLT return code 04/reason code 4xx.
v It is possible to have some log records read back and then get an IXGBRMLT
return and reason code that requires a wait for an ENF 48 event. The
IXGBRWSE return code would be X'04' with a reason code of X'417', and the
last IXGBRMLT would contain the ENF 48 condition (8/8xx).
v When the browse request reaches the end of log after moving some data into the
buffer, the last IXGBRMLT will have a return code of X'08' with a reason code of
X'848' and IXGBRWSE will have a return code of X'04' with a reason code of
X'417'. If another IXGBRWSE is issued and there are still no more log records to
read, the IXGBRWSE service will have a return code of X'08' with a reason code
of X'848'. The buffer area is undefined for this return/reason code, so you cannot
trust its contents.
27-38
Log stream
Log blocks:
9:00
Block ID: 1
10:00
Block
ID: 2
2
Block ID:
10:30
Block
ID: 3
3
Block ID:
11:00
12:00
Block ID: 4
Block ID: 5
OLDEST
YOUNGEST
Log stream
Log blocks:
9:00
10:00
10:30
11:00
12:00
Block ID: 1
Block ID: 2
Block ID: 3
Block ID: 4
Block ID: 5
OLDEST
YOUNGEST
27-39
Making Sure Log Blocks are Imported in Sequence Understanding Log Block Identifiers
When you import data to a log stream (using IXGIMPRT), the requests are issued
with a log block identifier and GMT time stamp identical to the matching log block in
the source log stream. The application must make sure to import these log blocks in
ascending log block/GMT time stamp order.
For example, if the importing application has log blocks with identifiers 1, 2, and 4
ready to import, the application might need to wait and check for log block 3 before
importing 1, 2, and 4 into a log stream. Once log block 4 has been imported, log
block 3 can never be imported into the log stream (unless you delete and redefine
the log stream). In order to determine whether it is importing log blocks in the
correct order, the application must understand the way system logger generates log
block identifiers.
The block identifier consists of the logical relative byte address of the log block in
relation to the start of the log stream. The first log block written to a log stream is
assigned a block identifier of one. Whenever a system logger application writes a
log block successfully to the log stream, system logger adds additional control
information to the log block. To generate the sysplex-wide unique block identifier,
system logger uses:
v The block identifier of the last log block written.
v The length of the current log block (specified by the caller).
27-40
How Do I Know What the Length of the Control Information Is?: Applications
can ascertain the length of the control information generated by system logger
using the IXGQUERY service, which returns the information in a buffer mapped by
the IXGQBUF macro (QBUF_CONTROL_INFO_SIZE field).
Example: How Log Block Identifiers are Generated: The following is an
example of how log block identifiers are generated:
v The log block identifier generated for the first log block is one.
v The first log block is one hundred bytes. The length of the control information
system logger adds to a log block for this log stream is 25 bytes: this information
was found using the IXGQUERY service.
v The block identifier for the second log block is generated by adding the first log
block identifier to the length of the first log block and the length of the control
information: 1+100+25 or 126.
v The 2ND log block is 50 bytes in length, and system logger again added 25
bytes of control information. The block identifier for the third block is 50+25+126
or 201.
27-41
stream, creating a duplicate or back-up log stream, you can use IXGQUERY to
ascertain the safe import point for a log block before importing it, to make sure the
two log streams are synchronized.
See:
v Coupling Facility Log Streams and the Safe Import Point.
v DASD-Only Log Streams and the Safe Import Point on page 27-44.
Coupling Facility Log Streams and the Safe Import Point: Keeping the log
streams synchronized can be particularly difficult when the situation involved
coupling facility log streams. If the importing application imports data from a source
to a target log stream before it is safely hardened on DASD log data sets or staging
data sets, you might get inconsistencies between the source and target log
streams. For example, if an importing application involves coupling facility log
streams, it is particularly difficult to keep the two log streams synchronized. For
example, Figure 27-10 on page 27-43 illustrates the problem. This figure shows a
source log stream, SOURCE1, that is written to by applications on two systems,
SYS1 and SYS2. SYS1 also contains the coupling facility containing the structure
associated with SOURCE1. That means that SYS1 contains a single point of failure
and is therefore backed up by a staging data set. SYS2 is a failure independent
connection and is not using a staging data set for SOURCE1.
SYS2 has written log blocks 4, 5, and 6 to the log stream coupling facility structure
associated with SOURCE1. SYS1 wrote 1, 2, and 3 to the SOURCE1s coupling
facility structure. The importing application on SYS3 browses log stream SOURCE1,
seeing log blocks 1 through 6 and imports them to log stream TARGET1.
Meanwhile, on SYS1 log blocks 1 and 2 got duplexed to the staging data set, but
before 3 could be duplexed, a failure in SYS1 knocked out both the MVS system
and the coupling facility. When a rebuild is initiated, only SYS2 can participate to
repopulate the log stream. SYS2 repopulates the new structure with the data it
wrote (log blocks 4, 5, and 6) and gets blocks 1 and 2 from the staging data set for
SYS1. But log block 3 is not repopulated to the rebuilt structure because the data
was not committed to the staging data set. Thus, after the rebuild, log stream
SOURCE1 contains blocks 1, 2, 4, 5, and 6, while TARGET1 contains 1-6. The
source and target log streams are now out of sync.
27-42
Before Rebuild
After Rebuild
CPC 1
Sys 1
Coupling
Coupling Facility
Facility
Structure A
2
1
11
22
33
44
Structure A
55
. . .. . .
66
SYS2/Source1
Staging
Data
Set
66
5
CPC 2
Sys 2
CPC 3
CPC 4
Coupling
Coupling Facility
Facility
Sys 3
Structure B
1XG1MPRT
11
22
33
44
Structure B
55
66
. . .
Figure 27-10. How Source and Target Log Streams Can Get Out of Sync
To prevent this problem, system logger provides the safe import point. This helps an
application ensure that log data is safe to import. The safe import point is the
highest log block identifier that is no longer in the coupling facility structure for a log
stream. Any blocks with a block identifier less than or equal to the safe import point
can be safely imported to the target log stream. In the example shown above, log
streams SOURCE1 and TARGET1 are potentially out of sync unless the importing
application on SYS3 determines the safe import point before importing the data to
the target log stream. An application can determine the safe import by doing one of
the following:
v Issue IXGQUERY, which returns the safe import point.
v Listen for ENF event 48 indicating that the safe import point has been updated,
(field IXGENFWrOffLoadSafeImportPoint in the parameter list mapped by macro
IXGENF contains the latest safe import point.) The ENF is issued when an
offload operation completes. Notification that the offload has completed is
presented on all systems in the sysplex that have a connection to the log stream.
For example, using the example in Figure 27-10 again, log blocks 1-6 have been
written to log stream SOURCE1. Log blocks 1 and 2 have been offloaded to DASD
log data sets, so log stream SOURCE1 starts with a safe import point of 2. As
before, only blocks 1 and 2 from SYS1 are duplexed to SYS1s staging data set.
Log block 3 has not yet been duplexed. The importing application has browsed log
stream SOURCE 1 and seen blocks 1-6, but this time, before importing them all, it
issues IXGQUERY to find that the safe import point is 2. The resource manager exit
imports only log blocks 1 and 2.
When the rebuild occurs, SYS2 repopulates the new structure with log blocks 1, 2,
4, 5, and 6. Again, log block 3 is not repopulated to the rebuilt structure because
the data was not committed to the staging data sets. When the browsing application
Chapter 27. Using System Logger Services
27-43
DASD-Only Log Streams and the Safe Import Point: For a DASD-only log
stream data is duplexed to DASD staging data sets as it is written to the log
stream. This means that the chance of losing data because of a system failure is
far less; There is no lag time between a successful write and hardening of the data
on DASD. And of course, a coupling facility failure will not affect a DASD-only log
stream. However, it can be helpful for an application to use the IXGQUERY service
to ensure that log data is safe to import from a DASD-only source log stream. For a
DASD-only log stream, the safe import point is the highest log block identifier that
has been successfully written to the log stream. The safe import point for a
DASD-only is updated with each successful write, because the log data is
simultaneously duplexed to DASD staging data sets. Any log blocks in the source
log stream with a block identifier less than or equal to the safe import point can be
safely imported to the target log stream. An application can determine the safe
import point by doing one of the following:
v Issue IXGQUERY, which returns the safe import point.
v Listen for ENF event 48 indicating that the safe import point has been updated,
(field IXGENFWrOffLoadSafeImportPoint in the parameter list mapped by macro
IXGENF contains the latest safe import point.) The ENF is issued when an
offload operation completes. Notification that the offload has completed is
presented on all systems in the sysplex that have a connection to the log stream.
Using the Coupling Facility Version Number: The coupling facility list structure
version number returned for coupling facility log streams is helpful in situations
where a rebuild occurs while the resource manager responsible for gathering data
for a log stream was inactive at the time of the rebuild. A browsing application can
27-44
tell if a rebuild has occurred since it was last connected by checking to see if the
coupling facility list structure version number has increased since the last browse
session. If a browsing application connects to a log stream and issues IXGQUERY
to find that the version number has increased, it should then begin browsing from
the last valid safe import point it knew about for the most up to date version of the
log stream contents.
For example, imagine an application browses log blocks 1 through 6 in a source log
stream in anticipation of importing them. Before importing the log blocks to the
target log stream, the application checks for the safe import point using IXGQUERY
and imports only blocks 1 and 2. Then, the browsing application is cancelled or fails
and disconnects from the log stream, saving the current coupling facility list
structure version number and safe import point it knows about (2).
A rebuild then occurs and the new content of the source log stream consists of 1, 2,
4, 5, and 6. The browsing application then reconnects to the log stream and issues
IXGQUERY for the new list structure version number and safe import point. Since a
rebuild has occurred, the version number will have increased. The browsing
application begins browsing again from the last safe import point (2) to the new safe
import point (6), and only imports log blocks 4, 5, and 6.
27-45
v Issuing the IXGQUERY service (see The Safe Import Point: Using IXGQUERY
and IXGIMPRT Together on page 27-41) to verify that the data is safe to import
to the target log stream.
You must verify the safe import point because it is not always updated for an
IXGOFFLD initiated offload even though the safe import point is tied to offloading.
This is true because of the way system logger manages log data set control
intervals that are not yet full.
Why Would I Need to Change a Time Stamp on a Log Stream? The IXGUPDAT
service is useful mainly to coupling facility log streams. If an application writes to
multiple coupling facility log streams at the time of a failure necessitating recovery
processing, database recovery processing truncates the log streams to the latest
point consistent across all the log streams. This can mean a loss of data. For
example, lets say an application writes to two log streams. In log stream 1, the last
log block written was at 9 A.M.. In log stream 2, the last log block was written at
9:15 A.M.. The recovery process logically truncates log stream 2 data to 9 A.M., to
be consistent with log stream 1 for recovery. This means that the data written to log
stream 2 between 9:00 and 9:15 is lost.
In this situation, you would use IXGUPDAT to update the time stamp for log stream
1 to 9:15 or greater so that all data for both log streams can be recovered. All data
written to the two log streams up until 9:15 A.M can then be recovered. IXGUPDAT
lets you advance the time stamp for a log stream or streams to the latest time
among all the log streams. This ensures that log streams have a consistent time
stamp and include all the data written to any of the log streams.
27-46
If the rebuild occurs after one or more successful write requests have occurred
since the IXGUPDAT request, the time stamp is reset for the last post-IXGUPDAT
written and recovered log block time stamp. If however, the rebuild occurs before
any write requests to the log stream since the IXGUPDAT request, the time stamp
for the log stream reverts to the last pre-IXGUPDAT written and recovered write
request.
27-47
v Log streams associated with the coupling facility structure specified in this
parameter list are not available. The event reasons for this event are:
A rebuild has been started for the coupling facility structure.
A rebuild for the coupling facility structure has failed. The specific reasons for
this condition in the parameter list are:
- The system lost connectivity to the coupling facility structure.
- The coupling facility structure failed.
v A change in the status of resources for a log stream has occurred. The event
reason for this event is possible loss of log stream data.
v A change in the coupling facility resources available to system logger has
occurred. An event reason for this event indicates that ENF event 35 was
received to report the change. If the change affects a specific coupling facility
structure, the name of the structure is specified in the specific information section
of the parameter list.
v A successful connect to or disconnect from a log stream has occurred. The
scope of this event is multi-system; each system in the sysplex is notified of this
event. The structure version value for DASD-only log streams will be the STCK
value for when the log stream staging data set was allocated.
v A log stream definition in the LOGR couple data set has been created. The
scope of this event is multi-system; each system in the sysplex is notified of this
event.
The log stream created is a DASD-only log stream.
- For DASD-only log streams, an indicator in the parameter list will be set on
(IXGENFINVENTORYDASDONLYYES) and most structure related fields
will be set to zero.
A log stream definition has been deleted from the LOGR couple data set. The
scope of this event is multi-system; each system in the sysplex is notified of
this event.
A log stream definition in the LOGR couple data set has been updated. The
scope of this event is multi-system; each system in the sysplex is notified of
this event.
System logger completed offload processing for a log stream. All systems with
an active connection to the log stream for which the offload was done are
notified of the event.
The resource manager associated with a log stream is disabled because of an
abend. The system where the resource manager is disabled is notified.
The listen exit should only be used to analyze the IXGENF parameter list for
event code 48 to see whether the particular event applies to the particular
application or connector. IBM recommends that the listen exit then communicate
with the application about the event and let the application react or take any
necessary actions, such as stop issuing services, re-IPL, and so forth. This is
recommended because:
The application or connector can determine whether the event actually affects
them before taking any action. All connectors are informed of event 48 events,
whether they affect their particular log stream or coupling facility structure or
not.
It ensures that the action needed to address an event will be coordinated with
the application program since the listen exit must be in SRB mode while the
application is in task mode. If you code the exit to actually act on event code
48 status events, the exit might tie up system logger resources.
27-48
Preparing to use the LOGR Subsystem: If you want to use the LOGR
subsystem to read log stream data in data set format, make sure of the following:
v The LOGR subsystem must be activated on each system where you expect to
use it.
Note that you cannot use either the SETSSI ACTIVATE or SETSSI DEACTIVATE
command to activate or deactivate the LOGR subsystem. See the chapter on
system logger functions in z/OS MVS Setting Up a Sysplex.
Each system must have LOGR defined as a subsystem on the SUBSYS
statement in the job that runs the subsystem.
v The log stream owner must supply an exit that generates a view of its log data.
You can use this to ensure that the new application program is written with the
correct data format in mind. See z/OS MVS Programming: Assembler Services
Guide.
27-49
v The system where the new log data reading application runs on must be in the
same sysplex as the log stream.
v The application must have the appropriate SAF authority (READ/WRITE) to the
log stream, SAF CLASS(LOGSTRM) RESOURCE(log_stream_name).
If there is no log stream class defined to a security product such as RACF, no
access checking is performed.
v Make sure the LOGR subsystem is activated.
References:
v See the chapter on planning for system logger functions in z/OS MVS Setting Up
a Sysplex.
v See z/OS MVS Initialization and Tuning Reference for information about the
IEFSSNxx parmlib member.
v See z/OS MVS System Commands for information about the SETSSI command.
v See z/OS MVS Installation Exits for information about the LOGR subsystem exit.
DD
DSNAME=log.stream.name,
SUBSYS=(LOGR[,exit_routine_name][,SUBSYS-options1][,SUBSYS-options2])
where:
SUBSYS-options1:
[FROM={({[yyyy/ddd][,hh:mm[:ss]]}) |OLDEST}]
[TO={({[yyyy/ddd][,hh:mm[:ss]]}) |YOUNGEST}]
[,DURATION=(nnnn,HOURS)]
[,VIEW={ACTIVE| ALL | INACTIVE }]
[,GMT|LOCAL]
SUBSYS-options2:
defined by the log stream owner
Note: Quotation marks around keywords are required when parentheses, commas,
equal signs or blank characters are used within the SUBSYS keyword.
Other DD keywords will be validated, if specified, but will be ignored in the LOGR
subsystem processing.
27-50
DSNAME=log.stream.name
Specifies the name of the log stream to read. The name can be 1 to 26
characters in a data set name format.
SUBSYS=(LOGR[,exit_routine_name][,SUBSYS-options1][,SUBSYS-options2])
Specifies that processing of this DD is to be handled by the LOGR subsystem.
The exit_routine_name is the second positional parameter and specifies the
name of the exit routine to receive control from the LOGR subsystem. If the
exit_routine_name parameter is not specified (null), the default log stream
subsystem exit routine, IXGSEXIT, will be used. To access records from the
logrec log stream, specify IFBSEXIT.
SUBSYS-options1
Specifies options meaningful to all exit routines. See the documentation for a
specific log stream exit for exceptions to these common options. The keywords
are:
FROM=starting_time
Indicates the starting time of the first log stream block to be processed
based on the log stream view that the VIEW keyword specifies. The first
block will be the one with a time stamp later than or equal to the specified
time.
OLDEST
Indicates the first block read will be the oldest block on the log stream.
OLDEST is the default.
yyyy/ddd
Specifies the start date. If the date is omitted, the current date is
assumed.
yyyy is a four-digit year number and ddd is a three-digit day number
from 001 through 366 (366 is valid only on leap years). For example,
code February 20, 2000 as 2000/051, and code December 31, 1996 as
1996/366.
hh:mm[:ss]
Specifies the start time. If the time is omitted, the first block written after
midnight will be used.
hh is a two digit hour number from 00 to 23, mm is a two digit minute
number from 00 to 59, and ss is a two digit second number from 00 to
59. The seconds field and associated : delimiter can be omitted if not
required by the log stream owner.
The FROM keyword is mutually exclusive with the DURATION keyword.
TO=ending_time
Indicates the ending time of the last log stream block to be processed
based on the log stream view that the VIEW keyword specifies. The last
block will be the one with a time stamp earlier than or equal to the specified
time.
YOUNGEST
Indicates the last block read will be the youngest block on the log
stream at the time the allocation for the DD occurs. YOUNGEST is the
default.
yyyy/ddd
Specifies the end date. If the date is omitted, the current date is
assumed.
Chapter 27. Using System Logger Services
27-51
27-52
The following sections contain examples of how to code the text units related to the
LOGR SUBSYS options. The text unit key is identified followed by an example of
the EBCDIC characters that would be used for the particular example. The text
units would need to be coded as required by the Dynamic Allocation processing.
Note that spaces between the characters is for readability purposes.
Subsystem Name Request Specification - Key = 005F
Example: To request subsystem LOGR, code:
KEY #
LEN
PARM
005F 0001 0004 D3 D6 C7 D9
27-53
Example 1:
KEY #
LEN
0060 0003 0008
PARM
C9 C6 C2 E2 C5 E7 C9 E3
LEN
0017
PARM
C6 D9 D6 D4 7E D6 D3 C4 C5 E2 E3
6B E3 D6 7E E8 D6 E4 D5 C7 C5 E2 E3
LEN
000B
PARM
C4 C5 E5 C9 C3 C5 E2 E3 C1 E3 E2
Example 2:
Here are a few examples of how to code the SUBSYS parameters when reading
CICS log streams.
Assume the corresponding JCL DD options are desired (ignoring the JCL column
alignment) and the Subsystem name text unit (key = 005F) is also coded as
above.
a
SUBSYS=(LOGR,DFHLG520,"FROM=(1998/350,12:00:00),GMT",
COMPAT41)
KEY #
LEN PARM
0060 0003 0008 C4 C6 C8 D3 C7 F5 F2 F0
LEN
001C
PARM
C6 D9 D6 D4 7E 4D F1 F9 F9 F8 61 F3 F5 F0
6B F1 F2 7A F0 F0 7A F0 F0 5D 6B C7 D4 E3
LEN
0008
PARM
C3 D6 D4 D7 C1 E3 F4 F1
b.
SUBSYS=(LOGR,DFHLGCNV,"FROM=(1998/287,00:00:00),
TO=(1998/287,17:30:00),LOCAL,DELETE)
KEY
0060
#
LEN PARM
0003 0008 C4 C6 C8 D3 C7 C3 D5 E5
LEN
0035
PARM
C6 D9
6B F0
7E 4D
7A F3
LEN
0006
PARM
C4 C5 D3 C5 E3 C5
D6
F0
F1
F0
D4
7A
F9
7A
7E
F0
F9
F0
4D
F0
F8
F0
F1
7A
61
5D
F9
F0
F2
6B
F9
F0
F8
D3
F8
5D
F7
D6
61
6B
6B
C3
F2
E3
F1
C1
F8 F7
D6
F7
D3
c.
SUBSYS=(LOGR,DFHLG520,,LASTRUN)
KEY
0060
#
0003
LEN
0008
PARM
C4 C6 C8 D3 C7 F5 F2 F0
LEN
0000
PARM
-
LEN
0007
PARM
D3 C1 E2 E3 D9 E4 D5
27-54
27-55
reconnect to the log stream and when. Note that for another system to connect to
the log stream and perform recovery, the staging data sets must reside on devices
accessible by both systems.
27-56
In this case, applications connected to the affected log streams must wait for the
structure to be rebuilt successfully and the system to issue an ENF 48 event to
indicate that the log streams are available.
27-57
is notified. A dynamic rebuild of the structure is initiated so that the log data can be
moved to a non-volatile coupling facility. During rebuild processing, system logger
rejects any logger service requests.
If there is not a structure available in a non-volatile coupling facility, system logger
will still rebuild the data on a new volatile coupling facility. System logger may then
change the way it duplexes coupling facility data since the volatile coupling facility
constitutes a single point of failure:
v For log streams defined with STG_DUPLEX=YES, system logger will begin
duplexing data to staging data sets, if they were not already in use.
v For log streams defined with STG_DUPLEX=NO, system logger will keep on
duplexing data to local storage buffers on each system.
27-58
27-59
Some products provide a program to delete log stream data. See Deleting
Log Data and Log Data Sets in z/OS MVS Setting Up a Sysplex for
information on deletion programs provided for IBM products. See the
documentation for the product to see if it provides a deletion program.
Delete log stream definitions from the LOGR couple data set.
Identify and delete the definitions for unused or unnecessary log streams. This
will free the directory space associated with the log streams, which may free
up directory extents for use by other log streams.
Note: Deleting DASD log data sets using a non-system logger method will not
work because system logger will still count the data sets toward the data
set directory entry limit. You cannot, for example:
Use a TSO/E DELETE command to delete a log data set.
Use DFHSM to migrate log stream data sets to tape.
When Unrecoverable DASD I/O Errors Occur During Offload: DASD I/O errors
may occur during offload processing, while log data is being written to DASD log
data sets. When this happens, system logger tries to recover by closing the current
log data set and allocating a new one. If this process fails, the I/O error is
characterized as an unrecoverable I/O error.
In the case of unrecoverable I/O errors, system logger will accept subsequent
IXGWRITE requests as follows:
v For a coupling facility log stream, system logger will accept IXGWRITE requests
if the log stream is connected to a coupling facility where there is still room for
log data. If the coupling facility is full or no coupling facility exists, system logger
rejects IXGWRITE requests.
v For a DASD-only log stream, system logger will accept IXGWRITE requests until
the staging data set for the system writing to the log stream is filled.
IXGBRWSE and IXGDELET requests may continue to work. I/O errors encountered
in the process of completing these requests are reported to the application in return
and reason codes.
To correct an unrecoverable I/O problem, delete the log stream definition in the
LOGR policy and redefine it with different log data set attributes, such as
LS_DATACLAS, in order to get the log stream data set allocated in a usable
location.
When Staging Data Set Unrecoverable DASD I/O Errors Occur: DASD I/O
errors may occur when log data is being duplexed to DASD staging data sets.
When this occurs, system logger tries to recover by doing the following:
1. Offload current log data to DASD log data sets.
2. Delete and unallocate the staging data set.
27-60
27-61
27-62
28-1
28-2
A-1
A look-up value is an internal representation of the unit name, used as an index into
the EDT. Because teleprocessing devices do not have generic device names, you
cannot use this function to request information about teleprocessing devices.
Note: Do not use this function to determine whether a returned unit name is a
generic CTC device or an esoteric group name that contains CTC devices.
Instead, use the return attributes function (function code 8) for this purpose.
Callers of IEFEB4UV
The unit verification routine, IEFEB4UV, is for both problem program callers and for
authorized callers. It runs in task mode in the callers key.
To use IEFEB4UV, the calling program must do the following:
v Create the input data structures and parameter list
v Place the address of an 18-word save area in register 13
v Provide a recovery environment
A-2
Function Requested
Check groups
Check units
Return unit name
Return UCB addresses
Return group ID
Indicate unit name is a look-up value
Return look-up value
Convert device name to a look-up value
Return attributes
Specify subpool for returned storage
Return unit names for a device class
Reserved for IBM use
Parameter list
0
Unit Table
4
FLAGS
8
A-3
Because many of the input and output data structures are the same, you can
request many of the functions in combinations with other functions. The following
table lists the valid single functions and combinations of functions that you can
request in a single invocation of the unit verification service.
Code
0
0,1
0,1,5
1
1,5
2
2,7
2,8
2,7,8
3
3,5
3,8
3,10
3,5,7
3,5,10
3,8,10
3,5,7,10
4
6
6,8
7
8
10,11
11
A-4
Unit Table
Number of
Device Numbers
12
Device Number
List
Device Number
4
Device Number
8
Device Number
.
.
.
Device Number
Output: None.
Register 15 contains one of the following return codes:
Code
0
12
24
28
36
Meaning
The specified input is correct.
The device groupings are not valid.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
Number of
Device Numbers
Device Number
List
Device Number
Device Number
4
8
.
.
.
Device Number
Output: If a device number is not valid, bit 0 of the FLAG byte is set to 1.
Register 15 contains one of the following return codes:
Code
0
4
Meaning
The specified input is correct.
The specified unit name is not valid.
Appendix A. Using the Unit Verification Service
A-5
8
20
24
28
36
Look-Up Value
Output: The unit table contains the unit name as shown in the following figure.
Unit Table
Unit Name
(EBCDIC)
Meaning
The unit table contains the EBCDIC unit name.
The look-up value could not be found in the EDT.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
A-6
Unit Table
Unit Name
(EBCDIC)
Output: The unit table contains a pointer to the UCB Pointer List as shown in the
following figure.
Unit Table
0
8
Unit Name
(EBCDIC)
Sub
pool
Length
Number of entries
UCB
.
.
.
UCB
For unauthorized callers, the subpool default is 0. See function code 10 for a
description of how to change the default subpool. The caller must free the number
of bytes in the length field from the subpool before exiting.
Register 15 contains one of the following return codes:
Code
0
4
16
24
28
36
Meaning
The unit table contains the pointer to the UCB pointer list.
The unit name could not be found in the EDT.
Storage was not available for the UCB pointer list.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
A-7
Unit Table
Group ID List
Group ID List
UCB List
.
.
.
0
4
UCB List
Number of
entries
UCB
.
.
.
UCB
Note: One fullword is provided in the group id list for each UCB in the UCB list.
Initialize all entries to zero.
Output: The group id list contains the group id corresponding to each UCB in the
input UCB list.
Group ID List
Group ID
.
.
.
Group ID
Note: If the UCB is not in the EDT, the group id for that particular entry remains
zero.
Register 15 contains one of the following return codes:
Code
0
24
28
36
Meaning
Processing is successful.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
A-8
This function is not valid by itself. It must be used in combination with other
functions that require a unit name as input. If you know the look-up value
corresponding to the unit name, you can substitute it for the unit name in the input
unit table. The following figure represents the first two fullwords of the unit table
when function code 5 is requested.
Unit Table
0
Look-up Value
4
0
Figure A-10. Requesting Function Code 5 (Indicate Unit Name is a Look-up Value)
Meaning
Processing is successful.
The input look-up value could not be found in the EDT.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
A-9
Unit Table
0
8
Look-up Value
Meaning
Processing is successful.
The unit name could not be found; no look-up value is returned.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
8
Device Type
Figure A-13. Requesting Function Code 7 (Convert Device Type to Look-up Value)
Note: The device type is in the format of the UCBTYP field of the UCB.
8
Look-up Value
Figure A-14. Output from Function Code 7 (Convert Device Type to Look-up Value)
A-10
The conversion of the device type to a look-up value is done in place. There is no
error checking of the device type.
Register 15 contains one of the following return codes:
Code
0
4
24
28
36
Meaning
Processing is successful.
The input device type is not valid; no look-up value is returned.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
Unit Table
Unit Name
(EBCDIC)
Attribute Area
X '0A'
12
Attribute
Area
2
0
4
0
6
0
8
0
10
0
Contents
Length of the attribute area (X'0A') This must be filled in prior to calling the
unit verification service.
1-2
4-7
8-9
Reserved
Meaning
The unit name was found; the attributes are returned.
The unit name was not found; no attributes are returned.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
Appendix A. Using the Unit Verification Service
A-11
36
16
Subpool
Figure A-16. Requesting Function Code 10 (Specify Subpool for Returned Storage)
Output: See the output from the function that this is invoked in combination with.
The subpool field of the returned list contains the input subpool, and the returned
list resides in that subpool. No error checking of the subpool is performed. If the
subpool is not valid, the unit verification routine fails.
16
Device
Class
Figure A-17. Requesting Function Code 11 (Return Unit Names for a Device Class)
Output: The unit table contains the pointer to the names list as shown in the
following figure.
A-12
Unit Table
4
Names List
Names List
Subpool
Length
4
Number of Entries
16
8
Device
Class
Unit Name
16
.
.
.
Unit Name
Figure A-18. Output from Function Code 11 (Return Unit Names for a Device Class)
For unauthorized callers, the default subpool is 0. To change this default, see the
description for function code 10 (specify subpool for returned storage). The caller
must free the number of bytes in the length field from the subpool before exiting.
Register 15 contains one of the following return codes:
Code
0
16
24
28
36
Meaning
The pointer to the names list is stored in the unit table.
Storage was not available for the names list.
The JESCT does not contain valid pointers.
The required input is not specified or is not valid.
An empty UCB list is being returned.
A-13
Unit Table
C 'DASD'
8
3
12
Device Number
List
C '301'
C '302'
Output:
Device Number List
C '300'
C '301'
C '302'
Register 15
0
Note: All input device numbers make up a single allocation group and are
associated with the esoteric unit name DASD.
A-14
Unit Table
0
C 'New tape'
X '1020'
16
252
Output:
Unit Table
0
C 'New tape'
28
252
8
UCB Pointer List
5
F52800
16
F528E0
252
F529C0
Register 15
F52AA0
F52B80
The caller must free the UCB pointer list before exiting.
0
X '00098000'
Device Number
List
C '510'
C '511'
C '512'
C '00E'
A-15
Output:
Device Number List
C '510'
C '511'
C '512'
C '00E'
X '80'
Note: Device 00E did not belong to the unit name that was associated with the
input look-up value.
A-16
Appendix B. Accessibility
Accessibility features help a user who has a physical disability, such as restricted
mobility or limited vision, to use software products successfully. The major
accessibility features in z/OS enable users to:
v Use assistive technologies such as screen-readers and screen magnifier
software
v Operate specific or equivalent features using only the keyboard
v Customize display attributes such as color, contrast, and font size
B-1
B-2
Notices
This information was developed for products and services offered in the USA.
IBM may not offer the products, services, or features discussed in this document in
other countries. Consult your local IBM representative for information on the
products and services currently available in your area. Any reference to an IBM
product, program, or service is not intended to state or imply that only that IBM
product, program, or service may be used. Any functionally equivalent product,
program, or service that does not infringe any IBM intellectual property right may be
used instead. However, it is the users responsibility to evaluate and verify the
operation of any non-IBM product, program, or service.
IBM may have patents or pending patent applications covering subject matter
described in this document. The furnishing of this document does not give you any
license to these patents. You can send license inquiries, in writing, to:
IBM Director of Licensing
IBM Corporation
North Castle Drive
Armonk, NY 10504-1785
USA
For license inquiries regarding double-byte (DBCS) information, contact the IBM
Intellectual Property Department in your country or send inquiries, in writing, to:
IBM World Trade Asia Corporation
Licensing
2-31 Roppongi 3-chome, Minato-ku
Tokyo 106, Japan
The following paragraph does not apply to the United Kingdom or any other
country where such provisions are inconsistent with local law:
INTERNATIONAL BUSINESS MACHINES CORPORATION PROVIDES THIS
PUBLICATION AS IS WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
OF NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A
PARTICULAR PURPOSE. Some states do not allow disclaimer of express or
implied warranties in certain transactions, therefore, this statement may not apply to
you.
This information could include technical inaccuracies or typographical errors.
Changes are periodically made to the information herein; these changes will be
incorporated in new editions of the publication. IBM may make improvements and/or
changes in the product(s) and/or the program(s) described in this publication at any
time without notice.
Any references in this information to non-IBM Web sites are provided for
convenience only and do not in any manner serve as an endorsement of those
Web sites. The materials at those Web sites are not part of the materials for this
IBM product and use of those Web sites is at your own risk.
IBM may use or distribute any of the information you supply in any way it believes
appropriate without incurring any obligation to you.
C-1
Licensees of this program who wish to have information about it for the purpose of
enabling: (i) the exchange of information between independently created programs
and other programs (including this one) and (ii) the mutual use of the information
which has been exchanged, should contact:
IBM Corporation
Mail Station P300
2455 South Road
Poughkeepsie, NY 12601-5400
USA
Such information may be available, subject to appropriate terms and conditions,
including in some cases, payment of a fee.
The licensed program described in this information and all licensed material
available for it are provided by IBM under terms of the IBM Customer Agreement,
IBM International Program License Agreement, or any equivalent agreement
between us.
If you are viewing this information softcopy, the photographs and color illustrations
may not appear.
Trademarks
The following terms are trademarks of the IBM Corporation in the United States or
other countries or both:
v AFP
v DFSMS
v DFSMS/MVS
v DFSMSdfp
v Enterprise Systems Architecture/390
v Hiperspace
v IBM
v IBMLink
v Language Environment
v MVS/DFP
v MVS/ESA
v MVS/SP
v MVS/XA
v OS/390
v RACF
v RMF
v Resource Link
v SP
v SP1
v SP2
v Sysplex Timer
v System/370
v S/390
v z/Architecture
v z/OS
C-2
v z/OS.e
UNIX is a registered trademark of The Open Group in the United States and other
countries.
Other company, product and service names may be the trademarks or service
marks of others.
Notices
C-3
C-4
Index
Special characters
//JOBLIB DD statement 4-15
//STEPLIB DD statement 4-15
/*DEL statement 25-3
/*EOF statement 25-3
/*PURGE statement 25-3
/*SCAN statement 25-3
Numerics
24-bit addressing mode
description 4-1
SPIE routine consideration 7-1
31-bit addressing mode
description 4-1
SPIE consideration 7-1
46D system completion code 7-1
64-bit address space
description 12-1
using assembler instructions 12-3
binary operations 12-3
64-bit addressing mode (AMODE) 12-5
modal instructions 12-6
AMODE 24 12-6
AMODE 31 12-7
AMODE 64 12-7
non-modal instructions 12-6
64-bit instructions
pitfalls to avoid 12-7
A
ABDUMP symptom area 9-5
ABEND dump
requesting 9-1
ABEND macro
choosing to issue 8-5
invoking RTM 8-39
STEP parameter 8-26
abnormal condition
detect 7-1
process 7-1
abnormal termination
ways to avoid with ENQ/DEQ 6-13
when deleting a SPIE/ESPIE environment
when issuing CLOSE 11-13
access list
adding an entry 15-7
adding entry for data space 15-8
adding entry for hiperspace 16-29
definition 15-1
type 15-3
access list entry
adding 15-7
deleting 15-8
access register
use 15-1, 15-2, 16-6
Copyright IBM Corp. 1988, 2002
7-1
X-1
X-2
assembler instruction
examples of use in AR mode 15-7
use in AR mode 15-4, 15-5, 15-6, 15-7
ATTACH and ATTACHX macros
ASYNCH parameter 8-26
defining a recovery routine 8-7
ECB parameter 8-40
ESTAI parameter 8-7, 8-18
ETXR parameter 8-40
PURGE parameter 8-25
STAI parameter 8-7
TERM parameter 8-26
ATTACH macro
addressing mode consideration 4-15
creating subpools 11-9
DPMOD parameter 3-2
ECB parameter, use 3-4
ETXR parameter, use 3-4
example of sharing DU-ALs 16-19
GSPL parameter 11-9
GSPV parameter 11-9
LPMOD parameter 3-2
requesting subpool ownership 11-9
sharing a DU-AL with subtask 16-19
SHSPL parameter 11-9
SHSPV parameter 11-9
specify subpools 11-9
SZERO parameter 11-9
TASKLIB parameter 4-15, 4-16
use 3-1, 4-7, 4-15
authorization requirements
IXGCONN service 27-25
system logger 27-10
system logger application program 27-11
system logger couple data set 27-10
system logger, IXCMIAPU utility 27-10
availability
increasing through recovery 8-3
B
BAL instruction 4-2
BALR instruction 4-2
BAS (branch and save) instruction 4-2
BAS instruction 4-2
base register
establishing 2-9, 2-10
BASR (branch and save instruction register form) 4-2
BASR instruction 4-2
BASSM (branch and save and set mode) 4-3
BASSM instruction 4-3, 4-23
BLDL macro 4-19, 4-22, 4-23
BLDMPB macro 22-15
blocks of an object
definition 17-1
identifying blocks to be viewed 17-13
size 17-1
updating blocks in a temporary object 17-15
updating blocks on DASD 17-16
BLOCKS parameter on DSPSERV 16-9, 16-15, 16-27,
16-32
branch instruction
BAL (branch and link) 4-2
BALR (branch and link register) 4-2
BAS instruction 4-2
BASR instruction 4-2
BASSM instruction 4-3
BSM instruction 4-3
use 4-23
use with XCTL, danger 4-26
branching table
use in analyzing return codes 4-11
bring a load module into virtual storage 4-15
BSM (branch and set mode) 4-3
BSM instruction 4-3
build a symptom record 10-3
C
CALL macro
use 4-10, 4-11, 4-21, 4-23
callable cell pool service
advantages of using 13-1
compared to the CPOOL macro
data space 16-16
data space example 16-17
calling program
definition 2-1
calling sequence identifier 4-29
cell 11-6, 13-2
allocating 13-5
deallocating 13-5
cell pool 13-2
activating 13-4
anchor 13-1
contracting 13-4
creating 13-4
deactivating 13-5
disconnecting 13-5
expanding 13-4
extent 13-1
obtaining 11-6
obtaining status about 13-5
size 13-2
storage 13-2
cell pool service
CSRC4ACT service 13-5
CSRC4BLD service 13-4
CSRC4CON service 13-5
CSRC4DAC service 13-5
CSRC4DIS service 13-5
CSRC4EXP service 13-4
CSRC4FR1 service 13-5
CSRC4FR2 service 13-5
CSRC4FRE service 13-5
CSRC4GET service 13-5
CSRC4GT1 service 13-5
CSRC4GT2 service 13-5
CSRC4RF1 service 13-5
CSRC4RFR service 13-5
CSRC4RG1 service 13-5
CSRC4RGT service 13-5
13-1
X-3
compression (continued)
symbols 23-5
concatenated data sets 4-16
concurrent request for resource
limiting 6-11
connect
allocating coupling facility space 27-24
to a log stream 27-23
console
CONVCON macro 21-11
determining status 21-12
determining the name or ID 21-11
parameter list
initializing field 21-11
retrieving information 21-11
validating a name or ID 21-12
validating area ID 21-13
control
return 4-12, 4-14, 4-24
control virtual storage 11-6
CONVCON macro
parameter list 21-11
retrieving console information 21-11
convention
for passing control 4-7
convert device type to look-up value function of unit
verification service A-2
converting central to virtual address 20-9
CONVTOD macro
using 21-2
couple data set
LOGR 27-7
system logger 27-7
coupling facility
structure storage limit reached 27-33
system logger
damage 27-56
failure 27-56, 27-58
full condition 27-58
loss of connectivity to 27-57
system logger data on 27-3
coupling facility structure
system logger
storage limit reached 27-33
coupling facility version number
IXGQUERY service 27-44
CPOOL macro
use 11-6
CPUTIMER macro
using 21-2
CPYA instruction
description 15-6
example 15-7
create
hiperspace 16-24
subpool 11-9
task 3-1
create data space
example 15-8, 16-11, 16-22
rules for 16-8
X-4
create hiperspace
example 16-26
CSRCESRV macro
using with an MVS/ESA system 23-2
using with an MVS/XA system 23-3
CSRCEXA load module 23-4
CSRCMPSC macro 23-4, 23-8
CSREVW window service
defining a view of an object 17-10
CSRIDAC window service
obtaining access to a data object 17-9
terminating access to an object 17-18
CSRL16J service
passing control with all registers intact 4-4
CSRREFR window service
refreshing changed data 17-15
CSRSAVE window service
updating a permanent object on DASD 17-16
CSRSCOT window service
saving interim changes in a scroll area 17-14
updating a temporary object 17-15
CSRVIEW window service
defining a view of an object 17-10
terminating a view of an object 17-16
CSVINFO macro
Comparison with CSVQUERY 4-29
MIPR 4-29
CSVQUERY macro
Comparison with CSVINFO 4-29
current size of data space 16-10
D
DAE (dump analysis and elimination)
dump not suppressed 9-7
dump suppression 9-2
providing information through recovery 8-13
DASD (direct access storage device)
data transfer from by window services 17-3
updating a permanent object on DASD 17-16
DASD log data set
space 27-59
DASD log data sets
SMS management of 27-8
DASD-only
log stream 27-21
DASD-only log stream
system logger data on 27-4
data compression and expansion service
data which can exploit 23-1
recovery routine 23-2
summary table 23-2
data compression and expansion services
using 23-1
data compression service
steps required to compress data 23-2
using 23-1
data control block
deleting load modules that contain 11-13
SNAP dump 9-8
Index
X-5
dictionary
compression 23-5
entries 23-9
expansion 23-5
directory entry
PDS (partitioned data set) 4-1
disability B-1
disconnecting
from a log stream 27-23
dispatching priority
assign 3-2
display AR information 15-10
DIV (data-in-virtual) service
restrictions
when using IARVSERV macro 20-8
DIV macro
example 16-37
example of mapping object into data space 16-21
mapping a data-in-virtual object to a hiperspace
example 16-35
mapping a hiperspace as a data-in-virtual object
example 16-37
mapping object to a data space 16-20
programming example 14-20
retain mode 14-13, 14-17, 14-19
rules for invoking 14-20
sharing data in a window among tasks 14-20
use 14-3, 16-34
save 14-14
unaccess 14-19
unidentify 14-19
unmap 14-18
using data-in virtual 14-1
when to use data-in-virtual 14-1
documents, licensed xx
DOM macro
function 21-10
DPMOD parameter on ATTACH 3-2
DSPSERV macro
CREATE request
example 15-8, 16-11, 16-27, 16-33, 16-36, 16-37
DELETE request
example 15-8, 16-32, 16-37, 16-38
use 19-1
EXTEND request
example 16-14
LOAD service
use 16-15
OUT service
use 16-15
RELEASE request
use 16-32, 19-2
rules 16-15
DU-AL
add entry 16-7
compared with a PASN-AL 15-3
definition 15-3
illustration 15-3
dump
ABEND dump 9-1
data sets for 9-8
X-6
dump (continued)
index in SNAP dump 9-8
not suppressed 9-7
requesting 9-1
requesting in recovery 8-13
select type 9-1
SNAP dump 9-1, 9-8
summary 9-8
suppression 9-2
symptom 9-2
SYSABEND dump 9-1
SYSMDUMP dump 9-1
SYSUDUMP dump 9-1
Transaction dump 9-1, 9-9
types a problem program can request
dump service 9-1
dump storage in a data space 16-23
duplicate
names in unique task libraries, 4-18
resource request 6-12
dynamic I/O configuration change
detecting 24-1
dynamic load module structure
advantage 4-7
description 4-6, 4-7
9-1
E
EAR instruction
description 15-6
ECB (event control block)
description 6-2
parameter of ATTACH 3-4, 3-5, 6-2
EDT (eligible device table)
description 24-3
obtaining information 24-4
unit verification service
IEFEB4UV routine A-1
EDTINFO macro 24-4
end-of-task exit routine 3-4
ENF event code 48
listen exit
writing 27-47
system logger
connect service 27-27
system logger application 27-18
ENQ macro 6-16
example 6-12
rules for using 6-9
use 4-24, 6-9
entry point
adding 4-28
address
AMODE indicator 4-4
alias use 4-28
identifier 4-28
identify 4-10
EP parameter 4-17
EPIE (extended program interruption element)
EPLOC parameter 4-17
7-4
error
recovering from software 8-1
ESD (external symbol dictionary)
AMODE/RMODE indicator 4-1
ESO hiperspace
definition 16-26
ESPIE environment
deleting 7-1
establishing 7-1
ESPIE macro
option
RESET parameter 7-3
SET parameter 7-3
TEST parameter 7-3
use 7-1
using 7-3
establish addressability to a data space 16-12
definition 15-2
example 16-22
ESTAE and ESTAEX macros
0 parameter 8-7
ASYNCH parameter 8-26
CT parameter 8-7, 8-40
defining a recovery routine 8-7
OV parameter 8-40
PARAM parameter 8-18
PURGE parameter 8-25
TERM parameter 8-26
ESTAE and ESTAEX routine
definition 8-7
ESTAE-type recovery routine (extended specify task
abnormal exit)
providing 8-6
ESTAI routine
definition 8-7
ETR (External Time Reference hardware facility)
checking for TOD-clock synchronization 21-1
ETXR parameter of ATTACH
use 3-4
event
signal completion 6-2
EVENTS macro
use 6-2
exabyte
description 12-1
example
data object mapped to a window 17-2
mapping
multiple objects 17-5
object to multiple windows 17-4
permanent object that has a scroll area 17-3
permanent object that has no scroll area 17-3
temporary object 17-4
structure of a data object 17-2
window services coding example 17-19
exclusive resource control 6-11
EXCP macro 5-36
EXCPVR macro 5-36
exit routine
altering register content 7-5
altering the old PSW 7-5
F
find
load module 4-16
format AR information 15-10
frame
assigning 19-1
repossessing 19-1
FREEMAIN macro
use 11-2, 11-5
G
gap in reference pattern service
defining 19-7
definition 19-7
gap in reference pattern services
definition 19-8
GENNAME parameter on DSPSERV 16-8, 16-9, 16-26
GETMAIN macro
creating subpools 11-9
LOC parameter 11-2, 11-3
requesting storage at an address 11-3
type 11-2
use 11-2
gigabyte 4-1
global resource 6-10
global resource serialization 6-16
GQSCAN macro
function 6-16
result 6-18
TOKEN parameter 6-16
guard area
changing its size 12-13
Index
X-7
H
hiperspace
as data-in-virtual object 16-37
compared to address space 16-1
creating 16-24, 16-26
default size 16-3
definition 16-1, 16-24
deleting 16-32
extending current size 16-32
fast data transfer 16-29
illustration 16-1
managing storage 16-3
manipulating data
illustration 16-24
mapping data-in-virtual object into 16-34, 16-35
referencing data 16-27
releasing storage 16-32
restoring 16-38
saving 16-38
shared between two programs 16-29
specify size 16-9
storage available for 16-3
two types 16-25
window services use 17-3
hiperspace storage
managing 16-3
releasing 16-32
rules for releasing 16-32
HSPALET parameter on HSPSERV macro 16-29
HSPSERV macro
example 16-29
read operation 16-27, 16-28
SREAD and SWRITE operation
example 16-33
illustration 16-27
use of move-page facility 16-29
write operation 16-27
HSTYPE parameter on DSPSERV 16-26
I
I/O configuration change
detecting 24-1
I/O configuration token
detecting I/O configuration changes with 24-1
IARR2V macro
ASID parameter 20-9
converting a central storage address to virtual 20-9
IARVSERV sharing effectiveness 20-9
NUMVALID parameter 20-9
NUMVIEW parameter 20-9
RSA parameter 20-9
STOKEN parameter 20-9
VSA parameter 20-9
WORKREG parameter 20-9
IARV64 macro
using 12-8
IARVSERV macro
CHANGEACCESS parameter 20-4
copy-on-write 20-6
X-8
J
JCL
for LOGR subsystem 27-50
JES (job entry subsystem)
and the internal reader 25-1, 25-2, 25-3
job library
reason for limiting size 4-18
use 4-15
when to define 4-18
job output
sending to the internal reader 25-2
job step task
create 3-1
JPA (job pack area) 4-16
K
keyboard
B-1
L
LAE instruction
description 15-6
example 15-7
LAM instruction
description 15-6
example 15-7, 15-8
language
checking availability 22-12
Index
X-9
library
description 4-16
search 4-16
licensed documents xx
limit priority 3-2
linear data set
creating a 14-3
link library 4-15
LINK macro
addressing mode consideration 4-15
use 4-15, 4-21, 4-22, 4-23
when to use 11-13
linkage
consideration 4-2
editor 4-1
linkage conventions
advantages of using the linkage stack 2-3
AR mode program linkage procedure 2-12
AR mode program, defined 2-1
establish a base register 2-9, 2-10
for branch instruction 2-1
in AMODE 64 12-7
introduction 2-1
parameter convention 2-13
primary mode program linkage procedure 2-10
primary mode program, defined 2-1
register save area, provide 2-2
register, saving 2-2
using a caller-provided save area 2-4
using the linkage stack 2-3
linkage stack
advantages of using 2-3
at time of retry 8-35
considerations for ESTAE-type recovery
routines 8-24
example of using the 2-3
how to use 2-3
LINKX macro
use 4-21
load
registers and pass control 4-8
virtual storage 19-3
load an ALET into an AR 15-6
load instruction in AR mode
example 15-6
load list 4-16
LOAD macro
indicating addressing mode 4-15
use 4-15, 4-20, 4-23
when to use 11-13
load module
alias 4-28
characteristic 4-6
execution 4-7
how to avoid getting an unusable copy 4-20
location 4-15
more than one version 4-17
name 4-28
search for 4-16
structure type 4-6
use count 4-22, 4-26
X-10
M
macro
form
execute 11-11
list 11-11
standard 11-11
issuing in AR mode 15-9
reenterable form 11-11
way of passing parameters 11-11
mainline routine
definition in a recovery environment 8-6
manage a target log stream 27-45
managing the LOGR policy
IXGINVNT service 27-20
manipulate data in hiperspace 16-24
manipulate the contents of ARs 15-6
map data-in-virtual object into data space
rules for problem state program 16-21
map data-in-virtual object into hiperspace 16-35
example 16-35
rules for problem state program 16-35
map hiperspace as data-in-virtual object 16-37
example 16-37
map object into data space
using DIV macro 16-21
map object to a data space
using DIV macro 16-20
maximum size of data space 16-10
MCS console
characters displayed 21-4
megabyte 4-1
member names
establish 4-28
MEMLIMIT
definition 12-2
memory object
attributes 12-2
creating 12-9
example of 12-10
deleting a 12-12
discard pages that back pages 12-12
example of creating with a guard area 12-14
example of creating, using and freeing a 12-14
example of deleting a 12-13
ownership 12-9
releasing physical resources that back pages
of 12-12
message
deleting 21-4, 21-10
descriptor code 21-6
disposition 21-6
example of WTO 21-8
identifier 21-8
indicator in first character 21-7
MLWTO (multiple-line) 21-5
message (continued)
replying 21-9
routing 21-6
single-line 21-5
translating 22-1
writing 21-4
message compiler 22-8
invoking 22-8
message file
compiling 22-8
message retrieval tool, LookAt xx
message skeleton
creating 22-3, 22-4
format 22-4
validating 22-7
message text
format 22-6
MIPR
CSVINFO macro 4-29
MLWTO (multiple-line) message
considerations for using 21-5
MMS (MVS message service) 22-1, 23-1
coding example 22-17
support for additional language 22-16
mode
primary 15-1
MODE parameter 27-11
MODE=ASNYCNORESPONSE parameter 27-12
MODE=SYNCEXIT parameter 27-12
modify log stream control information
IXGUPDAT service 27-46
move data between hiperspace and address
space 16-27
move-page facility 16-29
MPB (message parameter block) 22-15
building 22-15
using BLDMPB and UPDTMPB 22-15
using for new message 22-15
multiple versions of load modules 4-17
MVS macro
issuing in AR mode 15-9
N
name
resource 6-9
name a data space 16-9
NAME parameter on DSPSERV 16-8, 16-9, 16-26
name/token callable service
link-editing with your application 18-6
use of the service 18-1
name/token pair
creating 18-2
deciding which to use 18-3
definition 18-1
deleting 18-2
home 18-4
level 18-4
home address space 18-2
primary address space 18-2
system 18-2
Index
X-11
16-28
O
obtain access to a data object 17-9
operator
consoles, characters displayed 21-4
messages, writing 21-4
origin of data space 16-11
originating task 3-1
OUTNAME parameter on DSPSERV 16-8, 16-9
overlay load module structure 4-6
P
page
faults, decreasing 19-5
movement 19-1
size 19-1
page out virtual storage 19-3
page-ahead function 19-3
paging I/O 19-1
paging service
input 19-4
list of services 19-1
parallel execution
when to choose 3-1
parameter convention 2-13
parameter list
description 4-8
example of passing 4-8
indicate end 4-10
inline, use 4-10
location 4-25
parameter list for AR mode program
illustration 2-15
PASN-AL
add entry 16-7
compared with a DU-AL 15-3
definition 15-3
pass control
between control sections 4-8
between programs with all registers intact 4-4
between programs with different AMODEs 4-3, 4-23
between programs with the same AMODE 4-3
in a dynamic structure 4-14, 4-27
with return 4-21
without return 4-24
in a simple structure 4-7, 4-14
with return 4-9
without return 4-7
preparation 4-7
X-12
PUT macro
25-2
Q
qname of a resource
purpose 6-9
QRYLANG macro 22-12
query service
running under an MVS/ESA system 23-2
running under an MVS/XA system 23-3
using 23-1
R
range list entry 20-5
RANGLIST parameter on HSPSERV 16-28, 16-34
RB (request block)
considerations for ESTAE-type recovery
routines 8-23
relationship to ESTAE-type recovery routines 8-7
read
from a log stream 27-34
log data in data set format
LOGR subsystem 27-49
LOGR subsystem
eligible applications 27-49
read from a standard hiperspace 16-28, 16-33
read operation
for standard hiperspace 16-27, 16-28
recovery 8-1, 8-45
ABEND dump
requesting 8-13
ABEND macro
choosing to issue 8-5
invoking RTM 8-39
STEP parameter 8-26
activated
state of recovery routine 8-5
advanced topics 8-39
advantages of providing 8-3
AMODE
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-34
ARR
choosing 8-7
ASC mode
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-34
ATTACH and ATTACHX macros
ASYNCH parameter 8-26
ECB parameter 8-40
ESTAI parameter 8-7, 8-18
ETXR parameter 8-40
PURGE parameter 8-25
STAI parameter 8-7
TERM parameter 8-26
attached task 8-7
authorization
ESTAE-type recovery routine 8-32
retry from an ESTAE-type recovery routine 8-34
Index
X-13
recovery (continued)
availability
increasing 8-3
communication
between processes 8-3
means available to recovery routines 8-17
parameter area 8-6, 8-17
registers 8-17
SDWA 8-10, 8-17
SETRP macro 8-10
concepts 8-2
condition of the linkage stack
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-35
correcting errors 8-14
DAE
providing information 8-13
deactivated
state of recovery routine 8-5
deciding whether to provide 8-3
defined
state of recovery routine 8-5
designing into your program 8-1
dispatchable unit mode
ESTAE-type recovery routine 8-32
retry from an ESTAE-type recovery routine 8-34
DU-AL
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-34
dump
ABEND dump 8-13
checking for previous 8-14
requesting 8-13
environment
ESTAE-type recovery routine 8-32
factors other than register contents 8-32
register contents 8-28
retry from an ESTAE-type recovery routine 8-34
STAE and STAI routines 8-43
summary for ESTAE-type recovery routine and its
retry routine 8-35
understanding 8-27
errors 8-4
examples 8-4
ESTAE and ESTAEX macros
0 parameter 8-7
ASYNCH parameter 8-26
CT parameter 8-7, 8-40
defining a recovery routine 8-7
OV parameter 8-40
PARAM parameter 8-18
PURGE parameter 8-25
TERM parameter 8-26
ESTAE and ESTAEX routine
activated 8-7
deactivated 8-7
defined 8-7
definition 8-7
no longer defined 8-7
ESTAE-type recovery routine
additional considerations 8-26
X-14
recovery (continued)
ESTAE-type recovery routine (continued)
linkage stack considerations 8-24
outstanding I/Os 8-25
providing 8-6
RB considerations 8-23
RB relationship 8-7
return codes 8-30
special considerations 8-23
ESTAI routine
activated 8-7
deactivated 8-7
defined 8-7
definition 8-7
no longer defined 8-7
rules for retry RB 8-24
example
coded 8-37
mainline routine with one recovery routine 8-9
mainline routine with several recovery
routines 8-10
footprints 8-13, 8-18
from software errors 8-1
general concepts 8-2
IEALSQRY macro 8-36
in control
state of recovery routine 8-5
interrupt status
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-34
mainline routine
definition 8-6
minimizing errors 8-14
multiple recovery routines 8-40
MVS-provided 8-3
no longer defined
state of recovery routine 8-5
no longer in control
state of recovery routine 8-5
not providing 8-4
outstanding I/O
restoring quiesced restorable I/O operations 8-25
outstanding I/Os
controlling 8-25
parameter area
accessing 8-17, 8-18
checking the contents 8-13
contents 8-17
footprints 8-13, 8-18
passing 8-6, 8-17, 8-18
setting up 8-17
percolate
compared with retry 8-14
definition 8-8
program availability
increasing 8-3
program mask
ESTAE-type recovery routine 8-33
retry from an ESTAE-type recovery routine 8-34
quiesced restorable I/O operation
restoring 8-25
recovery (continued)
recovery routine
choosing 8-6
definition 8-6
nested 8-41
objectives 8-11
options 8-8
order of control 8-8
percolating 8-16
providing 8-1
providing recovery for a recovery routine 8-41
retrying 8-15
states 8-5
summary of states 8-8
writing 8-10
recursion
avoiding 8-13
definition 8-13
register contents 8-28
entry to a recovery routine 8-28
entry to a retry routine 8-30
restoring 8-15
return from a recovery routine 8-29
STAE or STAI retry routines 8-45
STAE routine 8-43
summary of where to find information 8-28
retry
compared with percolate 8-14
definition 8-8
retry point
definition 8-6
retry routine
definition 8-6
description 8-15
routines in a recovery environment
definition 8-5
interaction 8-9
mainline routine 8-6
recovery routine 8-6
retry routine 8-6
RTM 8-1
invoking 8-39
SDWA
accessing 8-19
accessing the SDWARC1 DSECT 8-20
checking important fields 8-12
directly manipulating fields 8-13
freeing 8-15
IHASDWA mapping macro 8-19
summary of important fields 8-20
updating 8-10, 8-19
updating through SETRP macro 8-13
updating through VRADATA macro 8-13
using 8-19
SDWA storage key
ESTAE-type recovery routine 8-32
retry from an ESTAE-type recovery routine 8-34
serviceability data
providing 8-4
saving 8-13
updating the SDWA 8-13
recovery (continued)
SETRP macro
communicating recovery options to the
system 8-19
COMPCOD parameter 8-20
DUMP parameter 8-13
FRESDWA parameter 8-15, 8-30
indicating percolation 8-16
indicating retry 8-15
RC parameter 8-15, 8-16
REASON parameter 8-20
RECPARM parameter 8-13
REMREC parameter 8-16
RETADDR parameter 8-15
RETREGS parameter 8-15, 8-30
supplying a retry address 8-15
updating the SDWA 8-10, 8-19
STAE macro
0 parameter 8-7
CT parameter 8-7
defining a recovery routine 8-7
STAE retry routine 8-44
STAE routine
return codes 8-43
using 8-42
work area 8-43
STAI retry routine 8-44
STAI routine
return codes 8-43
using 8-42
work area 8-43
state of recovery routine
activated 8-5
deactivated 8-5
defined 8-5
in control 8-5
no longer defined 8-5
no longer in control 8-5
system logger 27-54
application failure 27-55
coupling facility failure 27-56
coupling facility full 27-58
DASD log data set space fills 27-59
log stream damage 27-58
peer connector 27-55
staging data set full 27-58
system failure 27-55
system logger address space failure 27-56
unrecoverable I/O errors 27-60
task 8-7
validity checking of user parameters 8-4
VRADATA macro
updating the SDWA variable recording area 8-13
writing recovery routines 8-10
checking for the SDWA 8-11
checking important fields in the SDWA 8-12
checking the parameter area 8-13
comparison of retry and percolate 8-14
correcting or minimizing errors 8-14
determining if the recovery routine can retry 8-14
Index
X-15
recovery (continued)
writing recovery routines (continued)
determining the first recovery routine to get
control 8-12
determining why the routine was entered 8-12
establishing addressability to the parameter
area 8-12
locating the parameter area 8-12
providing information for DAE 8-13
requesting a dump 8-13
saving serviceability data 8-13
saving the return address to the system 8-11
recursion
avoiding in recovery 8-13
definition in recovery 8-13
reenterable
load module 4-20, 4-24, 11-10
macro 11-11
reenterable code
use 11-2, 11-5, 11-11
reenterable load module
use 11-3, 11-10
reference pattern service 19-5, 20-1
reference unit in reference pattern service
choosing 19-7
definition 19-7
reference unit in reference pattern services
definition 19-8
REFPAT macro
example 19-13
use 19-5
using 19-9
refresh changed data in an object 17-15
refreshable module 11-12
REGION system parameter 11-1
register
altering the content 7-5
provide a save area 2-2
save 2-2
register 1
pass parameters 4-8
register 14
use 4-9
when to restore 4-7
register 15
use 4-7
registers 2-12 4-9
release
data space and hiperspace storage 16-3
data space storage 16-15
rules 16-15
hiperspace storage 16-32
rules for 16-32
resource 6-13
virtual storage 19-1
RELEASE parameter on HSPSERV macro 16-28
release storage in data spaces
rules 16-15
remove
entry from access list 15-8
REPLACE option for a window 17-11
X-16
retry routine
definition 8-6
ensure correct level of the linkage stack 8-35
return
control
in a dynamic structure 4-24
in a simple structure 4-12
return address
pass 4-7
return attributes function of unit verification service A-2
return code
analyzing 4-11
establish 4-13
for cell pool service 13-6
using 4-11
return group ID function of unit verification service A-2
return look-up value function of unit verification
service A-2
RETURN macro
use 4-12, 4-13
return UCB addresses function of unit verification
service A-2
return unit name function of unit verification
service A-1
returned storage
specify subpool A-2
reusability attributes of a load module 4-24
reusable module 4-20
reuse of a save area 4-10
RIB (resource information block)
used with GQSCAN macro 6-16
RMODE program attribute
indicator in PDS entry 4-1
purpose 4-1
specifying
in source code 4-1
using linkage editor control card 4-1
use 4-15
value 4-2
route
code 21-6
message 21-6
route message 21-6
route the message 21-6
RTM (recovery termination manager)
MVS component that handles recovery 8-1
run length encoding 23-1
run-time message file
updating 22-11
S
SAC instruction
example 15-8
use 15-1
safe import point
IXGIMPRT service 27-41
IXGQUERY service 27-41
SAR instruction
description 15-6
example 15-7
save
data space 16-23
hiperspace 16-38
save area
example of using a 2-3, 2-5
how to tell if used 4-13
pass address 4-8
reuse 4-10
using a caller-provided save area 2-4
who must provide 2-2
save interim changes to a permanent object 17-14
SAVE macro
example of using 2-5
use 4-28
scope
ALL parameter value on GQSCAN macro 6-18
STEP parameter value on GQSCAN macro 6-16,
6-18
SYSTEM parameter value on GQSCAN
macro 6-16, 6-18
SYSTEMS parameter value on GQSCAN
macro 6-16, 6-18
scope of a resource
changing 6-10
STEP, when to use 6-10
SYSTEM, when to use 6-10
SYSTEMS, when to use 6-10
use 6-10
SCOPE parameter on DSPSERV 16-8
scroll area
data transfer 17-3
definition 17-2
mapping a scroll area to DASD, example 17-3
mapping a window to a scroll area, example 17-3
obtaining a scroll area 17-10
refreshing a scroll area 17-15
saving changes in, overview 17-8
saving interim changes in a 17-14
storage used for 17-2
updating a permanent object from a scroll
area 17-16
updating DASD from, overview 17-8
use 17-2
SCROLL hiperspace 16-25
SDB (structured data base) format
description 10-3
SDWA (system diagnostic work area)
providing symptom data for a dump 9-5
SDWAARER field 8-21
SDWAARSV field 8-22
SDWACID field 8-13, 8-23
SDWACLUP bit 8-14, 8-23
SDWACMPC field 8-12, 8-21
SDWACOMU field 8-23
SDWACRC field 8-12, 8-21
SDWAEAS bit 8-14, 8-23
SDWAEC1 field 8-21
SDWAEC2 field 8-21
SDWAGRSV field 8-21
SDWAINTF bit 8-21, 8-22
SDWALNTH field 8-22
Index
X-17
X-18
storage (continued)
subpool returned storage A-2
storage available for data space and hiperspace
STORAGE macro
OBTAIN request
example 16-34
use 11-2, 11-4, 11-5
storage request
explicit 11-1
implicit 11-1
storage subpool 11-6
structure of a data object 17-1
subpool
characteristic 11-8
creating 11-9
handling 11-6
in task communication 11-10
ownership 11-9
sharing 11-7, 11-10
storage key for 11-8
transferring ownership 11-9
subpool release
definition 11-5
substitution token 22-4
subtask
communication with tasks 3-3
control 3-1
create 3-1
priority 3-2
starting 3-3
stopping 3-3
terminating 3-4, 6-2
summary dump 9-8
suppression
of dumps 9-2
symbol substitution
summary 1-3
symptom
provided by a recovery routine 9-5
required for dump suppression 8-20
symptom dump 9-2
symptom record 10-3
description 10-1
SYMRBLD macro
building a symptom record 10-1, 10-3
SYMREC macro
symptom recording 10-1
SYSABEND ABEND dump 9-1
SYSMDUMP ABEND dump 9-1
sysplex environment
communication 21-9
SYSSTATE macro
example 15-9
use 4-20, 9-8, 15-9
system convention for parameter list 4-8
SYSTEM inclusion resource name list 6-10
system log
writing 21-10
system logger
ANSAREA parameter 27-17
answer area 27-17
16-3
X-19
X-20
T
target program
definition 2-1
task
advantage of creating additional 3-1
communication with subtasks 3-3
create 3-1
library, establishing 4-15
priority, affect on processing 3-2
synchronization 6-2
TASKLIB parameter of ATTACH 4-15, 4-16
tasks in a job step
illustration 3-4
TCB (task control block)
address 3-1
remove 3-4
temporary object
accessing a temporary object 17-9
creating a temporary object 17-9
data transfer 17-3
defining a view 17-10
defining multiple views 17-13
definition 17-1
extending the size 17-13
functions supported for 17-7
initialized value 17-2
mapping a window, example 17-4
obtaining
access to a temporary object, overview 17-8
access to a temporary object, procedure for 17-9
scroll area 17-10
overview of supported function 17-7
U
UCB (unit control block)
obtaining device information 24-3
scanning 24-2
UCBINFO macro 24-3
UCBSCAN macro 24-2
unit name A-2
device class A-2
is a look-up value function of unit verification
service A-2
unit verification service
description A-1
examples A-13
functions
check groups A-1, A-4
check units A-1, A-5
convert device type to look-up value A-2, A-10
indicate unit name is a look-up value A-2, A-8
return attributes A-2, A-11
return group ID A-2, A-7
return look-up value A-2, A-9
return unit control block (UCB) address A-2, A-6
return unit name A-1, A-6
V
V-type address constant
use to pass control 4-10
V=R (virtual=central) storage
allocation 19-1
VERBEXIT DAEDATA subcommand
indicating why dump was not suppressed 9-7
verification
device A-1
version record
format 22-3
virtual storage
controlling 11-6
explicit requests for 11-1
freeing 11-12
implicit requests for 11-10
loading 19-1, 19-3
obtaining via CPOOL 11-6
page-ahead function 19-3
paging out 19-3
releasing 19-1, 19-2
sharing with IARVSERV macro 20-1
specifying the amount allocated to a task 11-1, 11-2
subpool 11-6
using efficiently 11-1
why use above the bar 12-2
virtual storage window 14-1, 14-4
VRADATA macro
to customize dump suppression 9-6
using in a recovery environment 8-13
Index
X-21
11-1, 11-13
W
wait
bit 6-2
condition 6-2
long 6-3
WAIT macro
use 6-2
ways that window services can map an object 17-3
window
affect of terminating access to an object 17-18
blocks to be viewed, identifying 17-13
changing a view in a window 17-16
changing the view, overview 17-8
data to be viewed, identifying 17-13
defining
multiple windows 17-13
window disposition 17-11
window reference pattern 17-12
window, overview 17-8
windows with overlapping view 17-14
definition 17-1
identifying a window 17-11
identifying blocks to be viewed 17-13
mappping
multiple objects, example 17-5
to a window, example 17-3
to multiple windows, example 17-4
refreshing a window 17-15
REPLACE option 17-11
RETAIN option 17-11
size 17-11
storage for 17-11
terminating a view in a window 17-16
updating a permanent object from a window 17-16
use 17-1
window service
introduction 17-1
overview 17-1
use 17-7
window services
functions provided 17-2
overview 17-1
services provided 17-2
using window services 17-7
ways to map an object 17-3
WLM compatibilty
dispatching priority 3-2
WLM goal mode
dispatching priority 3-2
work area
used by data compression service 23-1
used by data expansion service 23-1
write
to the operator with reply 21-4
to the operator without reply 21-8
to the programmer 21-10
to the system log 21-10
X-22
write connection
IXGCONN service
IMPORTCONNECT parameter 27-27
WRITE macro 25-2
write message 21-4
write operation
for standard hiperspace 16-27
write programs in AR mode 15-4
write to a standard hiperspace 16-28, 16-33
writing
to a log stream 27-32
WTL macro
writing to the system log 21-10
WTO macro
descriptor code for 21-7
example 21-8
MLWTO (multiple-line) form 21-5
single-line form 21-5
use 21-4
WTOR macro
example 21-9
use 21-4
X
X-macro
definition 15-9
rules for using 15-9
XCTL macro
addressing mode consideration 4-15
lowering the responsibility count 11-13
use 4-15, 4-24, 4-25
use with branch instructions, danger 4-26
XCTLX macro
use 4-24, 4-25
Z
z/Architecture
setting and checking the addressing mode 12-7
z/Architecture instructions
using the 64-bit GPR 12-5
z/Architecture processes S/390 instructions, how 12-4
examples 12-4
Overall satisfaction
Very Satisfied
h
Satisfied
h
Neutral
h
Dissatisfied
h
Very Dissatisfied
h
Neutral
h
h
h
h
h
h
Dissatisfied
h
h
h
h
h
h
Very Dissatisfied
h
h
h
h
h
h
How satisfied are you that the information in this book is:
Accurate
Complete
Easy to find
Easy to understand
Well organized
Applicable to your tasks
Very Satisfied
h
h
h
h
h
h
Satisfied
h
h
h
h
h
h
h Yes
h No
When you send comments to IBM, you grant IBM a nonexclusive right to use or distribute your comments in any
way it believes appropriate without incurring any obligation to you.
Name
Company or Organization
Phone No.
Address
SA22-7605-04
IBMR
___________________________________________________________________________________________________
Cut or Fold
Along Line
_ _ _ _ _ _ _Fold
_ _ _ and
_ _ _Tape
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Please
_ _ _ _ _do
_ _not
_ _ staple
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _Fold
_ _ _and
_ _ Tape
______
NO POSTAGE
NECESSARY
IF MAILED IN THE
UNITED STATES
PERMIT NO. 40
IBM Corporation
Department 55JA, Mail Station P384
2455 South Road
Poughkeepsie, NY
12601-5400
_________________________________________________________________________________________
Fold and Tape
Please do not staple
Fold and Tape
SA22-7605-04
Cut or Fold
Along Line
IBMR
Printed in U.S.A.
SA22-7605-04