Use the ALLOC() function to dynamically allocate new or existing data sets.
The ALLOC() function has this syntax:
ALLOC([dsn],[disp1[disp2[disp3]],[PERM],[dd],[unit],[volser],
[,space prim [sec] [dir],[dsorg],[recfm],[lrecl],[blksize]) = ddname
The ALLOC() function takes these arguments.
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.
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.
How the file should be allocated to you. Specify one of the following:
Allocate an existing data set non-exclusively.
Allocate an existing data set for the exclusive use of the ISERVE address space. Other IMODs may also hold the same data set exclusively.
Allocate a new data set that does not already exist.
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.
What should be done with the data set when it is deallocated normally. Specify one of the following:
Keep it, but do not catalog it. This is the default if it was an existing data set that was allocated.
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.
Keep it and catalog it.
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.
Data set's disposition if it is deallocated during abend processing. Specify one of the values listed in disp2.
Indicates that the data set should remain allocated after it is closed.
Default: FREE=CLOSE
DDname for the file.
Default: The system generates a unique DDname.
Unit name for the allocation. This argument is required when allocating a new or uncataloged data set.
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.
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:
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.
The allocation is to be by cylinder. If used, both prim and sec are assumed to specify cylinder
The allocation is to be by track. If used, both prim and sec are assumed to specify tracks.
Minimum amount of space for allocation (in blocks, tracks, or cylinders).
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
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.
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).
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).
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.
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.
Allocating a data set that requires operator intervention suspends the requesting IMOD task until the request can be satisfied.
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() */
| Copyright © 2011 CA. All rights reserved. | Tell Technical Publications how we can improve this information |