Are You Using MD Commands?

Did you know that MDChange ships many commands for you to use? These commands provide functionality to manage anything from object requests to post-install processing. Combining these with the exit points for commands opens the ability to customize your MDCMS process or automate tedious steps such as environment cleanup.

All MD Commands have F1 help to explain the command and its parameters. The expanded help provides an overview and identifies the log file that is updated when the command is executed. View these logs (option 14 green screen) or directly via SQL.

MDSEC Manual Section 6 has information on controlling access to these commands.

Example Usage of the MDADDREQ Command

Have some environment clean up to take care of and want some help? Do you want to read a file in order to check out your obsolete objects? MDADDREQ can help!

This is an example of file format and CL:

In this case I used the MDXref Report Check usage of a Library. I exported it to Excel to verify that these objects are obsolete and not used by dependent objects. I then uploaded the spreadsheet to the IBMi using the following headings:

DISCLAIMER THE FOLLOWING COMMANDS AND PROGRAMS ARE NOT PART OF THE MIDRANGE DYNAMICS SOFTWARE PRODUCT AND ARE EXCLUDED FROM WARRANTY AND SUPPORT    

/* ***************************************************************/

             DCL        VAR(&LIBN) TYPE(*CHAR) LEN(7)
             DCL        VAR(&OBJT) TYPE(*CHAR) LEN(7)
             DCL        VAR(&OBJN) TYPE(*CHAR) LEN(10)
             DCL        VAR(&RFP) TYPE(*DEC) LEN(2 0)
             DCL        VAR(&ATTR) TYPE(*CHAR) LEN(8)
             DCL        VAR(&DESCR00001) TYPE(*CHAR) LEN(50)
             DCL        VAR(&TASK) TYPE(*CHAR) LEN(1)
             DCL        VAR(&OTHER) TYPE(*CHAR) LEN(2)
             DCL        VAR(&MODDAT) TYPE(*CHAR) LEN(8)
             DCL        VAR(&CRTDAT) TYPE(*CHAR) LEN(8)
             DCL        VAR(&STAMP) TYPE(*CHAR) LEN(8)
            DCL        VAR(&MISC) TYPE(*CHAR) LEN(5)
             DCL        VAR(&ACTION) TYPE(*CHAR) LEN(6)
             DCL        VAR(&LOOP) TYPE(*LGL) VALUE(‘1’)
             DCLF       FILE(DENISEW/OBSOLETE)
             DOWHILE COND(&LOOP)
             RCVF
             MONMSG MSGID(CPF0864) EXEC(LEAVE)
             ADDLIBLE   LIB(MDCMS)
             MDCMS/MDADDREQ APPL(DGW) LVL(10) OBJT(&OBJT) +
                         ATTR(&ATTR) OBJN(&OBJN) RSN(*DELETE) +
                         USER(DENISEW) PROJ(CLEANUP) TASK(1) +
                         ARFP(*YES) RFP(11)
            ENDDO
 FINISH:     ENDPG

Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *