1

I am facing a problem while debugging a COBOL program, When using animator and when a call is made to another COBOL program with a CALL ... USING statement.

After entering the sub program and pressing P (for Perform) E (for Exit). The animator asks "Perform Level = 1 Zoom to calling program ?", and on pressing Y(for Yes) Animator shows the message "Perform Level 1", and doesn't proceed to the the next line in the calling program (i.e, MAIN.COB) .

The only option available then is to Zoom all along which is not helping much during debugging.

Is there a runtime Switch or a Compiler option to make animator pass the control back to the calling program

Example: This is the main program that iam debugging

IDENTIFICATION DIVISION.
PROGRAM-ID. MAIN.

DATA DIVISION.
   WORKING-STORAGE SECTION.
   01 WS-STUDENT-ID PIC 9(4) VALUE 1000.
   01 WS-STUDENT-NAME PIC A(15) VALUE 'Tim'.

PROCEDURE DIVISION.
   CALL 'UTIL' USING WS-STUDENT-ID, WS-STUDENT-NAME.
   DISPLAY 'Student Id : ' WS-STUDENT-ID
   DISPLAY 'Student Name : ' WS-STUDENT-NAME
STOP RUN.

This is the called program, UTIL,

IDENTIFICATION DIVISION.
PROGRAM-ID. UTIL.

DATA DIVISION.
   LINKAGE SECTION.
   01 LS-STUDENT-ID PIC 9(4).
   01 LS-STUDENT-NAME PIC A(15).

PROCEDURE DIVISION USING LS-STUDENT-ID, LS-STUDENT-NAME.
   DISPLAY 'In Called Program'.
   MOVE 1111 TO LS-STUDENT-ID.
EXIT PROGRAM.

So when iam debugging MAIN program, and pass control to UTIL subroutine (by Perform and Step ). when i try to return back to calling program MAIN, animator gives the message "Perform Level = 1 Zoom to calling program ? Y/N" - when i press Y is shows a message at lower left saying ""Perform Level = 1" and doesnt skip to the program MAIN

When we look at the Perform / Call stack ( by pressing P and V ) animator displays the below Stack view

Perform/Call Stack View-----------------------------------
Program Name                    Section Name
----------------------------------------------------------
UTIL.int                        No Section or Paragraph


---------------------------------------------------------
Zoon    Scroll <so on... >
---------------------------------------------------------

As you can see, only the Sub module is visible in the stack. Whereas it should have been.

Perform/Call Stack View-----------------------------------
Program Name                    Section Name
----------------------------------------------------------
UTIL.int                        No Section or Paragraph
MAIN.int                        No Section or Paragraph

---------------------------------------------------------
Zoon    Scroll <so on... >
---------------------------------------------------------

(i.e., The calling point from the MAIN.int should also be visible) This is why i suspect it has something to do with some missing compilation option or Environment settings

N Sastry
  • 130
  • 1
  • 10
  • I have been unable to reproduce the problem with my system. Would you be so kind as to supply a minimal program that has the behavior, so I can test it. Also please identify the version of Micro Focus COBOL you are using. You might also try `S` for Step to the next line or, if you aren't debugging the called program, use `P` then `S` (Perform Step) at the `CALL`. – Rick Smith Jan 11 '22 at 19:10
  • Thank you, have added a sample code , but i feel its because of some configuration i have that is causing the problem, some setting or environment variable that is making animator ignore adding calling programs' statements to the Perform stack – N Sastry Jan 12 '22 at 05:09
  • What is the output of **P**erform-Level -> **V**iew? – Simon Sobisch Jan 12 '22 at 09:16
  • As soon as i enter UTIL.COB and press P -> V, it shows UTIL.int No sections or Paragraphs. – N Sastry Jan 12 '22 at 09:39
  • I am troubled by "pass control to UTIL subroutine (by Perform and Step )". This is no different than Step. On my system, Perform Step at the `CALL` statement executes `UTIL` with the current line being the statement after the `CALL` in `MAIN`. There are no compiler options or Animator directives, on my system, that would affect Perform Exit as you have described. – Rick Smith Jan 12 '22 at 15:09
  • yes, **P**erform **S**tep doesn't cause an issue as animator is not displaying the **UTIL** program's code, so the issue iam facing will not be evident....problem comes when i enter **UTIL** and then try to come out of it to continue debugging code in **MAIN** – N Sastry Jan 17 '22 at 15:17

0 Answers0