ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

COBOL debugging

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

  • COBOL debugging

    Can someone tell me the Compiler options I have to use for debugging a program. And after compilation how can step through the COBOL program ?

    Anil.

  • #2
    Re: COBOL debugging

    Exactly like in RPG. Compile with PDM opt 14 or CRTBNDCBL and hit <F4>. Specify DBGVIEW(*SOURCE or *LIST).
    When the compile is ok STRDBG MYCBLPGM and hit <F6> on the lines to designate the breakpoints.
    Philippe

    Comment


    • #3
      Re: COBOL debugging

      Thanks.
      Should I give those option here:
      Type choices, press Enter.


      Additional Parameters

      Source listing options . . . . . OPTION ?????
      + for more values
      Generation options . . . . . . . GENOPT
      + for more values

      Becaue I don't see this options when i prompted
      DBGVIEW(*SOURCE or *LIST).
      Is it dependent on version?

      Anil

      Comment


      • #4
        Re: COBOL debugging

        Originally posted by medam.anil View Post
        Becaue I don't see this options when i prompted
        DBGVIEW(*SOURCE or *LIST).
        Is it dependent on version?
        Press the F9 key to see *all* of the compiler options. You may have to page down but it should look like this:

        Debug view . . . . . . . . . . . DBGVIEW *STMT


        Terry

        Comment


        • #5
          Re: COBOL debugging

          Thanks. I found DBGVIEW option when I tried to compile using CRTBNDCBL (instead with option 14). I have following options:
          But When I compile my program with these options it's giving me following error message when executing the program:
          Message 'MCH3601' in program object 'SAS006' in library 'DEVLIB' (C D F G).
          (Cause . . . . . : Message 'MCH3601' was detected in COBOL statement 403 of
          COBOL program 'SAS006' in program object 'SAS006' in library 'DEVLIB'.
          Recovery . . . : Enter a G to continue the program at the next MI
          instruction, or a C if no dump is wanted, a D if a dump of the COBOL
          identifiers is wanted, or an F to dump both the COBOL identifiers and the
          file information. The message text for 'MCH3601' follows: 'Pointer not set
          for location referenced.'
          Possible choices for replying to message . . . . . . . . . . . . . . . :
          C -- No formatted dump is given
          D -- A dump of the COBOL identifiers is given )
          But same thing when I compile with my regular way with option 14 by giving *apost and *nostderr, 'm not getting this problem, is there any other options I need to add to compile with debugging option??
          Source listing options . . . . . OPTION *apost
          + for more values
          Generation options . . . . . . . GENOPT *nostderr
          + for more values

          Option Using CRTBNDCBL: I just added DBGVIEW as *Source, rest all are default.

          Program . . . . . . . . . . . . PGM > SAS006
          Library . . . . . . . . . . . > DEVLIB
          Source file . . . . . . . . . . SRCFILE > QS36SRC
          Library . . . . . . . . . . . > DEVLIB
          Source member . . . . . . . . . SRCMBR *PGM
          Output . . . . . . . . . . . . . OUTPUT *PRINT
          Generation severity level . . . GENLVL 30
          Text 'description' . . . . . . . TEXT *SRCMBRTXT


          Additional Parameters

          Compiler options . . . . . . . . OPTION >
          + for more values
          Conversion options . . . . . . . CVTOPT
          + for more values

          Message limit: MSGLMT
          Number of messages . . . . . . *NOMAX
          Message limit severity . . . . 30
          Debug view . . . . . . . . . . . DBGVIEW > *SOURCE
          Optimize level . . . . . . . . . OPTIMIZE *NONE
          FIPS flagging . . . . . . . . . FLAGSTD

          Extended display options . . . . EXTDSPOPT
          + for more values
          Flagging severity . . . . . . . FLAG 0
          Replace program . . . . . . . . REPLACE *YES
          User profile . . . . . . . . . . USRPRF *USER
          Authority . . . . . . . . . . . AUT *LIBCRTAUT
          Link literal . . . . . . . . . . LINKLIT *PGM
          Simple program . . . . . . . . . SIMPLEPGM *YES
          Target release . . . . . . . . . TGTRLS *CURRENT

          Sort sequence . . . . . . . . . SRTSEQ *HEX
          Library . . . . . . . . . . .
          Language id . . . . . . . . . . LANGID *JOBRUN
          Enable performance collection: ENBPFRCOL
          Collection level . . . . . . . *PEP
          Binding directory . . . . . . . BNDDIR *NONE
          Library . . . . . . . . . . .
          + for more values

          Activation group . . . . . . . . ACTGRP QILE
          Profiling data . . . . . . . . . PRFDTA *NOCOL
          Coded character set ID . . . . . CCSID *JOBRUN
          Arithmetic mode . . . . . . . . ARITHMETIC *NOEXTEND

          Comment


          • #6
            Re: COBOL debugging

            I just used Option 14 and in
            Source listing options . . . . . OPTION *SRCDBG
            + for more values

            And it worked fine for me.
            So I'm happy to know the proper options for CRTBNDCBL also for general knowledge.

            Thanks
            Anil.

            Comment

            Working...
            X