Code Comments
Programming Forum and web based access to our favorite programming groups."Joel C. Ewing" <jcREMOVEewing@CAPS.acm.org> wrote in message news:de0fi.102$tj6.15@newsread4.news.pas.earthlink.net... > donald tees wrote: > > While the observations on "GOBACK" are valid for OS/360 and its successor > Operating Systems on IBM mainframes, they would not have been valid for > DOS/VS and DOS/VSE Operating Systems on IBM mainframes in early 1980's. > On those Operating Systems the actual machine command sequence for > terminating subroutines and main programs were different: subroutines > essentially used OS/360 linkage conventions with "BR R14" to return; main > programs had to use a special EOJ SVC call to terminate (BR R14 would > "blow chunks"). I'm pretty sure failing to properly differentiate in > COBOL between "GOBACK" and "STOP RUN" in that environment was fatal. > > Not having used the DOS family of Operating Systems for over 20 years, I > can't say whether today's derivatives of DOS/VSE (z/VSE?) have similar > issues; but it may be rash to presume that the intended semantic > differences between these two termination statements never matter. > > Much of programming style is subjective, but to me using GOBACK to > terminate a main program would appear to be a violation of the intended > semantic conventions of COBOL, making it less obvious to a viewer of the > code that it is intended to be used as a main program. That it may > achieve the desired effect in your environment may be "nice", but that > still doesn't mean it's semantically correct. If it's not semantically > correct, there is always the possibility it might at some point cause > problems with code portability. > Thanks Joel. This helped me put my finger on what it was that flagged it to me. I came out of the background you describe and I'm sure you're right about the BR 14 vs SVC (I think it was 15 or 16, can't really remember now...). But leaving all of that aside, it just seems "illogical" to terminate a main program with GOBACK. I accept the idea that it is returning to the OS, but that's pretty tenuous, given that EVERYTHING returns to the OS eventually. You summed it up perfectly: "...to me using GOBACK to terminate a main program would appear to be a violation of the intended semantic conventions of COBOL, making it less obvious to a viewer of the code that it is intended to be used as a main program. " I feel much better now... :-) Pete.
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.