Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7887891
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T05:41:52+00:00 2026-06-03T05:41:52+00:00

I need to ask what is the problem in this my menu program,when i

  • 0

I need to ask what is the problem in this my menu program,when i call another program

by tapping 1 or 2, and when the program called i could not go back to my menu program,

can you help me please how can i get back to my menu when i press Esc key,or does

my Call statment is wrong.

this is the code for my menu program.

LINKAGE SECTION.
   01 MY-PROG1 PIC X.
   01 MY-PROG2 PIC X.

......
......
......

MAIN.

       DISPLAY MENU-HEADER ERROR-MESSAGE.
       PERFORM ENTRY-MENU UNTIL CHOICE = 3.     
       STOP RUN.

   ENTRY-MENU.
       ACCEPT MENU-SELECT.
       PERFORM INPUT-CHOICE UNTIL CHOICE = 3.
       STOP RUN.

   INPUT-CHOICE.
       IF CHOICE = 1
         CALL  'MY-PROGRAM1' USING MY-PROG1 
       ELSE IF CHOICE =2
         CALL 'MY-PROGRAM2' USING MY-PROG2
       ELSE 
          MOVE "INVALID INPUT....." TO ERRMSG
          DISPLAY ERROR-MESSAGE.

this is MY-PROGRAM1.COB this is how i call back the menu program when i press Esc key

LINKAGE SECTION.
   01   MY-PROG1 PIC X.
   01   MY-MENU  PIC X.

......
......
......


MAIN.

 .......
 .......
 STOP RUN.

ENTER-BIRTHDATE.

  ACCEPT...
  .......

  IF ESC-KEY
     DISPLAY CLEAR-SCREEN
     CALL 'MENU'

  ELSE IF F10
    .....
    .....       
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T05:41:54+00:00Added an answer on June 3, 2026 at 5:41 am

    You should replace the STOP RUN statement in the called programm with GOBACK.

    This is the general rules of using STOP RUN and GOBACK:

    The GOBACK statement marks the logical end of a called program.

    General Rules
    If a GOBACK statement is executed in a program which is under the control of a calling runtime element, the object program operates as if executing an EXIT PROGRAM statement that has the same clauses as the GOBACK statement. See the topic The EXIT Statement.
    If a GOBACK statement without the ADDRESS OF clause is executed in a program which is not under the control of a calling runtime element, the object program operates as if executing a STOP RUN statement that has the same clauses as the GOBACK statement.
    If a GOBACK statement with the ADDRESS OF clause is executed in a program which is not under the control of a calling runtime element, the object program operates as if executing a STOP RUN statement except that an arbitrary returned value is set in the system area. The GOBACK statement may result in more compact code than the equivalent EXIT PROGRAM and STOP RUN statement.
    A GOBACK statement must not be executed while executing a declarative procedure in which the GLOBAL phrase is specified except in a program called while executing that declarative procedure.
    If a GOBACK statement is executed in a function, the function operates as if executing an EXIT FUNCTION statement.
    If a GOBACK statement is executed in a method, the method operates as if executing an EXIT METHOD statement.
    If a GOBACK statement is executed in an iterator, the iterator operates as if executing an EXIT ITERATOR statement.

    STOP RUN. This depends on your system.
    STOP RUN on most compilers terminates the program and if it is called by another cobol program then the whole process is terminated.

    At the end of this link you can find a nice schema that represent all those relations.

    Edit : (from an old Microsoft Cobol documentation)

    EXIT PROGRAM STATEMENT :
    The EXIT PROGRAM statement, appearing in a called
    subprogram, causes control to be returned to the
    next executable statement after CALL in the calling
    program.
    This statement must be a paragraph by
    itself.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have this strange problem I need some help with. This menu code goes
just want to ask anyone here can solve this problem? I want to create
need ask you about some help. I have web app running in Net 2.0.
I know this sounds like a dumb question but I need to ask this.
Somebody ask me this question today . What is the need of reference in
I need create a document word with Java. And I ask, how can I
This is how one can set them up: http://www.c-sharpcorner.com/uploadfile/rmcochran/commandpromptinstudiotoolsmenu01152008103357am/commandpromptinstudiotoolsmenu.aspx My problem is that I
I can fix this problem by messing with outher parts of my codebase but
Before you ask, yes I need to show this much data. stl() requires two
I ran into this problem earlier but I didn't ask it because I found

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.