Return to the Systems Tips
Edit User Space
Submitted by PetreD. EDTF creates a user space and displays it to be edited! I've wrote a small CL for better use. If any improvements, let me know... Tks, Petre PetreD@aol.com /*********************************************************************/ /* Command: EDTUSRSPC CPP: EDTUSRSPC */ /*********************************************************************/ CMD PROMPT('Edit User Space') PARM KWD(USRSPC) TYPE(QUAL1) MIN(1) PROMPT('Space + Name') PARM KWD(SPCOPT) TYPE(*CHAR) LEN(7) RSTD(*YES) + DFT(*EDIT) VALUES('*EDIT' '*CREATE') + PROMPT('Option') QUAL1: QUAL TYPE(*NAME) LEN(10) QUAL TYPE(*NAME) LEN(10) DFT(*LIBL) + SPCVAL((*LIBL) (*CURLIB)) PROMPT('Library') ****************** End of data **************************************** *************** Beginning of data ************************************* Pgm Parm(&USRSPC &SPCOPT) Dcl Var(&USRSPC) Type(*CHAR) Len(20) Dcl Var(&SPCNAM) Type(*CHAR) Len(10) Dcl Var(&SPCLIB) Type(*CHAR) Len(10) Dcl Var(&SPCOPT) Type(*CHAR) Len(7) Dcl Var(&MSG) Type(*CHAR) Len(78) Dcl Var(&MySpace) Type(*CHAR) Len(50) /* Global error handling */ MonMsg MsgID(CPF0000) Exec(GoTo CmdLbl(Error)) /* Resolve user space name/library */ ChgVar Var(&SPCNAM) Value(%SST(&USRSPC 1 10)) ChgVar Var(&SPCLIB) Value(%SST(&USRSPC 11 10)) ChkObj Obj(&SPCLIB/&SPCNAM) ObjType(*USRSPC) MonMsg MsgID(CPF9801) Exec(Do) If Cond(&SPCOPT *EQ '*EDIT ') Then(Do) SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) MsgDta('User + space' *BCAT &SPCNAM *BCAT 'does not + exist in' *BCAT &SPCLIB *BCAT 'Please + choose *CREATE !') ToPgmQ(*PRV) + MsgType(*NOTIFY) GoTo CmdLBL(ThaEnd) EndDo EndDo WrkSpace: ChgVar Var(&MySpace) Value('/QSYS.LIB/' *TCAT + &SPCLIB *TCAT '.LIB/' *TCAT &SPCNAM *TCAT + '.USRSPC') EdtF StmF(&MySpace) Error: RcvMsg Rmv(*NO) Msg(&MSG) If Cond(&MSG *NE ' ') Then(Do) SndPgmMsg MsgID(CPF9898) MsgF(QCPFMSG) MsgDta(&MSG) + ToPgmQ(*PRV) MsgType(*INFO) EndDo Return ThaEnd: EndPgm
[report a broken link by clicking here]