Hi all. Could someone take a look at the following example and let me know if their is an easy way around my problem? The following piece of code takes an incoming parm which is an RPG program name. It then goes to a database and retrieves all of the associated modules need to use the CRTPGM correctly. At least, that was the idea.
First some sample Code:
PGM PARM(&EPARM)
DCL VAR(&EPARM) TYPE(*CHAR) LEN(200)
DCL VAR(&PGMNAM) TYPE(*CHAR) LEN(10)
DCL VAR(&MODLST) TYPE(*CHAR) LEN(180)
/************************************************** */
/* Take the incoming program name and pass it to the RPG program */
/* to extract the associated module names from my database */
/************************************************** */
CALL PGM(UT204) PARM(&EPARM)
CHGVAR VAR(&PGMNAM) VALUE(%SST(&EPARM 1 10))
CHGVAR VAR(&MODLST) VALUE(%SST(&EPARM 11 180))
CRTPGM PGM(MWLIB/&PGMNAM) MODULE(&MODLST)
There is more to this code, but in a nutshell it is NOT happy with &MODLST. &Modlist contains the following:
'SC114 MWLIB/SC114 MWLIB/pu911 MWLIB/pu919 MWLIB/pu921'
When I looked into it further, I got the impression that the command would prefer something in this format:
CRTPGM PGM(MWLIB/&PGMNAM) MODULE(&LIB/&MODA &LIB/&MODB &LIB/&MODC &LIB/&MODD )
This creates a problem as I really don't want to have to hardcode in unique CRTPGM commands depending on the number of modules being passed in.
I hope this makes sense. If any of you have a method / workaround, I would really appreciate it.
A final note, yes I am completely aware of modifying the H specs in all my RPG code to handle using PDM's option #14 to do all of this work for me.
Thanks in advance for any help you can provide.
Coldplay
First some sample Code:
PGM PARM(&EPARM)
DCL VAR(&EPARM) TYPE(*CHAR) LEN(200)
DCL VAR(&PGMNAM) TYPE(*CHAR) LEN(10)
DCL VAR(&MODLST) TYPE(*CHAR) LEN(180)
/************************************************** */
/* Take the incoming program name and pass it to the RPG program */
/* to extract the associated module names from my database */
/************************************************** */
CALL PGM(UT204) PARM(&EPARM)
CHGVAR VAR(&PGMNAM) VALUE(%SST(&EPARM 1 10))
CHGVAR VAR(&MODLST) VALUE(%SST(&EPARM 11 180))
CRTPGM PGM(MWLIB/&PGMNAM) MODULE(&MODLST)
There is more to this code, but in a nutshell it is NOT happy with &MODLST. &Modlist contains the following:
'SC114 MWLIB/SC114 MWLIB/pu911 MWLIB/pu919 MWLIB/pu921'
When I looked into it further, I got the impression that the command would prefer something in this format:
CRTPGM PGM(MWLIB/&PGMNAM) MODULE(&LIB/&MODA &LIB/&MODB &LIB/&MODC &LIB/&MODD )
This creates a problem as I really don't want to have to hardcode in unique CRTPGM commands depending on the number of modules being passed in.
I hope this makes sense. If any of you have a method / workaround, I would really appreciate it.
A final note, yes I am completely aware of modifying the H specs in all my RPG code to handle using PDM's option #14 to do all of this work for me.
Thanks in advance for any help you can provide.
Coldplay
Comment