I hope this is the correct place to post this:
I found this "Prevent accidental changes to production source code" article at http://search400.techtarget.com/tip/...on-source-code
and tried it out. In my Debug testing everything works and the parameter does change to 5 (browse) but the member always comes up in Edit mode. We are at V7r1.
Any suggestions as to what I am missing or why it does not work? (this is the code from the article, mine is modified to recognize our production source Library and File naming convention)
CHGCMD CMD(STRSEU) VLDCKR(MYLIB/STRSEU)
STRSEU Command CL Source
PGM PARM(&P20 &P10 &P8 &P6 &P50)
DCL VAR(&P20) TYPE(*CHAR) LEN(20)
DCL VAR(&P10) TYPE(*CHAR) LEN(10)
DCL VAR(&P8) TYPE(*CHAR) LEN(08)
DCL VAR(&P6) TYPE(*CHAR) LEN(06)
DCL VAR(&P50) TYPE(*CHAR) LEN(50)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
MONMSG MSGID(CPF0000)
CHGVAR VAR(&FILE) VALUE(%SST(&P20 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&P20 11 10))
/* IF USER REQUESTED BY LIBL, DETERMINE WHERE SOURCE FILE RESIDES */
IF COND(&LIB *EQ ' ' *OR &LIB *EQ + '*LIBL ') THEN(RTVOBJD OBJ(&FILE) + OBJTYPE(*FILE) RTNLIB(&LIB))
/* INTERCEPT PARM AND CHANGE IT TO BROWSE ONLY IF NOT PRINTING */
IF COND(%SST(&LIB 5 3) *EQ 'PRD' *AND &P6 *NE + '6') THEN(CHGVAR VAR(&P6) VALUE('5 '))
ENDPGM
(if someone will share how to post code properly I will do so in the future. thanks)
I found this "Prevent accidental changes to production source code" article at http://search400.techtarget.com/tip/...on-source-code
and tried it out. In my Debug testing everything works and the parameter does change to 5 (browse) but the member always comes up in Edit mode. We are at V7r1.
Any suggestions as to what I am missing or why it does not work? (this is the code from the article, mine is modified to recognize our production source Library and File naming convention)
CHGCMD CMD(STRSEU) VLDCKR(MYLIB/STRSEU)
STRSEU Command CL Source
PGM PARM(&P20 &P10 &P8 &P6 &P50)
DCL VAR(&P20) TYPE(*CHAR) LEN(20)
DCL VAR(&P10) TYPE(*CHAR) LEN(10)
DCL VAR(&P8) TYPE(*CHAR) LEN(08)
DCL VAR(&P6) TYPE(*CHAR) LEN(06)
DCL VAR(&P50) TYPE(*CHAR) LEN(50)
DCL VAR(&LIB) TYPE(*CHAR) LEN(10)
DCL VAR(&FILE) TYPE(*CHAR) LEN(10)
MONMSG MSGID(CPF0000)
CHGVAR VAR(&FILE) VALUE(%SST(&P20 1 10))
CHGVAR VAR(&LIB) VALUE(%SST(&P20 11 10))
/* IF USER REQUESTED BY LIBL, DETERMINE WHERE SOURCE FILE RESIDES */
IF COND(&LIB *EQ ' ' *OR &LIB *EQ + '*LIBL ') THEN(RTVOBJD OBJ(&FILE) + OBJTYPE(*FILE) RTNLIB(&LIB))
/* INTERCEPT PARM AND CHANGE IT TO BROWSE ONLY IF NOT PRINTING */
IF COND(%SST(&LIB 5 3) *EQ 'PRD' *AND &P6 *NE + '6') THEN(CHGVAR VAR(&P6) VALUE('5 '))
ENDPGM
(if someone will share how to post code properly I will do so in the future. thanks)
Comment