Code Comments
Programming Forum and web based access to our favorite programming groups.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.
Post Follow-up to this messageKannan 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/
Post Follow-up to this messageIn 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
Post Follow-up to this messagethamarai_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.
Post Follow-up to this messageAm 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)
Post Follow-up to this messageKannan 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.
Post Follow-up to this messageJerryMouse 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
Post Follow-up to this messageIn 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
Post Follow-up to this messageOn 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?
Post Follow-up to this messageComments 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)
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.