ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

how to retrieve cobol program compiler option

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

  • how to retrieve cobol program compiler option

    Hi,

    How will I retrieve if a cobol program has a compiler option of *SRCDBG

    I tried to check using DSPPGM but it doesn't show the compiler option. Thanks!

  • #2
    The simplest way that I can think of is to run STRDBG OPMSRC(*YES) to see if a debug source view shows up. Not sure what variations might exist that would skip showing anything. It's been many years since I've debugged any OPM program until doing minimal testing just now.

    If you're looking for something more automated, the Retrieve Module Views (QteRetrieveModuleViews) API is pretty simple. A CL program can run STRDBG for the program (with DSPMODSRC(*NO) to avoid a debug display), and then call the API. If the API fails with CPF9541, there is no debug available. Finish with ENDDBG. Pretty minimal ILE CL code. Very basic example can be posted if needed.
    Tom

    There are only two hard things in Computer Science: cache invalidation, naming things and off-by-one errors.

    Why is it that all of the instruments seeking intelligent life in the universe are pointed away from Earth?

    Comment


    • #3
      I understand the part where I can put in my CL to do the STRDBG with DSPMODSRC(*NO).
      But for the API part, it's quite different from the normal commands I have used. I'll try to research on that.
      Your basic example is highly appreciated. Thanks Tom.

      Comment

      Working...
      X