OTOH, REXX does not have an ENDIF, although SELECT does require an END.
-- Shmuel (Seymour J.) Metz http://mason.gmu.edu/~smetz3 ________________________________________ From: IBM Mainframe Discussion List [[email protected]] on behalf of Paul Gilmartin [[email protected]] Sent: Saturday, June 6, 2020 2:40 PM To: [email protected] Subject: Re: COBOL Question On Sat, 6 Jun 2020 15:28:57 -0300, Clark Morris wrote: >On 6 Jun 2020 10:53:44 -0700, (Bob Bridges) wrote: > >>Oh, you need an END-IF even for a single-statement IF? I forgot; I've been >>thinking in REXX too long. In that case you're close; I guess I really meant > But in Rexx similarly, END is required even for a single-statement DO. Good for Rexx. I like strong closure. >In your example the END-IF is not needed. However beginning with VS >COBOL IIV4 (1985 standard) it became better practice to eliminate all >but the last period in a paragraph and terminate all conditional with >end statements such as END-IF. With Enterprise COBOL 5.2 and later >(2002 Standard) the 1050-EXIT paragraph could be eliminated and the GO >TOs replaced with EXIT PARAGRAPH. This allow simpler code generation >for the PERFORM and the PERFORMed paragraph be moved inline to in >effect replace the PERFORM statement. Also look up inline PERFORMs. >In general, because of code optimization starting with VS COBOL II >release 4 (1985 standard) GO TO became a bad idea. > Always a bad idea, or just usually? -- gil ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
