Problem with CMD/CL and *PNAME type (Path name contains embedded nulls.)

45 pts.
Tags:
CL
CMD Source
i7
V7R1
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

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Your program declares the variable &PATH to be 1000 characters long. Your command only defines the first few bytes. Because of that, your program is accessing undefined memory for most of the 1000 bytes. You'd do well to read the documentation of a CL PARM statement to see how to specify parameter lengths. -- Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following