ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Reading PARM incorrectly

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • ravikiran032
    replied
    Re: Reading PARM incorrectly

    Originally posted by GLS400 View Post
    Hi ravikiran032:
    You need to shorten the &file variable to 32 or less (in your case 21 would do).....CL does strange things with variables > 32

    Best of Luck
    GLS

    Thank you very much. That worked. Thanks All.

    Leave a comment:


  • Scott Klement
    replied
    Re: Reading PARM incorrectly

    Either change &FILE to be 32 long (You shouldn't need 40 for a file, should you? Plus, this is the wrong way to pass a qualified object name, if that's what this is!)

    Or, use a *CMD front-end that specifies the length as 40.

    Leave a comment:


  • GLS400
    replied
    Re: Reading PARM incorrectly

    Hi ravikiran032:
    You need to shorten the &file variable to 32 or less (in your case 21 would do).....CL does strange things with variables > 32

    Best of Luck
    GLS

    Leave a comment:


  • ravikiran032
    replied
    Re: Reading PARM incorrectly

    Originally posted by DeadManWalks View Post
    From the command line I always put in my explicit spaces, even to blank fill.
    Could you please let me know how can i specify the parameters in the cmd line to run it correctly.

    Leave a comment:


  • ravikiran032
    replied
    Re: Reading PARM incorrectly

    Originally posted by DeadManWalks View Post
    From the command line I always put in my explicit spaces, even to blank fill.
    Could you please let me know how can i specify the parameters in the cmd line.

    Leave a comment:


  • DeadManWalks
    replied
    Re: Reading PARM incorrectly

    From the command line I always put in my explicit spaces, even to blank fill.

    Leave a comment:


  • ravikiran032
    started a topic Reading PARM incorrectly

    Reading PARM incorrectly

    Hello,

    i have written the below code but while passing the parameter by calling with CALL PGM(mylib/FTOQ_LHM) PARM('PKMB11211D/Q0000033') from command line. it is reading the parameter as PKMB11211D/Q0000033 < long space> 033') Q_LHM. Could you please advise on this.

    Code:
    0001.00              PGM    PARM(&FILE)
    0002.00
    0003.00
    0004.00              DCL        VAR(&FILE) TYPE(*CHAR) LEN(40)
    0005.00              DCL        VAR(&ID) TYPE(*CHAR) LEN(12)
    0006.00              DCL        VAR(&ENV) TYPE(*CHAR) LEN(12)
    0007.00              DCL        VAR(&DEBUG) TYPE(*CHAR) LEN(1)
    0008.00              DCL        VAR(&RCVAL) TYPE(*DEC) LEN(5 0)
    0009.00              DCL        VAR(&NULL) TYPE(*CHAR) LEN(1) VALUE(X'00')
    0010.00              CHGVAR VAR(&FILE) VALUE(&FILE *TCAT &NULL)
    0011.00              CHGVAR     VAR(&ID) VALUE('LHWMLMI' *TCAT &NULL)
    0012.00              CHGVAR     VAR(&ENV) VALUE('TESTD' *TCAT &NULL)
    0013.00              CHGVAR     VAR(&DEBUG) VALUE('1' *TCAT &NULL)
    0014.00              ADDLIBLE   LIB(SLMQTESTD)
    0015.00               MONMSG     MSGID(CPF2103)
    0016.00
    0016.00
    0017.00              STRCMTCTL  LCKLVL(*ALL) CMTSCOPE(*JOB)
    0018.00
    0019.00              CALL       PGM(*LIBL/SLMQFTOQ) PARM('-f' &FILE '-i' &ID +
    0020.00                           '-e' &ENV '-debug' &DEBUG)
    0021.00
    0022.00              ENDCMTCTL
    0023.00
Working...
X