ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

OPDESC does not carry through?

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

  • OPDESC does not carry through?

    I have two procedures, both with OPDESC and *VARSIZE parms.
    It seems that the OPDESC does not carry through from one procedure to the other.

    I have SvcPgm1, Module1, Proc1 with OPDESC and a *VARSIZE Parm1.
    I also have SvcPgm2, Module2, Proc2 with OPDESC and a *VARSIZE Parm2.

    Both Parm1 and Parm2 are defined char(1000) options(*varsize).

    Proc1 contains this code: Proc2(Parm1).

    Now, I am debugging, and I call Proc1(MyParm) where MyParm is char(400).
    When Proc1 calls CEEDOD on MyParm (Parm1), I get a length of 400, as expected.
    Then I call Proc2 from Proc1 passing it the 400-char MyParm.
    When Proc2 calls CEEDOD on MyParm (Parm2), I would expect to get a length of 400. I don't, I get 1000.

    So, why doesn't the length carry through to Proc2 from Proc1?
    Can I make it carry through somehow?

  • #2
    Why don't you declare them as VARCHAR(1000)? As I understand *VARSIZE that tells the compiler that the variable you use to pass may or may not be CHAR(1000). If you want the length to follow use VARCHAR.

    Comment

    Working...
    X