The STOW macro updates a partitioned data set directory or PDSE directory by adding, changing, replacing, or deleting an entry in the directory. You can use the STOW macro to add, replace, or delete an entry for a generation of a member. You can also use the STOW macro to clear a partitioned data set or PDSE directory. You can update only one entry at a time using the STOW macro. If the data set is open for output and the entry to be added is a member name (not an alias), the system writes an end-of-data indication following the member. If the data set is open for update, the entry to be replaced is updated in the directory; no end-of-file record is written. You must position to the member using the POINT or FIND macro before issuing the STOW macro. Your program must test all output operations for completion using the same data control block before issuing the STOW macro.
You can use the STOW macro only when the data set is opened for OUTPUT, UPDAT, or OUTIN. See z/OS DFSMS Using Data Sets for more information on using the STOW macros.
If the data set is a PDSE, the CHECK macro can complete before all of the data is on DASD. The STOW macro ensures that all of the member data has been written to DASD.
For PDSEs, the STOW macro synchronizes data to DASD.
For program object PDSEs, you can use only the change, delete, and initialize functions. You cannot specify the add and replace functions for program object PDSEs.
You can use the STOW macro to disconnect a member of a PDSE. (Member connections are established by the OPEN, BLDL, FIND, and POINT macros. Refer to z/OS DFSMS Using Data Sets for information on PDSE connections.) This action is indicated by the DISC directory action. If the DISC directory action is specified, the DCB may be open for INPUT, OUTPUT, UPDAT, or OUTIN.
All addresses for the STOW must be 24-bit addresses.
The format of the STOW macro is:
[label] |
STOW |
dcb address |
Adding or Replacing a Directory Entry: STOW dcb,area,A|R
The list address must specify an area at least 12 bytes long and beginning on a halfword boundary. The following illustration shows the format of the area:
The system supplies the TTR fields when a member name is being added or replaced. Issue the FIND macro to locate the member before using STOW to replace it.
Replacing a Generation: The list address must be of a 12-byte area. The first 8 bytes are the member name, followed by the 4-byte generation number.
Deleting a Directory Entry: The list address must specify an 8-byte area containing the member name or alias to be deleted. The name must begin in the first byte of the area and be padded on the right with blanks, if necessary, to complete the 8 bytes.
When a member of a PDSE is deleted, it remains accessible using FIND by TTR or the POINT macro until all connections to it are released. Connections are released when the PDSE is closed.
Changing the Name of a Member: The list address must specify the address of a 16-byte area. The first 8 bytes contain the old member name or alias, and the second 8 bytes contain the new member name or alias. Both names must begin in the first byte of their 8-byte area and be padded on the right with blanks, if necessary, to complete the 8-byte field.
Initializing the Directory: Omit the list address when the directory action is "I". If the list address is specified, it will be ignored.
Offset | Length | Description |
---|---|---|
X'00' | 2 | Length of list (from offset 0) |
X'02' | 1 | Flags X'80' indicates DISC (set by STOW macro) |
X'03' | 2 | Reserved. Must be X'0000'. |
X'05' | 3 | DCB address |
X'08' | 0 | Beginning of array of entries to be disconnected. The number of entries is determined from length. |
X'08' | 1 | Status field:
|
X'09' | 1 | Reserved. Must be X'00'. |
X'0A' | 3 | MLT |
X'0D' | 1 | Concatenation number |
If you specify the IFF function, the DCB must be open with the OUTPUT or UPDAT option on the OPEN macro. This function currently supports ONLY PDSE data members. To create a new PDSE data member with the new attributes type descriptor and CCSID - a Timestamp of ‘00000000’s needs to be specified on the compare operand. To create a new PDSE data member with new values for the type descriptor and CCSID attributes a valid matching Timestamp must be specified on the compare operand to match the Timestamp of the last updater that is on the disk.
Create or Update the Attributes of a Member: The list address can only have one entry and the entry must have x’40’ at offset ’02’ to indicate it is an IFF function. Table 2 defines the structure of the list.
Offset | Length | Description |
---|---|---|
X'00' | 2 | length of list |
X'02' | 1 | Flags - x'40' = STOW IFF |
X'03' | 2 | Reserved. |
X'05' | 3 | DCB address |
X'08' | 8 | compare operand (timestamp). |
X'10' | 4 | address of directory entry in PDS2 format
Note: directory entry must indicate primary name
|
X'14' | 16 | TYPE DESCRIPTOR. |
X'24' | 2 | CCSID |
Table 3 defines the structure of the list for RG, DG and RECOVERG.
Offset | Length | Description |
---|---|---|
X'00' | 2 | Length of PLIST=20. Set by the user. |
X'02' | 1 | Function. Set by the macro
expansion. X'20'=RG |
X'03' | 1 | Unused, must be zero. Set by the macro expansion. |
X'04' | 4 | DCB address. Set by the macro expansion. |
X'08' | 8 | Member name. Set by the user. |
X'10' | 4 | Generation number. Set by the user and returned by DESERV. |