RealName: Rexx LOCATE function

Find out the real name of an ALIAS, see if a data set is cataloged, or find the data set name associated with any GDG level by using the REALNAME Rexx function.

REALNAME is available as assembler source code.

To save the source code using Netscape or Internet Explorer, select the link above with the right mouse button and select 'Save Link As...' or Save Target as...'

Function

Perform a CAMLST LOCATE on a given name and return to Rexx the name of the data set as returned by SVC 26 (LOCATE).  Use this to:

Find out the real name of an data set with an alias name.
Check to see of a data set is cataloged.
Find out the real data set name of the current or next (or any generation) GDG.

If the data set is not found, or another error occurs, output contains the value UNKNOWN.

Calling Syntax from Rexx:

output = REALNAME(input)

where input is a fully qualified data set name such as USERX.ALIAS.PDS or JOE.TESTGDG(+1).  The data set name must be fully qualified and not in quotes (after it is resolved by Rexx, of course).  Output is the name of the data set returned by LOCATE.

 For example, if input is a GDG generation, such as JOE.GDG(+1), the name returned in output might be something like JOE.GDG.G0000V04.

Installation

Assemble and link realname.txt and place the load module in a load library accessible to your TSO session or batch job.  You can place it in STEPLIB.  Note that this may not be reentrant, so you can not place it in LPA (though if anyone wants to try, let me know how it goes).

Output

        Output is a real data set name, fully qualified and without quotes.