/* REXX MYALIAS Find the ALIAS for this dataset */ arg argline /* pro-forma quick-start */ address TSO arg parms "((" opts upper opts opts = Strip( opts,'T','5d'x ) /* clip trailing paren */ parse var opts "TRACE" tv . parse value tv "N" with tv . sw.0_nested = sysvar( "SYSNEST" ) = "YES" rc = Trace( "O" ); rc = Trace( tv ) parse value '0' with, sw. helpmsg ans . if WordPos( '?',parms ) > 0 then call HELP /* -*/ /* When called from 3.4, the dsn arrives quoted and fully-qualified. */ parse var parms dsn parms if Left( dsn,1 ) <> "'" then, dsn = "'"Userid()"."dsn"'" rc = Outtrap( 'LC.' ) "LISTCAT ENTRY( " dsn ") ALL" rc = Outtrap( 'off' ) do zz = 1 to lc.0 if sw.0_OK then do parse var lc.zz "ALIAS" rest aliasnm = "'"Strip( rest,,'-' )"'" ans = "ALIAS is" aliasnm leave zz end if Left( Strip( lc.zz ),5 ) = 'ASSOC' then, if Pos( '(NULL)',lc.zz ) > 0 then do ans = "No ALIAS" leave zz end else sw.0_OK = 1 end /* zz */ if sw.0_nested then return ans else say ans exit /*@ MYALIAS */ /* . ----------------------------------------------------------------- */ HELP: /*@ */ address TSO;"CLEAR" if helpmsg <> "" then say helpmsg parse source sys_id how_invokt exec_name DD_nm DS_nm, as_invokt cmd_env addr_spc usr_tokn ex_nam = Left(exec_name,8) /* predictable size */ say " " say " "ex_nam" locates the dataset alias for the selected dataset. " say " " say " Syntax: "ex_nam" dsn " say " " say " dsn is the non-alias dataset name to be reported. " say " " "NEWSTACK"; pull ; "CLEAR" ; "DELSTACK" say " Debugging tools provided include: " say " " say " TRACE tv: will use value following TRACE to place the execution " say " into REXX TRACE Mode. " say " " say " " say " Debugging tools can be accessed in the following manner: " say " " say " TSO "ex_nam" parameters (( debug-options " say " " say " For example: " say " " say " TSO "ex_nam" (( trace ?r branch " if sysvar( "SYSISPF" ) = "ACTIVE" then, address ISPEXEC "CONTROL DISPLAY REFRESH" exit /*@ HELP */