View previous topic :: View next topic
|
Author |
Message |
Virendra Shambharkar
New User
Joined: 26 Aug 2015 Posts: 55 Location: India
|
|
|
|
Hi,
Is COBOL version 6.1 available for use ? I looked for a migration guide for COBOL 6.1 but did not come across any . I might be missing something.
Are there still some dependencies which have not been met before 6.1 can be used?
Any pointers will be helpful.
Thanks,
Virendra |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
Virendra Shambharkar
New User
Joined: 26 Aug 2015 Posts: 55 Location: India
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
Back to top |
|
|
Virendra Shambharkar
New User
Joined: 26 Aug 2015 Posts: 55 Location: India
|
|
|
|
Thank you very much. Have a great day ahead. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Moving from V5 to V6 is very straightforward. Moving to V6 from V4 or earlier is very similar to the move to V5.
The need to use PDSEs, a COBOL V5+ produces Program Objects, which cannot be stored in a PDS.
Bad data, and the way V4 and earlier worked with bad data.
Bad programs, and the way V4 and earlier worked with bad programs.
There are some new compiler options to consider, some are intended as migration aid (to spot bad data). There's RULES. Some new language constructs (EXIT PERFORM, EXIT PARAGRAPH, EXIT SECTION, for instance, but don't use them). |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Bill Woodger wrote: |
... Some new language constructs (EXIT PERFORM, EXIT PARAGRAPH, EXIT SECTION, for instance, but don't use them). |
May I please know why not to use the new constructs? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
They are all GO TOs, wrapped up in fanciness, with no named target.
Code: |
PERFORM PROGA THRU PROGC-EXIT
PROGA.
....
Somecondition
EXIT PARAGRAPH
PROGB.
....
PROGC.
...
PROGC-EXIT.
EXIT. |
Where does EXIT PARAGRAPH go to?
Think about what someone may expect it to do, then look at the 6.1 Language Reference and see what actually happens. |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Bill Woodger wrote: |
They are all GO TOs, wrapped up in fanciness, with no named target.
Code: |
PERFORM PROGA THRU PROGC-EXIT
PROGA.
....
Somecondition
EXIT PARAGRAPH
PROGB.
....
PROGC.
...
PROGC-EXIT.
EXIT. |
Where does EXIT PARAGRAPH go to?
Think about what someone may expect it to do, then look at the 6.1 Language Reference and see what actually happens. |
I just ran a test with the above. EXIT PARAGRAPH passed the control to the first statement in PROGB paragraph. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Correct. And is that "expected" by most people? And when you see it, are you certain it was what was intended?
Not what anyone would want to try to understand :-)
Oh, and a paragraph/SECTION doesn't have to be PERFORMed. So someone could just use it to get out of any old place they happened to be in. Or, is that line of code then someone assuming "this will only exit if the paragraph is PERFORMed".
Then let's have a nice nested in-line PERFORM with EXIT PERFORM or EXIT PERFORM CYCLE. Great fun.
Is everyone going to use them with care and attention? Because if they would, they'd be people who could structure their programs without having to need to use them... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
If you start coding programs with EXIT PARAGRAPH or EXIT PERFORM (with or without CYCLE) -- who uses SECTION these days? -- then you might as well throw a few ALTER statements in your code as well to keep things "fun"! |
|
Back to top |
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
I'm wondering why IBM has introduced these constructs recently.
Didn't they expect these are really needed as an enhancement to the language? |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Gnanas N wrote: |
I'm wondering why IBM has introduced these constructs recently.
Didn't they expect these are really needed as an enhancement to the language? |
They are from the 2002, superseded, now 2014 COBOL Standard.
I think it's an attempt to make COBOL more "recognisable" with regard to other languages.
As you may have guessed, I don't think they are at all a good idea. "GO TO" gets a bad reputation, then we introduce a "secret GO TO", where it is not necessarily clear when it will go, or where it will arrive, and consider it a "structured" construct, so all is OK...
IBM asks people what they want added to Enterprise COBOL. Presumably someone (probably who doesn't know COBOL) thought this was a good idea to add... |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
I suspect someone thought to emulate a C / C++ break statement in COBOL, without considering all the ramifications. |
|
Back to top |
|
|
Terry Heinze
JCL Moderator
Joined: 14 Jul 2008 Posts: 1249 Location: Richfield, MN, USA
|
|
|
|
DECs DIBOL had a CALL statement much like COBOLs PERFORM, but it had no concept of an exit paragraph name, so the only way to exit the CALLd paragraph without executing the following statements was to EXIT PARAGRAPH. DIBOL became DBL and changed ownership since then. |
|
Back to top |
|
|
Abid Hasan
New User
Joined: 25 Mar 2013 Posts: 88 Location: India
|
|
|
|
Adding on to Gnanas's question on why the new constructs, I remember a discussion on Compiler Café (at IBM DeveloperWorks) on these lines where Mr. Woodger had shared detailed insights on their usage, I am not able to spot that link currently, but it was on similar lines as this link: www.ibm.com/developerworks/community/forums/html/topic?id=f2ee4f5a-8c5b-4508-b1f8-6e1195b4fa54&ps=25
And had more details. It is a good read though for anyone trying to understand the 'why' in detail; a search should yield the correct link. |
|
Back to top |
|
|
|