So I am giving a good effort into writing a CL/CMD pair to start one of
our programs from the command line, but I've hit a snag. Here is my CMD
source:
CMD PROMPT('Start Engine')
PARM KWD(PGM) TYPE(*NAME) LEN(10) DFT('TRAN_ENGV2') PROMPT('Engine Program Name')
PARM KWD(PATH) TYPE(*PNAME) MIN(1) PROMPT('IFS Directory')
PARM KWD(PORT) TYPE(*INT2) MIN(1) PROMPT('Listening Port')
PARM KWD(NUMCHLD) TYPE(*INT2) MIN(1) PROMPT('Number Of Children To Start')
PARM KWD(JOBNAME) TYPE(*NAME) LEN(10) DFT('DFCENG') PROMPT('Name of this job')
and the first few lines of my CL:
PGM PARM(&ENG_PROG &PATH &PORT &NUMCHLD &JOBNAME)
DCL VAR(&ENG_PROG) TYPE(*CHAR) LEN(10)
DCL VAR(&PATH) TYPE(*CHAR) LEN(1000)
DCL VAR(&PORT) TYPE(*UINT)
DCL VAR(&NUMCHLD) TYPE(*UINT)
DCL VAR(&JOBNAME) TYPE(*CHAR) LEN(10)
The &PATH parameter, as it comes into the CL, has garbage in it, hence the "Path name contains embedded nulls." problem.
Questions:
1. Can anyone help me with this? Seems like the problem is in the CMD source.
2. What is the real value of using *PNAME? Can't I just use *CHAR here?
Software/Hardware used:
i7 V7R1 CL CMD
ASKED:
October 10, 2012 3:30 PM