简体   繁体   中英

IBM for i / RPG: How to compile a module and create a service program with one call in IBM Rational Developer for i (RDi)

How to avoid having to use the Compile menu of RDi 2 times in a row - to create first a SQL RPGLE module and then to create the service program associated?

For that, you create first a CL Program (let's name it CRTSRVPRG) like this:

     PGM        PARM(&LIBRARY &SOURCE &NAME)

     DCL        VAR(&LIBRARY) TYPE(*CHAR) LEN(10)
     DCL        VAR(&SOURCE)  TYPE(*CHAR) LEN(10)
     DCL        VAR(&NAME)    TYPE(*CHAR) LEN(10)


     CRTSQLRPGI OBJ(&LIBRARY/&NAME) SRCFILE(&LIBRARY/&SOURCE) SRCMBR(&NAME) REPLACE(*YES) OBJTYPE(*MODULE) DBGVIEW(*SOURCE) OPTION(*EVENTF)
     CRTSRVPGM  SRVPGM(&LIBRARY/&NAME) MODULE(&LIBRARY/&NAME) EXPORT(*ALL) SRCFILE(&LIBRARY/&SOURCE)

     ENDPGM 

Then in the menu Compile / Compile / Work With Compile Command…, you add the following new command:

CALL PGM([your library]/CRTSRVPRG) PARM(&L &F &N) /* OPTION(*EVENTF) SRCMBR(&N) */

Once you've run this command once, you use the button "Run compile command without prompting" from the toolbar.

The addition in the command of

/* OPTION(*EVENTF) SRCMBR(&N) */

gives you the feedback for the module compilation in the Tab "Error List". Unfortunately, there is no feedback for the creation of the Service Program. For that, you'll have to look into the Tab "Commands Log"...

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM