ibm-midrangerpglecontrol-language

How to handle TYPE(*PNAME) in command source definition


  1. How to make a TYPE(*PNAME) parameter be:

    • Required
    • Have a Default value
    • Have an initial length of 10
  2. How to handle increases in the length of the prompted field,

    • The length of a prompted field of the type *PNAME can be increased with "&".
    • RPGLE needs to be the command processing program (CPP)

Example, command source definition:

PARM   KWD(PCML) TYPE(*PNAME) LEN(10) MIN(0) DFT(*MYDFT) SPCVAL((*MYDFT)) PROMPT('PCML Input path')

Solution

  • CMD

    PARM KWD(PCML) TYPE(*PNAME) LEN(512) DFT(*MYDFT) SPCVAL((*MYDFT)) 
      MIN(1) INLPMTLEN(10) PROMPT('PCML Input Path')
    

    RPG

    C     *ENTRY        PLIST                                      
    C                   PARM                    PCML            512
    

    For more information see the Parameter Definition documentation.