Use EDGXMP1 to list all the volumes in a multivolume set of volumes,
as shown in this example:.
/*REXX*****************************************************************/
/* */
/* VOLCHAIN EXEC - Given any volume serial number it lists all the */
/* volumes in the multivolume set */
/* */
/* Variables used from LISTVOLUME command: */
/* edg@vol - Volume serial number */
/* edg@pvl - Volume serial number of previous volume in */
/* multivolume chain. */
/* edg@nvl - Volume serial number of next volume in */
/* multivolume chain. */
/* */
/**********************************************************************/
arg volser /* Use parameter supplied as the */
/* volume serial. */
Do while volser = '' /* No volume serial so ask for one*/
Say "Enter Volume Serial:" /* Issue prompt to TSO user */
Pull volser /* Get volume serial from TSO user*/
end
Call LISTVOL volser /* Set variable information for */
/* requested volume. */
If result = 0 then /* Are variables OK? */
do
nextvol = edg@nvl /* Save the next volume pointer */
push edg@vol /* Put this volume serial on the */
/* stack. */
/* Chain through the previous */
/* volumes, listing each and */
/* putting each volume serial on */
/* the stack. */
Do while (result = 0) & (strip(edg@pvl) ^= '')
Call LISTVOL edg@pvl /* Set variable information for */
/* previous volume. */
If result = 0 then /* If previous volume exists then */
Push edg@vol /* Put its serial number on the */
/* stack. */
End /* of chaining prevvol pointers */
edg@nvl = nextvol /* Start the chain at the next */
/* volume of the volume which was */
/* listed first. */
/* Chain through the next volumes */
/* listing each and putting each */
/* volume serial on the stack. */
Do while (result = 0) & (strip(edg@nvl) ^= '')
Call LISTVOL edg@nvl /* Set variable information for */
/* previous volume. */
If result = 0 then /* If previous volume exists then */
Queue edg@vol /* put its serial number on the */
/* stack. */
End /* of chaining nextvol pointers */
Do queued() /* For each volume in the multi- */
pull volser /* volume chain, pull the serial */
say volser /* off the stack and write it to */
End /* of volume list */ /* the TSO user. */
end /* of successful list */
exit(0) /* return to caller */
LISTVOL: /* LISTVOLUME Procedure: */
/* Input parameter: volume serial */
/* Output: */
/* Result=0: Complete set of */
/* listvolume variables */
/* Result=4: Error message */
/* issued to TSO user */
arg volser
sysauth.edgdate = "EUROPEAN" /* Tell RMM TSO command to return */
/* output as REXX variables and */
/* dates in EUROPEAN (DD/MM/YYYY) */
/* format. */
save_prompt = prompt("OFF") /* Turn PROMPTing off. */
/* Get volume information from */
/* DFSMSrmm. */
address "TSO" "RMM LISTVOLUME "volser" ALL"
If rc = 0 then
lvresult = 0 /* Indicate Successful LISTVOLUME */
else
do
drop sysauth.edgdate /* An error has occurred. Tell */
/* the RMM TSO command to return */
/* output via messages. */
/* Get error information from */
/* DFSMSrmm. */
say "LISTVOLUME "volser
address "TSO" "RMM LISTVOLUME "volser
lvresult = 4 /* Indicate Unsuccessful */
/* LISTVOLUME. */
end
junk = prompt(save_prompt) /* Restore PROMPT status. */
return lvresult /* Return to caller. */