Previous Topic: ALIGN()

Next Topic: BATCHRC()

ALLOC()

Use the ALLOC() function to dynamically allocate new or existing data sets.

Syntax

The ALLOC() function has this syntax:

ALLOC([dsn],[disp1[disp2[disp3]],[PERM],[dd],[unit],[volser],
  [,space prim [sec] [dir],[dsorg],[recfm],[lrecl],[blksize]) = ddname

Arguments

The ALLOC() function takes these arguments.

ddname

DDname for the newly allocated file (or error text if the allocation fails).

Default: The system assigns a ddname that is returned by the ALLOC() function.

dsn

Name of the data set you want to allocate. To specify a PDS member, include the member in parentheses (for example, INDEX.NAME(MEMBER)). The member is allocated as a sequential file.

Default: The system assigns a temporary name.

disp1

How the file should be allocated to you. Specify one of the following:

SHR

Allocate an existing data set non-exclusively.

OLD

Allocate an existing data set for the exclusive use of the ISERVE address space. Other IMODs may also hold the same data set exclusively.

NEW

Allocate a new data set that does not already exist.

MOD

Allocate a new or existing data set for the exclusive use of the ISERVE address space. The "write pointer" is
positioned to the end of the data set so that you may extend the data set with additional records.

disp2

What should be done with the data set when it is deallocated normally. Specify one of the following:

KEEP

Keep it, but do not catalog it. This is the default if it was an existing data set that was allocated.

DELETE

Delete it. If the data set was allocated through the catalog (without specification of volume serial number),
it will also be uncataloged. This is the default for a newly allocated data set.

CATLG

Keep it and catalog it.

UNCATLG

Keep it and uncatalog it. For example, 'NEW CATLG DELETE' is equivalent to the JCL statement DISP=(NEW,CATLG,DELETE). For default values, consult your JCL reference
manual.

disp3

Data set's disposition if it is deallocated during abend processing. Specify one of the values listed in disp2.

PERM

Indicates that the data set should remain allocated after it is closed.

Default: FREE=CLOSE

dd

DDname for the file.

Default: The system generates a unique DDname.

unit

Unit name for the allocation. This argument is required when allocating a new or uncataloged data set.

volser

Volume to be allocated. This argument is required when allocating an uncataloged data set. It is also required if you are allocating a new data set and you are not using an esoteric value for the unit.

space

How much space should be allocated to a disk data set. This value is required for new data sets and ignored for existing data sets. Specify one of these values:

blocks

The size of the disk block to be allocated. This is generally the same value as the block size of the
data set. The allocation routines calculate the physical amount of disk space required, based upon
blocks of the specified size. If specified, both prim and sec are assumed to be in blocks.

CYL

The allocation is to be by cylinder. If used, both prim and sec are assumed to specify cylinder

TRK

The allocation is to be by track. If used, both prim and sec are assumed to specify tracks.

prim

Minimum amount of space for allocation (in blocks, tracks, or cylinders).

sec

Space to be allocated each time the data set is full and additional data is to be written (in blocks, tracks, or cylinders).

A data set may extend over 16 discrete areas on a single disk volume.

Default: 0

dir

Number of 256-byte directory blocks to be allocated to a partitioned data set (PDS). You must specify dir if you are allocating a PDS; otherwise, omit it.

dsorg

Data set organization. Specify one of the following: PS, PSU, PO, or POU.

Default: No value is assigned (for new data sets), or the dsorg specified in the data set label is used (for existing data sets).

recfm

Record format. Specify one of the following: F, FA, FM, FB, FBA, FBM, V, VA, VM, VB, VBA, VBM, or U.

Default: No value is assigned (for new data sets), or the record format specified in the data set label is used (for existing data sets).

lrecl

For a new data set, you may specify the logical record length. Specify a value from 0 to 32,769 (inclusive).

Default: No value is assigned.

blksize

For a new data set, you may specify the block size. Specify a value from 0 to 32,769 (inclusive).

Default: No value is assigned.

Usage Notes

Allocating a data set that requires operator intervention suspends the requesting IMOD task until the request can be satisfied.

Return Codes

The ALLOC() function produces these return codes:

101 - 111

ARG n MISSING OR INVALID

102

ARG 2, SUBARG n INVALID

104

DDNAME ALREADY IN USE

121

error info text

error SVC 99 Error code (hexadecimal)

info SVC 99 Information code (hexadecimal)

text Explanatory text

Example

alloc('RBROWNE.TEST.DATA','SHR',,''JUNK') == 'JUNK'
         /* Allocate a PDS, alloc returns ddname */
         /* Note that member name is not specified until SAM() */