DGADTDYN Sample Program Uses
The following examples demonstrate how you can use the functions of the DGADTDYN program.
Example 1: Locate and Allocate a Data Set
The following example calls the program DGADTDYN using the LOCATE parameter to determine if a cataloged file exists.
If the file does not exist, the program issues a nonzero return code and makes a call to allocate the file through the ALLOC parameter.
|
Example 2: Delete and Uncatalog a Data Set
The following example deletes and uncatalogs a data set.
The first function, ALLOC, allocates the data set specifying a current status of OLD and a secondary (or normal step completion) disposition of DELETE, which deletes the data set.
The second function, UNALLOC, unallocates the data set. Because of the disposition (the data set is originally allocated with disposition DELETE), the data set is uncataloged.
Use the F'-1' as a separator between allocation functions.
|
Example 3: Allocate and Concatenate Data Sets
The following example calls the program to allocate each data set through the ALLOC parameter. Then it calls DGADTDYN again to do the concatenation through the CONCAT parameter. The data set is concatenated under the first DDNAME in the CONCAT list.
|
Example 4: Deconcatenate and Unallocate Data Sets
The following example calls the program to deconcatenate by DDNAME using the DECONCAT parameter. Then it calls DGADTDYN again to unallocate each data set in the concatenation with the UNALLOC command.
|