ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

how to remove the quote when passing to a parameter

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

  • how to remove the quote when passing to a parameter

    i have this variable:
    DCL &TEST *DEC LEN(30) then after CHGVAR the value of &TEST is 'LIB1/PROG1' when it goes here:
    CHKOBJ OBJ(&TEST) OBJTYPE(*PGM)
    it's unsuccessful because of the quote
    CHKOBJ OBJ('LIB1/PROG1') OBJTYPE(*PGM)
    how will i pass the value without the quote?

    Thanks!

  • #2
    You can't put both library name and object name in one variable. You have to use two variables.

    Code:
    dcl   &TestLib    *char  10
    dcl   &TestObj    *char  10
    
    chgvar   &TestLib     LIB1
    chgvar   &TestObj     PROG1
    
    chkobj   obj(&TestLib/&TestObj) objtype(*pgm)

    Comment


    • #3
      Hi TedHolt,

      Thank you so much.

      Comment

      Working...
      X