Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Perform-Section
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
rdr

New User


Joined: 26 May 2006
Posts: 22

PostPosted: Thu Apr 24, 2008 2:25 pm    Post subject: Perform-Section
Reply with quote

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
View user's profile Send private message
References
PostPosted: Thu Apr 24, 2008 2:25 pm    Post subject: Re: Perform-Section Reply with quote

the_gautam

Active User


Joined: 05 Jun 2005
Posts: 169
Location: Bangalore

PostPosted: Thu Apr 24, 2008 2:41 pm    Post subject:
Reply with quote

yes, obviously.
Back to top
View user's profile Send private message
Bharath Bhat

New User


Joined: 20 Mar 2008
Posts: 41
Location: chennai

PostPosted: Thu Apr 24, 2008 3:01 pm    Post subject: Re: Perform-Section
Reply with quote

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. icon_smile.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1368
Location: germany

PostPosted: Thu Apr 24, 2008 3:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mohitsaini

New User


Joined: 15 May 2006
Posts: 40

PostPosted: Thu Apr 24, 2008 4:42 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Thu Apr 24, 2008 5:10 pm    Post subject:
Reply with quote

Is there a stop run or a goback in sectiona?
Back to top
View user's profile Send private message
vasanthkumarhb

Active User


Joined: 06 Sep 2007
Posts: 298
Location: Bang,iflex

PostPosted: Thu Apr 24, 2008 5:29 pm    Post subject:
Reply with quote

Hello,


If STOP RUN or GO BACK, what is the difference???
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1368
Location: germany

PostPosted: Thu Apr 24, 2008 5:41 pm    Post subject:
Reply with quote

STOP RUN stops the run unit.

GOBACK returns to caller, whether program, mvs or whatever.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Senior Member


Joined: 20 Oct 2006
Posts: 1368
Location: germany

PostPosted: Thu Apr 24, 2008 5:44 pm    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7455
Location: 221 B Baker St

PostPosted: Thu Apr 24, 2008 8:19 pm    Post subject:
Reply with quote

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
View user's profile Send private message
mohitsaini

New User


Joined: 15 May 2006
Posts: 40

PostPosted: Thu Apr 24, 2008 10:37 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


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

PostPosted: Thu Apr 24, 2008 11:25 pm    Post subject:
Reply with quote

What is inside SECTIONA?
Back to top
View user's profile Send private message
dick scherrer

Global Moderator


Joined: 23 Nov 2006
Posts: 7455
Location: 221 B Baker St

PostPosted: Thu Apr 24, 2008 11:43 pm    Post subject:
Reply with quote

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
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 1128
Location: At my desk

PostPosted: Fri Apr 25, 2008 1:30 am    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj D.

Senior Member


Joined: 22 Apr 2006
Posts: 1638
Location: Mumbai, India

PostPosted: Fri Apr 25, 2008 2:34 am    Post subject:
Reply with quote

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
Quote:
INSIDE SECTIONA
was never DISPLAYed in your above code, the output you got
Quote:
INSIDE SECTIONA
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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 HoursGoto page 1, 2, 3  Next
Page 1 of 3