Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
What is the most important innovation made to Cobol?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Fri Apr 15, 2011 5:29 am    Post subject: What is the most important innovation made to Cobol?
Reply with quote

Used with permission, from the CLIST & rexx place.

don.leahy wrote:
Using END-IF and minimizing period usage makes for much more maintainable code. In my opinion END-IF was the most important innovation made to Cobol in the 30 years I've been in this business.


I keep thinking of this since Don mentioned it (well, not all the time, so stop giggling about it at the back there). I think he is right. Certainly the feature I used most often.

Code:

            IF (A EQUAL TO B)
                 PERFORM STUFF-TO-DO-IN-THIS-INSTANCE. (only an eg guys)
            MOVE C TO D.
            MOVE E TO F.
            MOVE G TO H.
        END-OF-SECTION.
            EXIT.


Now, someone would need to make the three moves conditional. Shift to the right for the indent, take the periods off the first two. Compile, run. Mmm... what's gone wrong? Period still on the perform. Or leave one of the periods on one of the moves. Too easy to do if being sloppy, but what can you do about it?

Code:

            IF (A EQUAL TO B)
                 PERFORM STUFF-TO-DO-IN-THIS-INSTANCE
            END-IF
            MOVE C TO D
            MOVE E TO F
            MOVE G TO H
            .
        END-OF-SECTION.
            EXIT.


Gone were the days of "End of sentence not preceded by period, period assumed" with the advent of COBOL II. Move the code inside the IF, change the indenting. Bobs your uncle.

Problem was, you could still use periods if you wanted. Still works reasonably well, as the compiler spots the END-IF, now without an IF.

Worse problem. You didn't need to code the END-IF. A period would do.

Simple question after the build-up, two-stage answer. What is the most important change from "old" Cobol until today 1) to aid the production of maintainable code 2) for any other reason you like?

I'm sticking with Don on 1), unless convinced otherwise. For 2) I'm considering Web support as a strategic answer.

Follow-on question. I have more topics if you like. However, I don't want to be a bore. If you don't like these, can you form an orderly queue over by the fire exit?
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Fri Apr 15, 2011 5:42 am    Post subject: Reply to: What is the most important innovation made to Cobo
Reply with quote

Here's a short laundry list -

Along the same lines as END-IF, there's always in-line PERFORM (default TEST BEFORE), which is akin to a PL/I DO WHILE (may not execute at all). TEST AFTER is akin to PL/I DO UNTIL (will execute at least once). Both introduced with VS/COBOL II.

Reference Modification (a major improvement). Introduced with VS/COBOL II.

HEX notation. Introduced with VS/COBOL II.

Easy handling of variable length files in Batch (many posts on the forum about this subject). Introduced with VS/COBOL II.

INSPECT WITH LITERALS (Resolves in-line as a single TR instruction). Introduced with VS/COBOL II.

COBOL FUNCTIONS (Introduced with COBOL/370, the successor to VS COBOL II).

PROCEDURE POINTER (load an external program/table into memory - similar to an MVS LOAD Macro). Introduced with COBOL/370.

Language Environment integration (introduced with COBOL/370 as well).

COMP-5 Binary (Introduced with OS/390 COBOL 2.2.1). TRUNC option has NO EFFECT. Also known as Native Binary.

Bill
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Fri Apr 15, 2011 12:14 pm    Post subject:
Reply with quote

Quite a list.

I'll assume you mean the in-line stuff for the maintainable code? OK as long as it doesn't come over all Pascal.

Can I coax you into one "other". Reference modification, maybe?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Apr 15, 2011 1:21 pm    Post subject:
Reply with quote

Best inovation:

end construct
expansion of file-status


things that should be removed from cobol:

declaratives.

read .... at end
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7314

PostPosted: Fri Apr 15, 2011 1:59 pm    Post subject:
Reply with quote

OK.

Trouble with a list of things to be removed is that no-one ever takes any notice of us. At least with things that have been added, we can talk about something real.

However, I'd not miss declaratives either. With the file-status, AT END is a bit pointless, isn't it?

It is also funny. With IBM Cobol, nothing is removed for years. Then they take an axe to a whole chunk. I miss my "IBM extention"s. Some, anyway.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us