|
|
| Author |
Message |
rdr
New User
Joined: 26 May 2006 Posts: 22
|
|
|
|
Hi All,
Please let me know if SECTIONA is the only section in the program,
will controle come back to DISPLAY statement after performing the
SECTIONA???
Ex:
Procedure Division.
Perform SectionA.
Display 'After Perform'.
SECTIONA.
---------
---------
---------
---------
END OF SECTIONA.
STOP RUN. |
|
| Back to top |
|
 |
References
|
Posted: Thu Apr 24, 2008 2:25 pm Post subject: Re: Perform-Section |
 |
|
|
 |
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 169 Location: Bangalore
|
|
|
|
| yes, obviously. |
|
| Back to top |
|
 |
Bharath Bhat
New User
Joined: 20 Mar 2008 Posts: 38 Location: chennai
|
|
|
|
| rdr wrote: |
Hi All,
Please let me know if SECTIONA is the only section in the program,
will controle come back to DISPLAY statement after performing the
SECTIONA???
Ex:
Procedure Division.
Perform SectionA.
Display 'After Perform'.
SECTIONA.
---------
---------
---------
---------
END OF SECTIONA.
STOP RUN. |
Why don't you try running it?
| Code: |
Procedure Division.
Perform SectionA.
Display 'After Perform'.
SECTIONA.
Display 'inside SECTIONA'.
|
Please let us know the result after you execute it.  |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1343 Location: germany
|
|
|
|
| after the return to the display command, then you will drop thru section a till you hit the stop run (which you should make - goback). |
|
| Back to top |
|
 |
mohitsaini
New User
Joined: 15 May 2006 Posts: 40
|
|
|
|
for me the output coming is
INSIDE SECTIONA
I didn't expect that ... I thought that the output would be:
INSIDE SECTIONA
AFTER PERFORM.
why is it behaving like this?? |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 948 Location: Virginia, USA
|
|
|
|
| Is there a stop run or a goback in sectiona? |
|
| Back to top |
|
 |
vasanthkumarhb
Active User
Joined: 06 Sep 2007 Posts: 298 Location: Bang,iflex
|
|
|
|
Hello,
If STOP RUN or GO BACK, what is the difference??? |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1343 Location: germany
|
|
|
|
STOP RUN stops the run unit.
GOBACK returns to caller, whether program, mvs or whatever. |
|
| Back to top |
|
 |
dbzTHEdinosauer
Senior Member
Joined: 20 Oct 2006 Posts: 1343 Location: germany
|
|
|
|
since you did not post your code (where is the SECTION. statement?) sorta hard to determine what you have and why. Looks like you are performing paragraphs and do you have a go to anywhere?
no more questions, post the code....................... |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7336 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| Please let me know if SECTIONA is the only section in the program, |
There are no sections in the posted code.
| Quote: |
for me the output coming is
INSIDE SECTIONA |
Not from the posted code. . .
Is there actually a question at all? As DBZ says "post the code................." |
|
| Back to top |
|
 |
mohitsaini
New User
Joined: 15 May 2006 Posts: 40
|
|
|
|
Procedure Division.
Perform SectionA.
Display 'After Perform'.
SECTIONA.
Display 'inside SECTIONA'.
When I ran the above code I got:
INSIDE SECTIONA
I didn't expect that ... I thought that the output would be:
INSIDE SECTIONA
AFTER PERFORM.
why is it behaving like this?? |
|
| Back to top |
|
 |
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 948 Location: Virginia, USA
|
|
|
|
| What is inside SECTIONA? |
|
| Back to top |
|
 |
dick scherrer
Global Moderator
Joined: 23 Nov 2006 Posts: 7336 Location: 221 B Baker St
|
|
|
|
Hello,
| Quote: |
| When I ran the above code I got: |
No, you did not. . . You ran some other or additonal code.
| Quote: |
| why is it behaving like this?? |
Until you post the code, no one can give you a useful answer. |
|
| Back to top |
|
 |
CICS Guy
Senior Member
Joined: 18 Jul 2007 Posts: 1117 Location: At my desk
|
|
|
|
Doesn't COBOL generate an implicit GOBACK at the end of the a program?
Won't "END OF SECTIONA" generate a syntax error, and possibly just be ignored?
What kind of paragraph name is SECTIONA? Somewhat confusing, isn't it?
Is it time for this to fall into the OT hole? |
|
| Back to top |
|
 |
Anuj D.
Senior Member
Joined: 22 Apr 2006 Posts: 1593 Location: Mumbai, India
|
|
|
|
Well,
Your first post
| Code: |
Procedure Division.
Perform SectionA.
Display 'After Perform'.
SECTIONA.
---------
---------
---------
---------
END OF SECTIONA.
STOP RUN. |
Your expected output is
| Quote: |
INSIDE SECTIONA
AFTER PERFORM. |
I assume when you say "output", you actaully taking about DISPLAY statements of your program; if so
was never DISPLAYed in your above code, the output you got
is confusing.
Per your second code, the expected output make a little sense but are you sure there is no other PERFORM SECTIONA in your program. And if only one PERFORM then where do you 'instruct' the program to 'stop', as asked earlier where do you code, GO BACK or STOP RUN.
BTW, SECTIONA is not a good choice for para-name; SECTIONs have different meaning in COBOL. |
|
| Back to top |
|
 |
|
|