ASURXLOC external function
The ASURXLOC external function returns the list of volumes where a data set resides.
The syntax is ASURXLOC (stemname,datasetname) where stemname is the name of a REXX stem and datasetname is the name of the data set. ASURXLOC returns values in the following REXX variables:
- stemname.0 = number of volumes on which datasetname resides
- stemname.n = nthDeviceType volumeSerialNumber volumeSequenceNumber
The following figure shows a sample REXX program that uses the ASURXLOC external function.
Sample REXX program using ASURXLOC
/* ASURXLOC Example */
arg DatasetName
say 'Dataset Name is ' || DatasetName
VolList.0 = 0
rc = asurxloc('VolList.',DatasetName)
if ( rc = 0 ) then do
do i = 1 to VolList.0
say 'Volume #' || i || ' ' || VolList.i
end
end
else do
if ( rc = 4 ) then do
say 'Could not open ICF catalog'
end
if ( rc = 8 ) then do
say 'Data set not cataloged'
end
end
exit rc
arg DatasetName
say 'Dataset Name is ' || DatasetName
VolList.0 = 0
rc = asurxloc('VolList.',DatasetName)
if ( rc = 0 ) then do
do i = 1 to VolList.0
say 'Volume #' || i || ' ' || VolList.i
end
end
else do
if ( rc = 4 ) then do
say 'Could not open ICF catalog'
end
if ( rc = 8 ) then do
say 'Data set not cataloged'
end
end
exit rc
To set the returned data into individual variables, use the following REXX statements:
devtype = word(VolList.i,1)
volserno = word(VolList.i,2)
volseqno = word(VolList.i,3)
volserno = word(VolList.i,2)
volseqno = word(VolList.i,3)
ASURXLOC produces the return codes that the following table shows.
ASURXLOC return codes
Return code | Description |
---|---|
0 | Successful completion |
4 | Could not open the ICF catalog |
8 | Data set not cataloged |
Tip: For faster searching, add an asterisk to the end of your partial query. Example: cert*