ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How to declare a Signed COMP-3 in CLP?

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

  • How to declare a Signed COMP-3 in CLP?

    I have a variable in cobol program which is declared as S9(08) COMP-3. How will I declare the same type in CLP? I tried *DEC, *UINT and *INT but I cannot make it to work.

    in the CLP, I am calling a program that should be passed like this.
    CALL PGM(mypgm) PARM(‘someparm’ X’000000499F’)

    if it is hardcoded, there is no problem. But when i substitute the X’000000499F’ into a variable, an error occurs.

    Here’s what I tried:
    dcl var(&jobnum) type(*dec) len(8)
    dcl var(&jobnum) type(*int) len(8)
    dcl var(&jobnum) type(*uint) len(8)

  • #2
    COMP-3 is a packed format. The X’000000499F’ literal also reveals this.

    Thus
    dcl var(&jobnum) type(*dec) len(8)
    should work.

    What error do you get?
    How do you put a value in &JOBNUM ?
    What value does the parameter in the cobol program have when you are debugging it?

    A little more information would be helpfull

    Comment


    • #3
      Did you find out what the problem was ?

      Comment

      Working...
      X