/* REXX*/Simple piece of code and it uses ISRDDN utility. It is an IBM utility which lists all the allocated DDNAME for your current TSO session.
DSNAME = ARG(1)
IF DSNAME = ' ' THEN DO
SAY 'ENTER DATASET NAME'
PARSE UPPER EXTERNAL DSNAME
END
ADDRESS TSO
IF SYSDSN("'"DSNAME"'") <> 'OK' THEN DO
SAY "DATASET DOES NOT EXIST"
ADDRESS ISREDIT
EXIT
END
ADDRESS TSO "ISRDDN E ' "DSNAME" ' "
EXIT
Without the rexx code also , we even can execute the command
TSO ISRDDN ENQ 'Data-set Name'
and it will show the corresponding information