/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : CHGUID */ /* */ /* Description : Change userid statistics from a dataset. */ /* */ /* Created on : 31 Mar 2018 */ /* Created by : KEVIN FERGUSON */ /* : Userid(MIT001) */ /* : using ABBYDALE.XFER.REXX(CHGUID) */ /* */ /* Called by : */ /* */ /* Calls : LISTDSI */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ parse upper arg uid dsn dialogid = sysvar(sysicmd) parse source Exec_String excnme = word(Exec_String,3) /* Get EXEC's name */ address ISPEXEC "CONTROL ERRORS RETURN" if LASTPOS('.',uid) > 0 then do temp = uid uid = dsn dsn = temp end do while dsn = "" Say 'Enter Dataset Name. (use QUIT to terminate)' pull xsn if xsn = 'QUIT' then exit if xsn = 'END' then exit DSN_STATUS = LISTDSI(''''xsn'''' smsinfo) if sysrecfm <>"U" then do if sysdsorg == "PO" then do dsn = xsn end end if dsn <> xsn then do say 'invalid dataset type for' excnme end end if length(UID) > 7 then do Say 'Passed USERID length error. Correct and retry' rc = 8 ZEDSMSG = 'CHGUID Failed' ZEDLMSG = 'Passed userid length error' ZDLMSG = "UID Length error" ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" address ISPEXEC "SETMSG MSG(ISRZ001)" exit rc end if UID = "" then do UID = userid() end dsn = strip(dsn,b,"'") kf =outtrap('on') DSN_STATUS = LISTDSI(''''dsn'''' smsinfo) rc = 8 if sysrecfm <>"U" then do if sysdsorg = "PO" then do address ISPEXEC "LMINIT DATAID(RES) DATASET('"dsn"') ENQ(SHR)" if rc <> 0 then say 'LMINIT error' zerrlm address ISPEXEC "LMMSTATS DATAID("RES") MEMBER(*) USER("UID")" if rc <> 0 then say 'LMSTAT error' zerrlm address ISPEXEC "LMFREE DATAID("RES")" if rc <> 0 then say 'LMFREE error' zerrlm end end kf =outtrap('off') if rc = 8 then do Say excnme 'only works on PDS datasets' ZEDSMSG = excnme 'failed' ZEDLMSG = dsn 'is the wrong dataset type' ZDLMSG = "Invalid type" ZDLREF = 'Y' Address ISPEXEC "VPUT (ZDLMSG ZDLMSG) SHARED" address ISPEXEC "SETMSG MSG(ISRZ001)" exit rc end exit rc /*-------------------------------------------------------------------*/ /* End of CHGUID */ /*-------------------------------------------------------------------*/