MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

COBOL shop standards

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Sat Aug 30, 2014 4:03 am    Post subject: COBOL shop standards Reply with quote

Just interested in a non-scientific "finger in the sky" feeling for what coding standards are out there.

For examples, 2 questions.

1) How many shops use/allow mixed-case coding and how many demand only upper-case
2) How many use perform on a section compared to perform xxxxx through yyyyy

Just curious
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Sat Aug 30, 2014 11:08 pm    Post subject: Reply with quote

misi01,

AFAIK

1. Except for the comments everything is in Upper-case. Exception was a case where you need to replace the lower-case strings to upper-case.

2. PERFORM section and if it was PERFORM xxx thru yyyy then the compiler option SSRANGE option was turned on to catch all the out of subscript range errors in the development region and production code did not have the SSRANGE.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Sun Aug 31, 2014 5:17 am    Post subject: It'a always fascinated me (upper-case) Reply with quote

I have a theory and it goes like this.

Everyone writes in UC only because everyone else does. Why?

I remember when I first started working, there was actually a punch machine and programmers sent their code on a form to be punched onto cards (remember, we're talking the 70's here). It follows (?) from that, that the punch operators didn't bother switching in and out of UC since that would have been more work than it was worth. From that comes the "standard" that all code is written in UC because "that's how we've always done it".

I find the idea rather strange. How about I write this append IN ALL UC, WOULD THAT MAKE IT EASIER TO READ (etc etc). Since the ability is there to write mixed code, why do shops STILL continue to write in UC only ?
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
Nic Clouston
Advanced


Joined: 01 Feb 2007
Posts: 1075
Topics: 7
Location: At Home

PostPosted: Sun Aug 31, 2014 10:26 am    Post subject: Reply with quote

In early days lower case did not exist - sweeping statement and I cannot verify it. However, early COBOL, don't know about PL/1, HAD to be in upper case. JCL still has to be in upper case. Probably all to do with limited memory available so you did not waste code checking case.
_________________
Utility and Program control cards are NOT, repeat NOT, JCL.
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Sun Aug 31, 2014 12:24 pm    Post subject: Reply with quote

These days cOBOL source can be written in lower-case, mixed-case or upper-case. However, as far as the CoBOL compiler is concerned, everything is processed in upper-case only. "Folding" is the technical term, and CObOL source is "folded" by the COBoL compiler.

This means that if I'd defined a data-name as:

Code:
01  cobol PIC X.


Then the definition would actually refer to COBOL , as would all the above references I typed.

I think people mostly code in upper-case, because people mostly code in upper-case, as you say.

These days I PERFORM paragraph-name. If I PERFORM section-name then I ensure the SECTION contains no paragraphs Smile
Back to top
View user's profile Send private message
misi01
Advanced


Joined: 02 Dec 2002
Posts: 629
Topics: 176
Location: Stockholm, Sweden

PostPosted: Mon Sep 01, 2014 6:43 am    Post subject: the joke of it all here at work is.... Reply with quote

Most programmers follow the "I write in uc because everyone else does and that's the standard" (the standard being to go baaaaaa and follow other sheep). At the same time we have a naming convention that uc's the first letter of any "word" but has the others characters in lc. For example, a field called Effective Date becomes EffDat. Now, how's that for consistency ????
_________________
Michael
Back to top
View user's profile Send private message Send e-mail
t-bonham@scc.net
Supermod


Joined: 18 Oct 2012
Posts: 30
Topics: 0
Location: Minneapolis, MN

PostPosted: Mon Sep 01, 2014 5:42 pm    Post subject: Reply with quote

William Collins wrote:
This means that if I'd defined a data-name as:

Code:
01  cobol PIC X.


Then the definition would actually refer to COBOL , as would all the above references I typed.
Actually, I think that would cause an error message -- "cobol" is a reserved word.
Back to top
View user's profile Send private message Send e-mail AIM Address
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Sep 02, 2014 1:36 am    Post subject: Reply with quote

I thought that too, until I tried it Smile

I'm pretty much 100% certain it was reserved with older compilers, but then maybe it wasn't, maybe just an urban myth...
Back to top
View user's profile Send private message
William Collins
Supermod


Joined: 03 Jun 2012
Posts: 437
Topics: 0

PostPosted: Tue Sep 02, 2014 5:02 am    Post subject: Reply with quote

Seems it was "reserved", and even is reserved. However, using it as a data-name is entirely unproblematic for some reason. According to the Enterprise COBOL Language Reference, should get an S message.

I can find a "defined by American National Standard COBOL but not used by this compiler" for a very old COBOL.

So, it is reserved, but its use does not cause a diagnostic message. A "feature" I guess, and no come-back with IBM if you use it and hen a future release does as well.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Sep 02, 2014 10:44 am    Post subject: Re: the joke of it all here at work is.... Reply with quote

misi01 wrote:
Most programmers follow the "I write in uc because everyone else does and that's the standard" (the standard being to go baaaaaa and follow other sheep). At the same time we have a naming convention that uc's the first letter of any "word" but has the others characters in lc. For example, a field called Effective Date becomes EffDat. Now, how's that for consistency ????


misi01,

I don't think it is herd mentality that caused everyone to code in upper case. To date JCL only supports Upper case, So having everything in upper case is like a standard that works every where. Having mixed case is good for reading but for coding it doesn't seem to fit especially with capitalizing the first alphabet in a sentence/word.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group