Previous Topic: ALIGN()Next Topic: BATCHRC()


ALLOC()

This function dynamically allocates new or existing data sets.

Syntax

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

Parameters

ddname

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

Default: The system assigns a ddname that the ALLOC() function returns.

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 is allocated to you:

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 can also hold the same data set exclusively.

NEW

Allocate a new data set that does not 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 can extend the data set with more records.

disp2

Indicates what to do with the data set when it is deallocated typically:

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 is also 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 Guide.

disp3

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

PERM

Indicates that the data set remains 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 is 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 that is required, based on blocks of the specified size. If specified, prim and sec are assumed to be in blocks.

CYL

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

TRK

The allocation is to be by track. If used, 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 more data is written (in blocks, tracks, or cylinders).

A data set can 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). Specify dir if you are allocating a PDS; otherwise, omit it.

dsorg

Data set organization. Specify: PS, PSU, PO, or POU.

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

recfm

Record format. Specify: 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 that is specified in the data set label is used (for existing data sets).

lrecl

For a new data set, you can 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 can 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

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() */