• EQUAL TO in COBOL

    From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 15 21:42:04 2017
    From Newsgroup: comp.lang.cobol

    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Bill Gunshannon@1:2320/100 to comp.lang.cobol on Mon May 15 07:18:12 2017
    From Newsgroup: comp.lang.cobol

    On 5/15/2017 5:42 AM, pete dashwood wrote:
    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    While I have never used EQUAL TO that I can remember, I did work
    somewhere once ( a long time ago) where "=" was frowned on (read
    not allowed by local standards) and we used EQUAL. I think it was
    in support of the notion that COBOL was to be read like English
    statements.

    bill

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From docdwarf@1:2320/100 to comp.lang.cobol on Mon May 15 11:47:51 2017
    From Newsgroup: comp.lang.cobol

    In article <enth46F338vU1@mid.individual.net>,
    Bill Gunshannon <bill.gunshannon@gmail.com> wrote:
    On 5/15/2017 5:42 AM, pete dashwood wrote:

    [snip]

    (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    While I have never used EQUAL TO that I can remember, I did work
    somewhere once ( a long time ago) where "=" was frowned on (read
    not allowed by local standards) and we used EQUAL.

    My experience is similar to Mr Gunshannon's. Just as a matter of elegance
    '=' conveys as much information as 'IS EQUAL TO' in ten fewer keystrokes
    but I've worked on sites that had a Do Unnecessary Work phase... they
    usually had a lot of PICTURE IS, too.

    DD

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Vince Coen@1:2320/100 to pete dashwood on Mon May 15 13:56:10 2017
    From Newsgroup: comp.lang.cobol

    Hello pete!

    Monday May 15 2017 10:42, pete dashwood wrote to All:


    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    I don't but have a lot of programs in ACAS written from the 60's onwards
    that do. If I have to do any mods to them I do change it but still lots
    left.

    Same does apply to other long winded variants eg IS EQUAL OR GREATER THAN
    etc.

    End of the day, 'TO' is a noise word if only looking for primary reserved
    words there are others :)

    I bypass them for my tools such as cobxref and in the example you give as
    they are all reserved words I treat the same as I only look for non
    reserved words and where they are in program (e.g., division & section
    etc).


    Vince

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Doc Trins O'Grace@1:2320/100 to comp.lang.cobol on Mon May 15 06:52:12 2017
    From Newsgroup: comp.lang.cobol

    I still come across it regularly. Although I wore a pretty print that takes it out.

    I tend to avoid the superfluous use of comma, too.

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Robert Wessel@1:2320/100 to comp.lang.cobol on Mon May 15 09:49:50 2017
    From Newsgroup: comp.lang.cobol

    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether >something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error >trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to >something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this >would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Rick Smith@1:2320/100 to comp.lang.cobol on Mon May 15 10:09:54 2017
    From Newsgroup: comp.lang.cobol

    On Monday, May 15, 2017 at 5:42:10 AM UTC-4, pete dashwood wrote:

    [snip]

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    From your thread, in February, "Simplifying IFs in COBOL".
    < https://groups.google.com/d/msg/comp.lang.cobol/SjLGh9i5nRs/G7pdZTqlBgAJ > -----
    Pete's exactly-disliked nested-IF:

    IF A EQUAL TO B
    IF A EQUAL TO C
    -----

    [snip]

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Perhaps Mr Woodger?

    I saw a lot of "IS EQUAL TO" in the 70s and I may have
    used it a few times myself, before switching to COBOL
    on PCs.

    There was, until the 90s, a US government FIPS requirement,
    which, at the low level, prohibited the use of ">", "<",
    "=" and "OR" in relational expressions.

    Any programmer who had to code to the low-level FIPS
    requirement would have quickly adapted and, perhaps,
    continued to write code consistent with that requirement.
    In other words, "habituation"!

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Arnold Trembley@1:2320/100 to comp.lang.cobol on Wed May 17 00:09:08 2017
    From Newsgroup: comp.lang.cobol

    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source.

    (snip)
    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and
    we had to wait for several weeks to get the part replaced. In the
    meantime IBM installed a replacement band that had a much more limited character set. As I recall it was missing all of the following signs:
    = > < ( ) + -

    Back in those days we still relied on printed compiler listings for documentation and they were extremely difficult to read without those
    symbols.





    --
    http://www.arnoldtrembley.com/

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Robert Wessel@1:2320/100 to comp.lang.cobol on Wed May 17 00:23:15 2017
    From Newsgroup: comp.lang.cobol

    On Wed, 17 May 2017 00:09:08 -0500, Arnold Trembley
    <arnold.trembley@att.net> wrote:

    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source.

    (snip)
    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and
    we had to wait for several weeks to get the part replaced. In the
    meantime IBM installed a replacement band that had a much more limited >character set. As I recall it was missing all of the following signs:
    = > < ( ) + -


    The relationals were missing on many/most fast trains (all those not
    intended to support programming), and the parenthesis were often
    missing as well (although less commonly than the relationals). The
    plus and minus, OTOH, were on almost all trains, since negative
    amounts are a pretty common thing to print. Which is not to say such
    trains didn't exist, take the 40-character XN* train, for example, but
    then you were limited to the 36 letters and digits, plus comma, period
    dollar and asterisk.


    *And frankly, I never saw one in the wild

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From robin.vowels@1:2320/100 to comp.lang.cobol on Fri May 19 20:23:06 2017
    From Newsgroup: comp.lang.cobol

    On Wednesday, May 17, 2017 at 3:23:20 PM UTC+10, robert...@yahoo.com wrote:
    On Wed, 17 May 2017 00:09:08 -0500, Arnold Trembley
    <arnold.....@att.net> wrote:

    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dash....@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source. >>>
    (snip)
    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference >>> to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and >we had to wait for several weeks to get the part replaced. In the >meantime IBM installed a replacement band that had a much more limited >character set. As I recall it was missing all of the following signs:
    = > < ( ) + -


    The relationals were missing on many/most fast trains (all those not
    intended to support programming), and the parenthesis were often
    missing as well (although less commonly than the relationals). The
    plus and minus, OTOH, were on almost all trains, since negative
    amounts are a pretty common thing to print. Which is not to say such
    trains didn't exist, take the 40-character XN* train, for example, but
    then you were limited to the 36 letters and digits, plus comma, period
    dollar and asterisk.

    Curious, we had the opposite experience, a number of times. When the
    regular print train on the line printer wore out, it was temporarily
    replaced with one that had upper and lower case, with serif characters.
    Of course, it ran a lot slower...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 00:45:03 2017
    From Newsgroup: comp.lang.cobol

    On 15/05/17 11:18 PM, Bill Gunshannon wrote:
    On 5/15/2017 5:42 AM, pete dashwood wrote:
    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether
    something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error
    trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to
    something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    While I have never used EQUAL TO that I can remember, I did work
    somewhere once ( a long time ago) where "=" was frowned on (read
    not allowed by local standards) and we used EQUAL. I think it was
    in support of the notion that COBOL was to be read like English
    statements.

    bill


    Thanks Bill.

    "EQUAL" would not be problematic for me; it's just that word TO...

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 00:52:27 2017
    From Newsgroup: comp.lang.cobol

    On 15/05/17 11:47 PM, docdwarf@panix.com wrote:
    In article <enth46F338vU1@mid.individual.net>,
    Bill Gunshannon <bill.gunshannon@gmail.com> wrote:
    On 5/15/2017 5:42 AM, pete dashwood wrote:

    [snip]

    (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this >>> would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    While I have never used EQUAL TO that I can remember, I did work
    somewhere once ( a long time ago) where "=" was frowned on (read
    not allowed by local standards) and we used EQUAL.

    My experience is similar to Mr Gunshannon's. Just as a matter of elegance '=' conveys as much information as 'IS EQUAL TO' in ten fewer keystrokes
    but I've worked on sites that had a Do Unnecessary Work phase... they
    usually had a lot of PICTURE IS, too.

    DD

    Thanks Doc.

    Funny you should mention the old noise word "IS"...

    The code I mentioned fell over recently when it encountered "IS GLOBAL"
    and "IS EXTERNAL", but works fine for "GLOBAL" and "EXTERNAL". I have
    fixed it.

    I have all the various forms of PICTURE covered. Did you know there was
    a Burroughs compiler that allowed "PC" as an abbreviation for "PICTURE"? Officially, the tool I am writing supports COBOL '85, but nobody seems
    to read that, and there are outraged wails if it stumbles on "PC" for PICTURE... (I have fixed it, but I really should not have...)

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 00:55:18 2017
    From Newsgroup: comp.lang.cobol

    On 16/05/17 12:56 AM, Vince Coen wrote:
    Hello pete!

    Monday May 15 2017 10:42, pete dashwood wrote to All:


    > I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    > to = ?

    I don't but have a lot of programs in ACAS written from the 60's onwards
    that do. If I have to do any mods to them I do change it but still lots
    left.

    Same does apply to other long winded variants eg IS EQUAL OR GREATER THAN etc.

    End of the day, 'TO' is a noise word if only looking for primary reserved words there are others :)

    I bypass them for my tools such as cobxref and in the example you give as they are all reserved words I treat the same as I only look for non
    reserved words and where they are in program (e.g., division & section
    etc).


    Vince


    Thanks Vince.

    I hadn't thought about ACAS or ABAPS but, in the context of this tool
    (which is concerned primarily with Fujitsu PowerCOBOL) they are not
    relevant.

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 00:57:25 2017
    From Newsgroup: comp.lang.cobol

    On 16/05/17 1:52 AM, Doc Trins O'Grace wrote:
    I still come across it regularly. Although I wore a pretty print that takes
    it out.

    I tend to avoid the superfluous use of comma, too.

    :-)

    Thanks.

    (Keep taking the medicine...)

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 00:58:27 2017
    From Newsgroup: comp.lang.cobol

    On 16/05/17 2:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether
    something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error
    trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to
    something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.

    OK,

    Thanks.

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 01:01:00 2017
    From Newsgroup: comp.lang.cobol

    On 17/05/17 5:09 PM, Arnold Trembley wrote:
    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL source.

    (snip) I just wondered if anybody here HABITUALLY uses EQUAL TO in
    preference
    to = ?


    I suspect a main driver was the existence of print trains that didn't
    have some of the special characters. For example, =, <, and > were
    omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and
    we had to wait for several weeks to get the part replaced. In the
    meantime IBM installed a replacement band that had a much more limited character set. As I recall it was missing all of the following signs:
    = > < ( ) + -

    Back in those days we still relied on printed compiler listings for documentation and they were extremely difficult to read without those symbols.





    Thanks for the response. I don't think 1980 print trains are pertinent
    to my code, but they certainly are good background as to why people
    might use the full words rather than the symbols.

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 01:02:26 2017
    From Newsgroup: comp.lang.cobol

    On 17/05/17 5:23 PM, Robert Wessel wrote:
    That being said, I do see it occasionally.

    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and
    we had to wait for several weeks to get the part replaced. In the
    meantime IBM installed a replacement band that had a much more limited
    character set. As I recall it was missing all of the following signs:
    = > < ( ) + -

    The relationals were missing on many/most fast trains (all those not
    intended to support programming), and the parenthesis were often
    missing as well (although less commonly than the relationals). The
    plus and minus, OTOH, were on almost all trains, since negative
    amounts are a pretty common thing to print. Which is not to say such
    trains didn't exist, take the 40-character XN* train, for example, but

    Thanks Robert,

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 01:05:19 2017
    From Newsgroup: comp.lang.cobol

    On 16/05/17 5:09 AM, Rick Smith wrote:
    On Monday, May 15, 2017 at 5:42:10 AM UTC-4, pete dashwood wrote:

    [snip]

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    From your thread, in February, "Simplifying IFs in COBOL".
    < https://groups.google.com/d/msg/comp.lang.cobol/SjLGh9i5nRs/G7pdZTqlBgAJ > -----
    Pete's exactly-disliked nested-IF:

    IF A EQUAL TO B
    IF A EQUAL TO C
    -----

    [snip]

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Perhaps Mr Woodger?

    I saw a lot of "IS EQUAL TO" in the 70s and I may have
    used it a few times myself, before switching to COBOL
    on PCs.

    There was, until the 90s, a US government FIPS requirement,
    which, at the low level, prohibited the use of ">", "<",
    "=" and "OR" in relational expressions.

    Any programmer who had to code to the low-level FIPS
    requirement would have quickly adapted and, perhaps,
    continued to write code consistent with that requirement.
    In other words, "habituation"!

    Thanks Rick.

    I think we have all seen examples of habituation long after it made no
    sense at all... :-)

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Sun May 21 01:14:46 2017
    From Newsgroup: comp.lang.cobol

    On 15/05/17 9:42 PM, pete dashwood wrote:
    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    Many thanks to all who responded.

    It looks like I don't need to worry about it but there is a part of my
    brain that will nag me until I make it "watertight"... :-)

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Clark F Morris@1:2320/100 to comp.lang.cobol on Sat May 20 15:03:22 2017
    From Newsgroup: comp.lang.cobol

    On Sun, 21 May 2017 01:14:46 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    snip
    Many thanks to all who responded.

    It looks like I don't need to worry about it but there is a part of my
    brain that will nag me until I make it "watertight"... :-)

    Is "TO" a noise word in all cases other than the construct ADD A B TO
    C D?

    Clark Morris

    Pete.

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Robert Wessel@1:2320/100 to comp.lang.cobol on Sun May 21 01:01:09 2017
    From Newsgroup: comp.lang.cobol

    On Sat, 20 May 2017 15:03:22 -0300, Clark F Morris
    <cfmpublic@ns.sympatico.ca> wrote:

    On Sun, 21 May 2017 01:14:46 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    snip
    Many thanks to all who responded.

    It looks like I don't need to worry about it but there is a part of my >>brain that will nag me until I make it "watertight"... :-)

    Is "TO" a noise word in all cases other than the construct ADD A B TO
    C D?


    It's not optional in MOVE and SET.

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From docdwarf@1:2320/100 to comp.lang.cobol on Mon May 22 17:38:05 2017
    From Newsgroup: comp.lang.cobol

    In article <eoasgeF6jtgU1@mid.individual.net>,
    pete dashwood <dashwood@enternet.co.nz> wrote:
    On 15/05/17 11:47 PM, docdwarf@panix.com wrote:

    [snip]

    My experience is similar to Mr Gunshannon's. Just as a matter of elegance >> '=' conveys as much information as 'IS EQUAL TO' in ten fewer keystrokes
    but I've worked on sites that had a Do Unnecessary Work phase... they
    usually had a lot of PICTURE IS, too.

    Thanks Doc.

    Funny you should mention the old noise word "IS"...

    'Old noise word' has also been used to describe many sounds I make.

    [snip]

    Did you know there was
    a Burroughs compiler that allowed "PC" as an abbreviation for "PICTURE"?

    Never heard of that one before, Mr Dashwood... and I hope to encounter it, professionaly, even less frequently.

    DD

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From docdwarf@1:2320/100 to comp.lang.cobol on Tue May 23 12:28:28 2017
    From Newsgroup: comp.lang.cobol

    In article <eoat0fF6mdhU1@mid.individual.net>,
    pete dashwood <dashwood@enternet.co.nz> wrote:
    On 17/05/17 5:09 PM, Arnold Trembley wrote:

    [snip]

    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason on
    an IBM Series/1 in the early 1980's. The band broke on our printer, and
    we had to wait for several weeks to get the part replaced. In the
    meantime IBM installed a replacement band that had a much more limited
    character set. As I recall it was missing all of the following signs:
    = > < ( ) + -

    Back in those days we still relied on printed compiler listings for
    documentation and they were extremely difficult to read without those
    symbols.

    Thanks for the response. I don't think 1980 print trains are pertinent
    to my code, but they certainly are good background as to why people
    might use the full words rather than the symbols.

    Have a care, Mr Dashwood... this comes dangerously close to dissemination
    of Anciente Wisdome.

    DD

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From bwtiffin@1:2320/100 to comp.lang.cobol on Tue May 23 18:00:39 2017
    From Newsgroup: comp.lang.cobol

    On Monday, May 15, 2017 at 5:42:10 AM UTC-4, pete dashwood wrote:


    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    Quick count in the GnuCOBOL FAQ

    345 occurrences of ' equal ' (might not be all code sample occurrences)

    41 occurrences of ' equal to ' (probably all code samples and included in the count above)

    17 occurrences of ' is equal to '

    6 ' is not equal to ' of which 4 are ' not equal to '

    Might not be habitual, but not an unheard of development style.

    That compares to 985 ' = ', 83 ' not = ' and 14 ' != ' (mixing C, COBOL and some 30 other language samples in that document).

    Having given out those nerdy stats, I try and cover lots of different coding styles in the FAQ, on purpose, to demonstrate the different options inherently available in COBOL.

    Cheers,
    Brian

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Vince Coen@1:2320/100 to pete dashwood on Wed May 24 11:37:22 2017
    From Newsgroup: comp.lang.cobol

    Hello pete!

    Saturday May 20 2017 14:01, pete dashwood wrote to All:

    On 17/05/17 5:09 PM, Arnold Trembley wrote:
    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL
    source.

    (snip) I just wondered if anybody here HABITUALLY uses EQUAL TO in
    preference to = ?


    I suspect a main driver was the existence of print trains that
    didn't have some of the special characters. For example, =, <, and
    were omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason
    on an IBM Series/1 in the early 1980's. The band broke on our
    printer, and we had to wait for several weeks to get the part
    replaced. In the meantime IBM installed a replacement band that had
    a much more limited character set. As I recall it was missing all
    of the following signs: = > < ( ) + -

    Back in those days we still relied on printed compiler listings for
    documentation and they were extremely difficult to read without
    those symbols.





    Thanks for the response. I don't think 1980 print trains are pertinent
    to my code, but they certainly are good background as to why people
    might use the full words rather than the symbols.


    Must admit I do not recall that as a problem on both ICL and IBM kit.

    May be the sites I worked at, spent extra to get the full char set chains
    but many had more than one printer on a system?


    There again I might be forgetful in this matter.. been a long tome ago :)

    As for a reason not to do it - If the punch card service was slow for my
    needs (Often) I would go and use a spare machine and key them in myself and using the abbreviations was a lot less keying :)

    Same applied if I used the paper tape punch and in both cases for very
    small number of changes it was done on a portable punch and it was not that long ago that I can across my one still sitting in a box in my study. Don't know what happened to the card punch machine but it was a little larger and heavier.

    Going back to the usage of the comma and the end of a sub clause/s - I was NEVER a user of such as it was sometimes very difficult to tel them apart
    on listings and if some errant card punch operator mis-keyed you could
    spend hours/days looking for why the program was not working as expected -
    just because of a period incorrectly typed.

    On the job form that was supplied with the Cobol source forms I used, I do
    seem to recall that mine always had the message that there was NO COMMA'S
    in this program along with the coding style used - (see next para). Just to
    try and make sure they did not mis-key, which was not often at all.

    Oh, and all periods written on forms had a circle around them like wise
    zero or was it 'O' had a slash thru it to signify that it was one and not
    the other.. Think it was the alpha O that did, with the Z having a hypen
    thru and the letter 'I' being fully topped and tailed, but it is a lloonngg time ago:)

    Remember everything was in UPPER CASE.

    Vince

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From Robert Wessel@1:2320/100 to comp.lang.cobol on Wed May 24 15:53:21 2017
    From Newsgroup: comp.lang.cobol

    On Wed, 24 May 2017 11:37:22 +0100, "Vince Coen" <VBCoen@gmail.com>
    wrote:

    Hello pete!

    Saturday May 20 2017 14:01, pete dashwood wrote to All:

    On 17/05/17 5:09 PM, Arnold Trembley wrote:
    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL
    source.

    (snip) I just wondered if anybody here HABITUALLY uses EQUAL TO in
    preference to = ?


    I suspect a main driver was the existence of print trains that
    didn't have some of the special characters. For example, =, <, and
    were omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason
    on an IBM Series/1 in the early 1980's. The band broke on our
    printer, and we had to wait for several weeks to get the part
    replaced. In the meantime IBM installed a replacement band that had
    a much more limited character set. As I recall it was missing all
    of the following signs: = > < ( ) + -

    Back in those days we still relied on printed compiler listings for
    documentation and they were extremely difficult to read without
    those symbols.





    Thanks for the response. I don't think 1980 print trains are pertinent
    to my code, but they certainly are good background as to why people
    might use the full words rather than the symbols.


    Must admit I do not recall that as a problem on both ICL and IBM kit.

    May be the sites I worked at, spent extra to get the full char set chains
    but many had more than one printer on a system?


    Print trains were also usually interchangeable, although operations
    would usually try to batch jobs so that the number of changes was
    minimized. Certainly if a shop had multiple printers you'd often see
    the different trains almost always living in a particular printer,
    except in the much less common case when you really had a lot of extra
    work of one type (*and* the shop had an extra train of the required
    type - I saw a number of shops that had (say) three printers and
    exactly three print trains).

    The advantage of the more constrained trains was that they printed
    fasters. Going from a TN to an AN train would more than double print
    speed on a 1403 - although you lost 2/3rds of the possible printable characters.



    There again I might be forgetful in this matter.. been a long tome ago :)

    As for a reason not to do it - If the punch card service was slow for my >needs (Often) I would go and use a spare machine and key them in myself and >using the abbreviations was a lot less keying :)


    Back in school... There was a room full of keypunches, mostly 029s,
    plus a few 129s and a couple of 026s. The major downside to the 026s
    (other than the somewhat inferior keyboard), was that a number of the
    special characters were *not* on the keyboard (or on the printer for
    the interpretation line). OTOH, the multi-punch sequences for all of
    the interesting characters were taped to the front of the machine, so
    it's not like they were actually hard to enter.

    The 026s almost always sat idle, even if the line of people waiting
    for a free keypunch machine was out the door and down the hall, just
    because most people couldn't deal with the 026s. So I pretty much got
    to use a keypunch machine any time I wanted, with no waiting, and
    could completely ignore the "half hour" rule even when the place was
    busy.

    I also made a few bucks selling people programming cards for the
    keypunch machines (for programming purposes, mostly nothing but some
    tab stops). You'd think people in programming classes would be able
    to figure out how to make an 029 program card. The lab eventually put
    the drums under lock and key because people kept breaking the read
    mechanism by forcing the drum in or out without releasing the locking
    mechanism first (although I managed to lobby them to still have them
    available, you just had to ask whoever was managing the lab, and
    they'd ask if you knew how to mount the drum).

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From acewaysoftware@1:2320/100 to comp.lang.cobol on Wed May 24 19:07:31 2017
    From Newsgroup: comp.lang.cobol

    On Monday, May 15, 2017 at 7:42:10 PM UTC+10, pete dashwood wrote:
    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    --
    I used to write COBOL; now I can do anything...

    Lots of detail conversation going on here. I did a Cobol program that converted
    Cobol code and it became specific to the original code. One parses lines and has to attend to full stops over multiple lines of code.

    My comment is that Cobol compilers do this complex parsing and it gets very complex for every style of expression. It reinforces my view that Cobol is a chameleon language that is highly adaptable to new environments and is under-rated in the modern world.

    Greg

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 29 20:05:00 2017
    From Newsgroup: comp.lang.cobol

    On 24/05/17 10:37 PM, Vince Coen wrote:
    Hello pete!

    Saturday May 20 2017 14:01, pete dashwood wrote to All:

    > On 17/05/17 5:09 PM, Arnold Trembley wrote:
    >> On 5/15/2017 9:49 AM, Robert Wessel wrote:
    >>> On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    >>> <dashwood@enternet.co.nz> wrote:
    >>>
    >>>> I am writing something at the moment that has to process COBOL
    >>>> source.
    >>>>
    >>>> (snip) I just wondered if anybody here HABITUALLY uses EQUAL TO in
    >>>> preference to = ?
    >>>
    >>>
    >>> I suspect a main driver was the existence of print trains that
    >>> didn't have some of the special characters. For example, =, <, and
    >>> > were omitted from many of the fast 1403 trains/chains (AN, HN).
    >>>
    >>> Omission of those characters from keypunch machines was probably an
    >>> issue too.
    >>>
    >>> That being said, I do see it occasionally.
    >>>
    >>
    >> I used to write IS EQUAL TO (or simply EQUALS) for that exact reason
    >> on an IBM Series/1 in the early 1980's. The band broke on our
    >> printer, and we had to wait for several weeks to get the part
    >> replaced. In the meantime IBM installed a replacement band that had
    >> a much more limited character set. As I recall it was missing all
    >> of the following signs: = > < ( ) + -
    >>
    >> Back in those days we still relied on printed compiler listings for
    >> documentation and they were extremely difficult to read without
    >> those symbols.
    >>
    >>
    >>
    >>
    >>
    > Thanks for the response. I don't think 1980 print trains are pertinent
    > to my code, but they certainly are good background as to why people
    > might use the full words rather than the symbols.


    Must admit I do not recall that as a problem on both ICL and IBM kit.

    May be the sites I worked at, spent extra to get the full char set chains
    but many had more than one printer on a system?


    There again I might be forgetful in this matter.. been a long tome ago :)

    As for a reason not to do it - If the punch card service was slow for my needs (Often) I would go and use a spare machine and key them in myself and using the abbreviations was a lot less keying :)

    Same applied if I used the paper tape punch and in both cases for very
    small number of changes it was done on a portable punch and it was not that long ago that I can across my one still sitting in a box in my study. Don't know what happened to the card punch machine but it was a little larger and heavier.

    Going back to the usage of the comma and the end of a sub clause/s - I was NEVER a user of such as it was sometimes very difficult to tel them apart
    on listings and if some errant card punch operator mis-keyed you could
    spend hours/days looking for why the program was not working as expected - just because of a period incorrectly typed.

    On the job form that was supplied with the Cobol source forms I used, I do seem to recall that mine always had the message that there was NO COMMA'S
    in this program along with the coding style used - (see next para). Just to try and make sure they did not mis-key, which was not often at all.

    Oh, and all periods written on forms had a circle around them like wise
    zero or was it 'O' had a slash thru it to signify that it was one and not
    the other.. Think it was the alpha O that did, with the Z having a hypen
    thru and the letter 'I' being fully topped and tailed, but it is a lloonngg time ago:)

    Remember everything was in UPPER CASE.

    Vince


    Thanks for the memories, Vince. Although it was, as you say, a long
    time ago, I need to deal with this today. The code is now written and is working but I KNOW that if it encounters "EQUAL TO" it will fail...

    At the moment I have too many other things to worry about, but once the pressure is off I know it will just be a matter of time before I break
    and rewrite it to handle EQUAL TO... :-)

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 29 20:16:38 2017
    From Newsgroup: comp.lang.cobol

    On 25/05/17 8:53 AM, Robert Wessel wrote:
    On Wed, 24 May 2017 11:37:22 +0100, "Vince Coen" <VBCoen@gmail.com>
    wrote:

    Hello pete!

    Saturday May 20 2017 14:01, pete dashwood wrote to All:

    On 17/05/17 5:09 PM, Arnold Trembley wrote:
    On 5/15/2017 9:49 AM, Robert Wessel wrote:
    On Mon, 15 May 2017 21:42:04 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    I am writing something at the moment that has to process COBOL
    source.

    (snip) I just wondered if anybody here HABITUALLY uses EQUAL TO in >>>>>> preference to = ?


    I suspect a main driver was the existence of print trains that
    didn't have some of the special characters. For example, =, <, and >>>>>> were omitted from many of the fast 1403 trains/chains (AN, HN).

    Omission of those characters from keypunch machines was probably an
    issue too.

    That being said, I do see it occasionally.


    I used to write IS EQUAL TO (or simply EQUALS) for that exact reason
    on an IBM Series/1 in the early 1980's. The band broke on our
    printer, and we had to wait for several weeks to get the part
    replaced. In the meantime IBM installed a replacement band that had
    a much more limited character set. As I recall it was missing all
    of the following signs: = > < ( ) + -

    Back in those days we still relied on printed compiler listings for
    documentation and they were extremely difficult to read without
    those symbols.





    Thanks for the response. I don't think 1980 print trains are pertinent
    to my code, but they certainly are good background as to why people
    might use the full words rather than the symbols.


    Must admit I do not recall that as a problem on both ICL and IBM kit.

    May be the sites I worked at, spent extra to get the full char set chains
    but many had more than one printer on a system?


    Print trains were also usually interchangeable, although operations
    would usually try to batch jobs so that the number of changes was
    minimized. Certainly if a shop had multiple printers you'd often see
    the different trains almost always living in a particular printer,
    except in the much less common case when you really had a lot of extra
    work of one type (*and* the shop had an extra train of the required
    type - I saw a number of shops that had (say) three printers and
    exactly three print trains).

    The advantage of the more constrained trains was that they printed
    fasters. Going from a TN to an AN train would more than double print
    speed on a 1403 - although you lost 2/3rds of the possible printable characters.



    There again I might be forgetful in this matter.. been a long tome ago :)

    As for a reason not to do it - If the punch card service was slow for my
    needs (Often) I would go and use a spare machine and key them in myself and >> using the abbreviations was a lot less keying :)


    Back in school... There was a room full of keypunches, mostly 029s,
    plus a few 129s and a couple of 026s. The major downside to the 026s
    (other than the somewhat inferior keyboard), was that a number of the
    special characters were *not* on the keyboard (or on the printer for
    the interpretation line). OTOH, the multi-punch sequences for all of
    the interesting characters were taped to the front of the machine, so
    it's not like they were actually hard to enter.

    The 026s almost always sat idle, even if the line of people waiting
    for a free keypunch machine was out the door and down the hall, just
    because most people couldn't deal with the 026s. So I pretty much got
    to use a keypunch machine any time I wanted, with no waiting, and
    could completely ignore the "half hour" rule even when the place was
    busy.

    I also made a few bucks selling people programming cards for the
    keypunch machines (for programming purposes, mostly nothing but some
    tab stops). You'd think people in programming classes would be able
    to figure out how to make an 029 program card. The lab eventually put
    the drums under lock and key because people kept breaking the read
    mechanism by forcing the drum in or out without releasing the locking mechanism first (although I managed to lobby them to still have them available, you just had to ask whoever was managing the lab, and
    they'd ask if you knew how to mount the drum).

    Great story, Robert!

    I remember the old 026 and 029 key punch machines although I have to
    confess, in those days, I was a lot more interested in the girls who
    operated them...(Yes, it was before PC and GIRLS punched cards...MEN
    punched the odd amendment by hand, on a hand punch, and became adept at replacing chad with a pencil end when they made mistakes...)

    There was an incident involving me and a punch girl in a lift (elevator,
    for our American readers) during the Xmas party. The lift arrived at the ground and we were re-arranging our clothes as the door opened to reveal
    the Managing Director who was on his way to the party. Girl blushed and
    I stammered a greeting. MD smiled and carried on. Later I found I had
    lipstick all over my face so it was pretty obvious why he was smiling...
    Whenever I see a punch card to this day, it brings back a number of
    happy memories like this... :-)

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 29 20:18:19 2017
    From Newsgroup: comp.lang.cobol

    On 21/05/17 6:03 AM, Clark F Morris wrote:
    On Sun, 21 May 2017 01:14:46 +1200, pete dashwood
    <dashwood@enternet.co.nz> wrote:

    snip
    Many thanks to all who responded.

    It looks like I don't need to worry about it but there is a part of my
    brain that will nag me until I make it "watertight"... :-)

    Is "TO" a noise word in all cases other than the construct ADD A B TO
    C D?

    Clark Morris

    Pete.
    Hell, no.

    TO is a KEYWORD; IS is a noise word...

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 29 20:24:58 2017
    From Newsgroup: comp.lang.cobol

    On 5/24/17 1:00 PM, bwtiffin@gmail.com wrote:
    On Monday, May 15, 2017 at 5:42:10 AM UTC-4, pete dashwood wrote:


    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?


    Quick count in the GnuCOBOL FAQ

    345 occurrences of ' equal ' (might not be all code sample occurrences)

    41 occurrences of ' equal to ' (probably all code samples and included in the
    count above)

    17 occurrences of ' is equal to '

    6 ' is not equal to ' of which 4 are ' not equal to '

    Might not be habitual, but not an unheard of development style.

    That compares to 985 ' = ', 83 ' not = ' and 14 ' != ' (mixing C, COBOL and
    some 30 other language samples in that document).

    Having given out those nerdy stats, I try and cover lots of different coding
    styles in the FAQ, on purpose, to demonstrate the different options inherently available in COBOL.

    Cheers,
    Brian

    Thanks VERY much, Brian.

    Some solid stats are useful to me. 345 compared to 985 makes it pretty definite that I will "fix" this code as soon as I get a chance.

    Cheers,

    Pete.

    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0
  • From pete dashwood@1:2320/100 to comp.lang.cobol on Mon May 29 21:04:27 2017
    From Newsgroup: comp.lang.cobol

    On 5/25/17 2:07 PM, acewaysoftware@gmail.com wrote:
    On Monday, May 15, 2017 at 7:42:10 PM UTC+10, pete dashwood wrote:
    I am writing something at the moment that has to process COBOL source.

    It parses statements across lines into words and then looks at the
    relative positions of Keywords, quotes, and noise to determine whether
    something is of interest to the process going on.

    There's too much to go into here but the above is the gist of it.

    One of the critical factors is the the detection and placement of the
    word "TO" in a given COBOL statement.

    I thought I had this covered but I realized that people can use "EQUAL
    TO" as well as MOVE...TO, SET...TO, CONNECT... TO and GO TO...

    This got me to reminiscing and I could not recall a single instance, in
    50 years of looking at COBOL, where somebody wrote:

    "A EQUAL TO B" or even, "A EQUALS B"

    Everybody seems to use " = ".

    Most people would rather write less than more...

    I'm trying to persuade myself that I don't need to trap it because it
    isn't worth the effort... (the old: "Where do I draw the line at error
    trapping?" conundrum...) I would need to make this a special exception
    and treat it as a special case. That means adding code (complexity) to
    something that is already complex... (Although it ISN'T an error as far
    as COBOL is concerned, I am using the TO for a specific purpose and this
    would be an exception for my code.)

    I just wondered if anybody here HABITUALLY uses EQUAL TO in preference
    to = ?

    Pete.
    --
    I used to write COBOL; now I can do anything...

    Lots of detail conversation going on here. I did a Cobol program that
    converted Cobol code and it became specific to the original code. One parses lines and has to attend to full stops over multiple lines of code.

    My comment is that Cobol compilers do this complex parsing and it gets very
    complex for every style of expression. It reinforces my view that Cobol is a chameleon language that is highly adaptable to new environments and is under-rated in the modern world.

    Greg

    Hi Greg,

    thanks for the post.

    I also wrote a "COBOL language converter" (called "COSSET" - COBOL
    SOURCE STATEMENT EDIT and TRANSLATE) for Control Data Corporation, back
    in the early 1970s, using CDC COBOL on the Cyber series. :-) We used it
    to convert other people's COBOL into CDC COBOL...Mostly, IBM, ICL, and
    some Honeywell. Marketing loved it :-)

    The current effort has to do with Fujitsu PowerCOBOL, so at least there
    is a decent standard (COBOL '85). It isn't just about parsing full stops
    over lines; on PCs there can be tabs and line breaks as well, embedded
    in the code, not to mention the fact that COBOL allows lines to be
    broken on white space. The first step is to identify the scope of the construct being processed (terminated by a full stop, a scope delimiter,
    or the next COBOL verb), in terms of lines, then get everything on those
    lines into an array of strings with a COBOL word in each string. The C#
    SPLIT function does this very well and obligingly removes empty entries
    caused by multiple spaces between words. Then it comes down to
    recognizing keywords, literals, GUI Control names, GUI Attributes,
    things I am interested in, and noise words. After that it gets harder... :-)

    The object is to convert all of the PowerCOBOL scriptlets for a given PowerCOBOL GUI sheet (Form), into a single OO COBOL (Fujitsu NetCOBOL)
    Class, with a Method that equates to each of the scriptlets - (100%
    salvage of the legacy COBOL...), that gets packaged as a COM component
    so it can be used by Standard Windows Forms.

    We end up with Windows Forms and OO COBOL code-behinds that replicate or exceed the original functionality and remove the dependency on
    PowerCOBOL, which seems to have a very bleak future at the moment.

    (Despite the fact that people all over the world are using it, there is
    no support from GTS for it and it has been removed from the product list
    on their web site. There is no official "migration path" or tools
    provided, no chance of running it on 64 bit, and it is reminiscent of
    the Micro Focus Visoc fiasco back in the last century, where an entire
    user base was just shafted by the vendor (Micro Focus today are a much
    better company...))

    Users can continue with OO COBOL or they can use C# or VB.Net, or they
    can mix languages, so they can gradually evolve their existing systems
    without having to do a sudden Migration to a completely new environment.

    But all of this "Brave New World" takes a lot of "Brave Old-fashioned
    Work" and it is keeping me off the streets at the moment. :-)

    Pete.
    --
    I used to write COBOL; now I can do anything...

    SEEN-BY: 154/30 2320/100 0 1 227/0