Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

Perfrom Thru
I have a doubt in the statement "perform thru" in cobol.

say for example consisder this statement:

perform 001-start thru 005-end-exit.

My doubt is whether this statement above would execute the code
present 001-start and 005-end-exit procedures alone, or would execute
any para in between this two paras. Please clarify on this.

Thanks in advenace.

Report this thread to moderator Post Follow-up to this message
Old Post
Kannan
03-27-04 03:59 AM


Re: Perfrom Thru

Kannan wrote:
> I have a doubt in the statement "perform thru" in cobol.
>
> say for example consisder this statement:
>
> perform 001-start thru 005-end-exit.
>
> My doubt is whether this statement above would execute the code
> present 001-start and 005-end-exit procedures alone, or would execute
> any para in between this two paras. Please clarify on this.
>
> Thanks in advenace.

All paragraphs between 001-start and 005-end-exit, inclusive, would be
executed, unless a GO TO statement forces a program branch to some
other label.  Branching to another label outside the perform thru
range is a very dangerous thing to do.

Branching into a perform thru range without performing it is also a
very dangerous thing to do.

--
http://arnold.trembley.home.att.net/



Report this thread to moderator Post Follow-up to this message
Old Post
Arnold Trembley
03-27-04 03:59 AM


Re: Perfrom Thru
In article <49f7d61d.0403142339.1c3c17df@posting.google.com>,
Kannan <thamarai_k2001@yahoo.co.in> wrote:
>I have a doubt in the statement "perform thru" in cobol.
>
>say for example consisder this statement:
>
>perform 001-start thru 005-end-exit.
>
>My doubt is whether this statement above would execute the code
>present 001-start and 005-end-exit procedures alone, or would execute
>any para in between this two paras. Please clarify on this.

Please do your own homework.

DD


Report this thread to moderator Post Follow-up to this message
Old Post
docdwarf@panix.com
03-27-04 03:59 AM


Re: Perfrom Thru
thamarai_k2001@yahoo.co.in (Kannan) wrote in message news:<49f7d61d.0403142339.1c3c17df@pos
ting.google.com>...
> I have a doubt in the statement "perform thru" in cobol.
>
> say for example consisder this statement:
>
> perform 001-start thru 005-end-exit.
>
> My doubt is whether this statement above would execute the code
> present 001-start and 005-end-exit procedures alone, or would execute
> any para in between this two paras. Please clarify on this.
>
> Thanks in advenace

The manuals for your compiler should explain this for you, for most
compilers, they are either supplied as hardcopy and/or as viewable
files, if you can't find them, most suppliers also have websites where
you can look at the manuals directly or download them for offline
viewing.

A "perform thru" performs all statement in all procedures between the
first and the second according to the logical flow of the statements.
I.e., it starts with the first statement in the first named procedure
and ends at the last statement in the second named procedure.  It is
up to you to ensure that you don't GO TO or PERFORM anywhere else and
not come back.

Report this thread to moderator Post Follow-up to this message
Old Post
Robert Jones
03-27-04 03:59 AM


Re: Perfrom Thru
Am  15.03.04
schrieb  arnold.trembley@worldnet.att.net (Arnold Trembley)
auf  /COMP/LANG/COBOL
in  7Nd5c.25024$H44.469823@bgtnsc04-news.ops.worldnet.att.net
ueber  Re: Perfrom Thru

AT> All paragraphs between 001-start and 005-end-exit, inclusive, would
AT> be executed, unless a GO TO statement forces a program branch to some
AT> other label.  Branching to another label outside the perform thru
AT> range is a very dangerous thing to do.

That's why I never use PERFORM _THRU,_ and apply PERFORM only on
SECTIONs, not Paragraphs, and prefer to use "inline"-PERFORM, and IF
.. ELSE .. END-IF.

After COBOL-85 came into being, there should be no more need to do
otherwise.

And a GO TO should never be used without a corresponding
COME FROM...


Yours,
Lüko Willms                                     http://www.mlwerke.de
/--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --

"Die Interessen der Nation lassen sich nicht anders formulieren als unter
dem Gesichtspunkt der herrschenden Klasse oder der Klasse, die die
Herrschaft anstrebt."            - Leo Trotzki         (27. Januar 1932)

Report this thread to moderator Post Follow-up to this message
Old Post
Lueko Willms
03-27-04 03:59 AM


Re: Perfrom Thru
Kannan wrote:
> I have a doubt in the statement "perform thru" in cobol.
>
> say for example consisder this statement:
>
> perform 001-start thru 005-end-exit.
>
> My doubt is whether this statement above would execute the code
> present 001-start and 005-end-exit procedures alone, or would execute
> any para in between this two paras. Please clarify on this.
>
> Thanks in advenace.

I notice you are corresponding from India.



Report this thread to moderator Post Follow-up to this message
Old Post
JerryMouse
03-27-04 03:59 AM


Re: Perfrom Thru
JerryMouse wrote:

>I notice you are corresponding from India.

PERFORM ... THRU ... must not have been covered in the Outsourcing
documentation.

Ken Grubb
Lower Paxton Twp, PA


Report this thread to moderator Post Follow-up to this message
Old Post
Ken Grubb
03-27-04 03:59 AM


Re: Perfrom Thru
In article <49f7d61d.0403142339.1c3c17df@posting.google.com>,
thamarai_k2001@yahoo.co.in (Kannan) wrote:

> I have a doubt in the statement "perform thru" in cobol.
>
> say for example consisder this statement:
>
> perform 001-start thru 005-end-exit.
>
> My doubt is whether this statement above would execute the code
> present 001-start and 005-end-exit procedures alone, or would execute
> any para in between this two paras. Please clarify on this.
>
> Thanks in advenace.

It will execute all of the code between the label 001-START and
005-END-EXIT.

However, it is a dangerous construct with plenty of hazards associated
with its use.

If you want to perform all the paragraphs in a range, my suggestion is
that you explicitly code a perform for each paragraph you want executed,
e.g:

PERFORM 001-START
PERFORM 002-DO-SOMETHING
PERFORM 003-DO-OTHER-THING
PERFORM 004-DO-LAST-THING
PERFORM 005-END-EXIT

instead of:

PERFORM 001-START THRU 005-END-EXIT

And please don't let the xenophobes bother you -- many people think
highly of India.

Regards,

Joe

Report this thread to moderator Post Follow-up to this message
Old Post
Joe Zitzelberger
03-27-04 03:59 AM


Re: Perfrom Thru
On 15 Mar 2004 05:08:31 -0500, docdwarf@panix.com wrote:

>Please do your own homework.

Some are looking at skilled others who did:

http://sfgate.com/cgi-bin/article.c...MNG905K1BC1.DTL

Washington -- The government is taking the first steps toward a
targeted military draft of Americans with special skills in computers
and foreign languages.
 ========================================
============
What an happy ending, old bernouilli!

Except if they outsource the lot, of course!

Clever, nay?

Report this thread to moderator Post Follow-up to this message
Old Post
berlutte@sympatico.ca
03-27-04 03:59 AM


Re: Perfrom Thru
Comments embedded below, CAPS for clarity and emphasis only, no shouting
intended. - Dick

Lueko Willms wrote:

><snp>

>
>   That's why I never use PERFORM _THRU,_ and apply PERFORM only on
> SECTIONs, not Paragraphs, and prefer to use "inline"-PERFORM, and IF
> .. ELSE .. END-IF.
>
I disagree (IMHO) in that the PERFORM_THRU provides a very clear
definition of what you want to do.  Having said that, a PERFORM
1000-START THROUGH 5000-EXIT is one of the confusing and improper things
to do.  Should be PERFORM 1000-START THRU 1000-EXIT  ONLY!  The only
labels (and, if necessary GO TO's ) in the paragraph should be things
like 1000-CONTINUE or 1000-GROUP-BYPASS.

Remember, CLARITY is the MAJOR benefit for many coding techniques.  You
want to insure that anyone can read, understand, and modify your code
when necessary.

Also, of prime importance, NEVER change styles in a program you are
modifying, unless you are COMPLETELY rewriting the program.  Mixing and
mixing PERFORM_THRU and PERFORM's in the same program can give you more
headaches than you ever want.

>   After COBOL-85 came into being, there should be no more need to do
> otherwise.
>
>   And a GO TO should never be used without a corresponding
> COME FROM...
>
>
> Yours,
> Lüko Willms                                     http://www.mlwerke.de
> /--------- L.WILLMS@jpberlin.de -- Alle Rechte vorbehalten --
>
> "Die Interessen der Nation lassen sich nicht anders formulieren als unter
> dem Gesichtspunkt der herrschenden Klasse oder der Klasse, die die
> Herrschaft anstrebt."            - Leo Trotzki         (27. Januar 1932)


Report this thread to moderator Post Follow-up to this message
Old Post
Pierra
03-27-04 03:59 AM


Sponsored Links




Last Thread Next Thread Next
Pages (13): [1] 2 3 4 5 6 » ... Last »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 12:58 PM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.