doubt about exit.



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

doubt about exit.

Postby VIJAY1 » Tue Nov 06, 2012 7:34 pm

I gave a para like this
2200-insert-para
    perform 8000-read-para
2200-insert-para-exit.
    exit.

now i gave
perform 2200-insert-para thru 2200-insert-para-exit
     until num-of-copies = 0.

so in 8000-read-para
i wrote
perform 2200-insert-para-exit.

then where do the control go ?
and what happens.
VIJAY1
 
Posts: 26
Joined: Sun Oct 21, 2012 2:49 pm
Has thanked: 3 times
Been thanked: 0 time

Re: doubt about exit.

 

Re: doubt about exit.

Postby BillyBoyo » Tue Nov 06, 2012 7:38 pm

No, please don't do that. If you just let the 8000- paragraph complete, you will automatically return to the statement after the PERFORM of 8000-.

It is absolutely vital that you understand how PERFORM works. Look in the manuals, and any other materials you have.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: doubt about exit.

Postby Pandora-Box » Tue Nov 06, 2012 7:39 pm

I would request you to add some displays in the code after every para starts with the para name so it would be easier to identify the flow of code at run time
User avatar
Pandora-Box
 
Posts: 65
Joined: Fri Feb 10, 2012 8:30 pm
Location: Mars
Has thanked: 3 times
Been thanked: 6 times

Re: doubt about exit.

Postby NicC » Tue Nov 06, 2012 7:43 pm

Please use the code tags in the editor to make your code readable. Also, cut and paste your code thus avoiding errors whilst retyping. I have fixed both for you.

What is the problem? What are the rules about perform and what happens once it has done its work? Why would you try to execute in 8000 code from 2000. It should be the other way around. And why try to execue an exit anyway.

Finally - what happened when you tried? You did try, didn't you? with lots of DISPLAYs so that you could see what was happening?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times

Re: doubt about exit.

Postby Robert Sample » Tue Nov 06, 2012 7:45 pm

Why not test it yourself and find out? Put a
DISPLAY '<paragraph name'.
immediately after each paragraph name and run the program.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: doubt about exit.

Postby VIJAY1 » Tue Nov 06, 2012 7:49 pm

I am on an assignment which i should submit in 2hrs.so in a hurry.sorry for the trouble.
so...even there is a perform thru and until of that para...when ever exit para of that statement gets encountered the control moves to next statement.?and dont repeats it right?
VIJAY1
 
Posts: 26
Joined: Sun Oct 21, 2012 2:49 pm
Has thanked: 3 times
Been thanked: 0 time

Re: doubt about exit.

Postby Robert Sample » Tue Nov 06, 2012 7:50 pm

A forum such as this is no place for responses in a hurry. People answer if / when they have the time. If you are in such a hurry, pay someone for the answer.

And if you are in too much of a hurry to read the manual -- as you have been directed to -- then there's no reason for us to provide you assistance.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: doubt about exit.

Postby NicC » Tue Nov 06, 2012 7:52 pm

If this is part of your assignment then you should be reading the manual and trying things out - not leaving it until the last minute and hoping someone will come up with an answer for you to sprout without understanding.

I feel like locking this as we are not here to do your assignments for you.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 2690
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisys (almost)
Has thanked: 4 times
Been thanked: 105 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post