IDIALLOC command

The IDIALLOC command can be used to perform dynamic allocation and concatenation of data sets to DDnames.

Figure 1. Syntax

1 IDIALLOC  DD ( ddname )?  DSN ( + , dsname )
1 MOD
1 NEW
1 OLD
1 SHR
1 CATALOG
1 DELETE
1 KEEP
1 UNCATALOG
3?  SPACE ( primary_cyls? ,secondary_cyls )
3?  DIR ( directory_blocks )
3?  RECFM (
4.1+ 
4.1 A
4.1 B
4.1 D
4.1 F
4.1 M
4.1 S
4.1 T
4.1 U
4.1 V
3 )
3?  LRECL ( logical_record_length )
3 ?LIBRARY
3?  UNIT ( unit_specification )
3?  SYSOUT? (sysout_class)
3?  PGM ( sysout_program_name )
3?  DEST ( node.userid )
3 ?DUMMY
3?  FREE (
4.1! END
4.1 CLOSE
3 )
Note: No commas or blank characters can delimit repeated values. For example, to specify fixed-blocked record format, use RECFM(FB) - not RECFM(F B).
Operands:
DD
DDname to be associated with data set. This DDname is always required.
DSN
Names of data sets to be allocated. If more than one data set name is specified, all data sets following the first are expected to already exist and will be concatenated to the specified DDname. HFS path names are not permitted.
MOD
Additions are to be made to data set.
NEW
Data set is to be created.
OLD
Data set exists and exclusive control is required.
SHR
Data set exists but exclusive control is not required.
CATALOG
Data set is to be cataloged.
DELETE
Data set is to be deleted when freed.
KEEP
Data set is to be kept when freed.
UNCATALOG
Data set is to be uncataloged.
SPACE
Primary space and increment as number of cylinders.
DIR
Number of directory blocks required.
RECFM
Record format:
A
ASA printer characters
B
Blocked
D
Variable length ASCII records
F
Fixed
M
Machine control character
S
Standard blocks or spanned
T
Track overflow
U
Undefined
V
Variable
LRECL
Logical record length (0 to 32760 value).
LIBRARY
Allocate a PDSE (partitioned data set extended) data set.
UNIT
Device type to which a file or data set is to be allocated.
SYSOUT
Data set is to be system output data set. The class can optionally be specified as a single character.
PGM
SYSOUT program name.
DEST
DEST node and user ID.

Just the user ID can be used for local destinations.

DUMMY
Allocate dummy data set.
FREE
Deallocation specification:
CLOSE
Requests that the system deallocate the data set when it is closed.
END
Requests that the system deallocate the data set at the end of the last step that references the data set. This value is the default.
The following syntax rules apply:
  • DSN is mutually exclusive with the following parameters:
    • PGM
    • DEST
  • DEST is mutually exclusive with the PGM parameter.
  • SYSOUT is mutually exclusive with the following parameters:
    • OLD
    • MOD
    • SHR
    • NEW
  • The following parameters require that the DSN parameter is also specified:
    • SPACE
    • DIR
    • UNIT
  • The following parameters require that the SYSOUT parameter is also specified:
    • PGM
    • DEST
Note: No automatic prefixing of user ID to data set names are performed by Fault Analyzer for this command. All data set names must be fully qualified and specified without quotes.

Return codes

The IDIALLOC command provides the following return codes:
0
The allocation was successful. If a member of a PDS or PDSE was allocated, the member exists and can be opened for read.
1
The allocation was successful. However, a non-existing member of a PDS or PDSE was allocated which cannot be opened for read. If the member is opened for read, a system abend S013 occurs.
4
Allocation failed. An explanation of the error is written to the IDITRACE DDname. Allocation or concatenation errors relating to data sets, other than the first data set name specified, will not terminate the IDIALLOC command; processing continues.
8
Command syntax error. An explanation of the error is written to the IDITRACE DDname.

Example

Figure 2. IDIALLOC command example
/* REXX */

/* Allocate an existing data set to DDname DD1 */
"IDIALLOC DD(DD1) DSN(FRED.LISTING) SHR"
if RC = 0 then say 'Success!'

/* Allocate a temporary sequential work data set to DDname DD2 */
"IDIALLOC DD(DD2) DSN(FRED.SEQ) NEW DELETE SPACE(2,3) UNIT(SYSALLDA) ",
         "RECFM(FB) LRECL(80)"

/* Allocate a new partitioned data set to DDname DD3 */
"IDIALLOC DD(DD3) DSN(FRED.PDS) NEW CATALOG SPACE(2) UNIT(SYSALLDA) ",
         "DIR(5) RECFM(VBA) LRECL(137)"

/* Allocate default JES spool data set to DDname DD4 */
"IDIALLOC DD(DD4) SYSOUT"

/* Allocate internal reader for submission of job to DDname DD5 */
"IDIALLOC DD(DD5) SYSOUT PGM(INTRDR)"
if rc = 0 then do /* Check rdr allocation */
----processing----
end
else "IDIWTO INTRDR FAILED ALLOCATION"

/* Allocate a list of load libraries to the IDIRLOAD DDname */
"IDIALLOC DD(IDIRLOAD) DSN(MY.LOADLIB1 MY.LOADLIB2 MY.LOADLIB3) SHR"

/* Allocate a new PDSE history file data set named MY.HIST */
"IDIALLOC DD(DD6) DSN(MY.HIST) NEW CATALOG LIBRARY,
          RECFM(VB) LRECL(10000) SPACE(20,20)"