The STORAGE macro with the OBTAIN parameter requests that the system allocate an area of virtual storage to the active task. Each virtual storage area begins on a doubleword or page boundary. The amount of storage you request must not exceed the amount available; the amount available depends on how much storage has already been allocated, and on your user region size. Valid subpools available for problem-state callers are 0 - 127, 131, and 132. When a task terminates, the system frees any storage in subpools 0 - 127 that has been allocated to the terminating task. The system does not free storage in subpools 131 and 132 until the job-step task terminates.
In all other cases, you must not assume that the storage is cleared to zeros.
The caller can specify CHECKZERO=YES to detect these and other cases where the system clears the requested storage to zeros.
Before issuing the STORAGE macro with the OBTAIN parameter, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the service returns control.
Before issuing the STORAGE macro with the OBTAIN parameter, the caller does not have to place any information into any register unless using it in register notation for a particular parameter, or using it as a base register.
Some callers depend on register contents remaining the same before and after issuing a service. If the system changes the contents of registers on which the caller depends, the caller must save them before issuing the service, and restore them after the service returns control.
The STORAGE macro with the OBTAIN parameter is written as follows:
Syntax | Description |
---|---|
name | name: Symbol. Begin name in column 1. |
␢ | One or more blanks must precede STORAGE. |
STORAGE | |
␢ | One or more blanks must follow STORAGE. |
OBTAIN | |
,LENGTH=length value | length value: Symbol, decimal number, or register (0), (2) - (12). |
,LENGTH=(max amount,min amount) | max amount: Symbol, decimal number, or register (0), (2) - (12). |
min amount: Symbol, decimal number, or register (1) - (12). | |
,ADDR=stor addr | stor addr: RX-type address or register (1) - (12). |
Default: ADDR=(1). | |
,INADDR=stor addr | stor addr: RX-type address or register (1)-(12). |
Note: This parameter can only be specified with LOC=EXPLICIT. | |
,SP=subpool number | subpool number: Symbol, decimal number 0-127, 131, 132, or register (2) - (12), (15). Default: SP=0. |
,BNDRY=DBLWD | |
,BNDRY=PAGE | Default: BNDRY=DBLWD |
,CONTBDY=containing_bdy | containing_bdy: Decimal number 3-31 or register (2) - (12). |
,STARTBDY=starting_bdy | starting_bdy: Decimal number 3-31 or register (2) - (12). |
,KEY=key number | key number: Decimal number 0-15 or register (2) - (12). |
Note: KEY is valid only when you also specify SP. You cannot specify both KEY and CALLRKY=YES. | |
,CALLRKY=NO | Default: CALLRKY=NO |
,CALLRKY=YES | Notes: You cannot specify both CALLRKY=YES
and KEY. Valid only with LINKAGE=SYSTEM. |
,LOC=24 | |
,LOC=(24,31) | |
,LOC=(24,64) | |
,LOC=31 | |
,LOC=(31,31) | |
,LOC=(31,64) | |
,LOC=(31,PAGEFRAMESIZE1MB) | |
,LOC=RES | Default: LOC=RES |
,LOC=(RES,31) | |
,LOC=(RES,64) | |
,LOC=EXPLICIT | Note: You must specify the INADDR parameter with |
,LOC=(EXPLICIT,24) | EXPLICIT. |
,LOC=(EXPLICIT,31) | |
,LOC=(EXPLICIT,64) | |
,LOC=(EXPLICIT,PAGEFRAMESIZE1MB) | |
,LINKAGE=SYSTEM | Default: LINKAGE=SYSTEM |
,LINKAGE=SVC | |
,RTCD=rtcd addr | rtcd addr: RX-type address, register (15), |
or register (2) - (12). Default: RTCD=(15). | |
,COND=YES | Default: COND=NO |
,COND=NO | |
,CHECKZERO=YES | Default: CHECKZERO=NO |
,CHECKZERO=NO | |
,BACK=BYSPT | Default: BACK=BYSPT |
,BACK=NONE | |
,BACK=ALL | |
,FIX=NONE | Default: FIX=NONE |
,FIX=SHORT | |
,FIX=LONG | |
,RELATED=value | value: Any valid macro parameter specification. |
The parameters are explained as follows:
If you specify LENGTH=(max amount,min amount), the system returns a value in general purpose register 0 to tell you the amount of storage it obtained.
If a register is specified, the value must be in bits 24-31 of the register. Do not specify CONTBDY on a variable-length request.
CONTBDY is not valid with LOC=EXPLICIT or BNDRY=PAGE.
CONTBDY applies to all subpools.
If you omit this parameter, there is no containing boundary.
If a register is specified, the value must be in bits 24-31 of the register. Do not specify STARTBDY on a variable-length request.
STARTBDY is not valid with LOC=EXPLICIT or BNDRY=PAGE.
STARTBDY applies to all subpools.
If you omit this parameter, the start boundary is 8 bytes (equivalent to specifying STARTBDY=3).
The default is CALLRKY=NO.
CALLRKY is valid only with LINKAGE=SYSTEM.
LOC=(24,64) indicates that virtual storage is to be located below 16 megabytes and central storage can be located anywhere in 64-bit storage.
LOC=(31,64) indicates that virtual storage is to be located below 2 gigabytes and central storage can be located anywhere in 64-bit storage.
LOC=(31,PAGEFRAMESIZE1MB) locates virtual storage below 2 gigabytes and backs central storage anywhere in 64-bit storage, preferably by 1 megabyte page frames. PAGEFRAMESIZE1MB is only allowed for user region low private unauthorized subpools 0-127, 131, and 132.
When you use LOC=RES to allocate storage that can reside either above or below 16 megabytes, LOC=RES indicates that the location of virtual and central storage depends on the location of the caller. If the caller resides below 16 megabytes, virtual and central storage are to be located below 16 megabytes. If the caller resides above 16 megabytes, virtual and central storage are to be located either above or below 16 megabytes.
LOC=(RES,64) indicates that the location of virtual storage depends upon the location of the caller. If the caller resides below 16 megabytes, virtual storage is to be located below 16 megabytes; if the caller resides above 16 megabytes, virtual storage can be located anywhere in 31-bit storage. In either case, central storage can be located anywhere in 64-bit storage.
LOC=(EXPLICIT,31) indicates that virtual storage is to be located at the address specified on the INADDR parameter, and central storage can be located anywhere below 2 gigabytes.
LOC=(EXPLICIT,24) indicates that virtual storage is to be located at the address specified on the INADDR parameter, and central storage is to be located below 16 megabytes. The virtual storage address specified on the INADDR parameter must be below 16 megabytes.
LOC=EXPLICIT and LOC=(EXPLICIT,64) indicate that virtual storage is to be located at the address specified on the INADDR parameter, and central storage can be located anywhere in 64-bit storage.
When you specify EXPLICIT on a request for storage from the same virtual page as previously requested storage, you must request it in the same key, subpool, and central storage area as on the previous storage request. For example, if you request virtual storage backed with central storage below 16 megabytes, any subsequent requests for storage from that virtual page must be specified as LOC=(EXPLICIT,24).
LOC=(EXPLICIT,PAGEFRAMESIZE1MB) locates virtual storage at the address specified by the INADDR parameter and backs central storage anywhere in 64-bit storage, preferably by 1 MB page frames. PAGEFRAMESIZE1MB can only be specified for user region low private unauthorized subpools 0-127, 131, and 132.
COND=NO indicates that the request is unconditional. The system abnormally terminates the active unit of work if the STORAGE OBTAIN request cannot complete successfully. This situation occurs if the parameters passed on the request are incorrect or inconsistent, if the system encounters internal errors, or if there is not enough contiguous virtual storage to satisfy the request. COND=NO is the default.
There is no performance cost to specifying CHECKZERO=YES.
Programs that issue the STORAGE macro with the CHECKZERO parameter can run on any z/OS system. On a down-level system, CHECKZERO will be ignored, and the return code for a successful completion (conditional or unconditional) will be 0.
When control returns from the STORAGE OBTAIN request and you specified a conditional request, bits 32-63 of GPR 15 (and rtcd addr, if you coded RTCD) contain one of the following hexadecimal return codes. The contents of bits 0-31 of GPR 15 are unpredictable.
Return Code | Meaning and Action |
---|---|
0 | Meaning: Successful completion. CHECKZERO=YES
was not specified, or the system has not cleared the requested storage
to zeros. Action: None. |
4 | If you did not specify EXPLICIT on the LOC
parameter:
If you specified EXPLICIT on the LOC parameter:
|
8 | Meaning: System error. Virtual storage
was not obtained because the system has insufficient central storage
to back the request. Action: Report the problem to the system programmer so the cause of the problem can be determined and corrected. |
C | Meaning: System error. Virtual storage
was not obtained because the system cannot page in the page table
associated with the storage to be allocated. Action: Report the problem to the system programmer so the cause of the problem can be determined and corrected. |
10 | Meaning: Program error. Virtual storage
was not obtained for one of the reasons listed below. This reason
code applies only to STORAGE requests with LOC=EXPLICIT specified.
Action: Determine why your program is attempting to obtain allocated storage or why your program is attempting to obtain virtual storage with different attributes from the same page of storage. Correct the coding error. |
14 | Meaning: Successful completion. The system
has cleared the requested storage to zeros. This return code occurs
only when CHECKZERO=YES is specified. Action: None. |
18 | Meaning: PAGEFRAMESIZE1MB was specified on the LOC=parameter
on a STORAGE OBTAIN request for a subpool other than 0-132, 240, 244
or 250-252. Action: None. |