IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

EXIT out of a section without executing the para in fall thr


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
jsaurabh.raj

New User


Joined: 29 Dec 2005
Posts: 2

PostPosted: Fri Jun 08, 2007 3:10 am
Reply with quote

hi,

I wish to exit out of a section without executing the para in fall thru.
This is something like this
Perform CA000-Test-section

CA000-Test-Section Section.
-
-
CB000-test2-para.
-

I wish to perform the section but do not wish to perform the CB000-Test2-para following this. Can this be achieved by any means? I cannot use Go back in CA000-Test-Section as I need control at the next line after the perform statement is executed. loooking forward for suggestion/solution.

Regards,
Saurabh
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Jun 08, 2007 3:19 am
Reply with quote

Just declare a paragraph (at the end of the section) called, maybe "CA000-Test-exit" and follow that with the command "EXIT." and when you want out, just go to the exit.
Back to top
View user's profile Send private message
prasadvrk

Active User


Joined: 31 May 2006
Posts: 200
Location: Netherlands

PostPosted: Fri Jun 08, 2007 11:16 am
Reply with quote

All paras of a section will be executed if you do not exit the section
Back to top
View user's profile Send private message
priyamnavada

New User


Joined: 24 Dec 2005
Posts: 52
Location: hyderabad

PostPosted: Fri Jun 08, 2007 4:10 pm
Reply with quote

Perform CA000-Test-section

CA000-Test-Section Section.
-
GO TO CA000-EXIT -----------------DO THIS ONE
CB000-test2-para.
-
-
-

CA000-EXIT. -----------ADD CODE HERE
EXIT.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Jun 08, 2007 6:06 pm
Reply with quote

Just change CB000-test2-para to a section or add a section name before it. Your perform CA000-test-section will end at the end of CA000-test-section.
Back to top
View user's profile Send private message
jsaurabh.raj

New User


Joined: 29 Dec 2005
Posts: 2

PostPosted: Tue Jun 12, 2007 12:48 am
Reply with quote

Hi,
Thanks for all your responses. My problem is I cannot make the other para as section as the code is written in such a way that if I make them as section then all the paras below that section comes inside that section, which i don't want. Exiting a section also does not help as the control still goes to the para instead next line from where perform statement is performed. Also I thought of using Perform thru but that's not a standard so I cannot use that as well.
icon_mad.gif

Any other solution left??Please let me know.

regards,
Saurabh
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 12, 2007 1:13 am
Reply with quote

Hello,

I'd suggest you define what you need to do to implement this set of "business rules". So far, this topic appears to focus on things you can't do within the compiler - because of some local restrictions.

I suspect that other programs/applications at your location have been required to provide similar functionality. You might look at how they get around these restrictions.

If you will post what the code needs to do, we may be able to offer some suggestions.

And a question - when the section is performed, does the code know then how much of the section needs to be executed?
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Jun 12, 2007 1:20 am
Reply with quote

jsaurabh.raj wrote:
Exiting a section also does not help as the control still goes to the para instead next line from where perform statement is performed.
If I understand what you are trying to say, BULLPUCKY!
Quote:
Any other solution left??Please let me know.

Again..... icon_rolleyes.gif
William Thompson wrote:
Just declare a paragraph (at the end of the section) called, maybe "CA000-Test-exit" and follow that with the command "EXIT." and when you want out, just go to the exit.
Back to top
View user's profile Send private message
miggranados

New User


Joined: 12 Jun 2007
Posts: 2
Location: BRASIL

PostPosted: Thu Jun 14, 2007 8:00 pm
Reply with quote

bom dia...
Analisando seu problema, o que verificamos eh que o paragrafo CB000-test2-para nao esta configurado como uma SECTION. Desta forma, o fluxo normal deste processo eh que CA0000-Test-Section seja executado ateh encontrar um outro paragrafo contendo a clausula SECTION.
Se vc realmente nao quer que CB000-test2-para seja executado na sequencia de CA000-Test_Section, a seguinte alteracao devera ser executada:
de:
CB000-test2-para.
para:
CB000-Test2-para section.
Desta forma nao havera necessidade de se incluir os paragrafos de EXIT na codificacao de seus programas.
Lembre-se:
- Toda SECTION termina quando encontra outra SECTION.

Boa Sorte.

Or to put anoher way......

analyzing this problem, we verify :
the paragraph:
CB000-test2-para.
is not contained in a "SECTION".
The process :
CA0000-Test-Section.
Only goes stop or exit when find another SECTION.
correct this:
from:
CB000-test2-para.
to:
CB000-Test2-para section.

Remember:
All "SECTION" finishes when it finds another "SECTION".
Good Luck.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Use of Perform Thru Exit COBOL Programming 6
No new posts user exit in IBM Infosphere Optim DB2 8
This topic is locked: you cannot edit posts or make replies. Programa para Realiza Operaciones sob... JCL & VSAM 3
Search our Forums:

Back to Top