Home > Archive > Cobol > December 2006 > Looking for sample code
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Looking for sample code
|
|
|
| Hi,
we are looking for a mid-size COBOL application with extensive
documentation inside. Could someone provide us with such sample code?
Thanks,
Inbal
| |
| P. Raulerson 2006-12-11, 6:57 pm |
| Sure! How much are willing to pay for this application? Remember, source
licenses are usually a little more expensive than OCO licenses.
-Paul
(Isn't it nice when people post job postings like this on the group? <grin> )
"Inbal" <ronen.inbal@gmail.com> wrote in message
news:1165758164.202565.45800@n67g2000cwd.googlegroups.com...
> Hi,
>
> we are looking for a mid-size COBOL application with extensive
> documentation inside. Could someone provide us with such sample code?
>
> Thanks,
> Inbal
>
| |
|
| Inbal wrote:
> Hi,
>
> we are looking for a mid-size COBOL application with extensive
> documentation inside. Could someone provide us with such sample code?
Here's a sample with lots of documentation. I'd be surprised if you get
what you're looking for by asking like that, though - if you tell us
more about what you're looking for, we may be able to help you. Are you
prototyping, looking for free training, curious about what COBOL can do,
or something else?
--8<--
identification division.
program-id. coboltest.
data division.
working-storage section.
*> This is the source for our friendly greeting
01 sSource value "HELLO WORLD".
12 sSourceChar occurs 11 times
indexed by iSourceIdx
pic x.
*> This is where we'll build our salutation
01 sDisplayHello value spaces.
12 sDispChar occurs 11 times
indexed by iDispIdx
pic x.
*> This is how many MOVE statements it took for us to do it
77 iMoveCounter pic 9(02) value zero.
procedure division.
sayHello.
*> Move characters from the source to the build area
perform varying iSourceIdx from 1 by 1
until iSourceIdx > 11
*> Sync the output index with the input
set iDispIdx to iSourceIdx
*> Move the character
move sSourceChar (iSourceIdx) to sDispChar (iDispIdx)
*> Increment the move counter
add 1 to iMoveCounter
*> Here ends the loop
end-perform
*> Display a salutation to this terrestrial ball....
display sDisplayHello
*> Let the user know how much work this was
display "(and it only took " iMoveCounter " moves!)"
*> Make a blank line come out on the screen
display " "
*> Now let's have some fun with it....
display function reverse (sDisplayHello) " | " sDisplayHello
display "It's like looking in a mirror!"
*> Apologize for wasting the user's time
display " "
display "Sorry for wasting your time..."
display " have a swell day!"
*> Enough of this nonsense
stop run
| |
| HeyBub 2006-12-13, 4:05 pm |
| Inbal wrote:
> Hi,
>
> we are looking for a mid-size COBOL application with extensive
> documentation inside. Could someone provide us with such sample code?
>
Virtually any text book on COBOL is chock-a-block full of examples.
| |
| P. Raulerson 2006-12-13, 4:05 pm |
| LOL! I'm filing the serial numbers off that one and putting in my notebook
to use on the next appropriate occasion!! :) :)
Very very !!
-Paul
"LX-i" <lxi0007@netscape.net> wrote in message
news:9f7a8$457c810a$454920f8$32723@KNOLO
GY.NET...
> Inbal wrote:
>
> Here's a sample with lots of documentation. I'd be surprised if you get
> what you're looking for by asking like that, though - if you tell us more
> about what you're looking for, we may be able to help you. Are you
> prototyping, looking for free training, curious about what COBOL can do,
> or something else?
>
> --8<--
>
> identification division.
> program-id. coboltest.
>
> data division.
> working-storage section.
>
> *> This is the source for our friendly greeting
> 01 sSource value "HELLO WORLD".
> 12 sSourceChar occurs 11 times
> indexed by iSourceIdx
> pic x.
>
> *> This is where we'll build our salutation
> 01 sDisplayHello value spaces.
> 12 sDispChar occurs 11 times
> indexed by iDispIdx
> pic x.
>
> *> This is how many MOVE statements it took for us to do it
> 77 iMoveCounter pic 9(02) value zero.
>
> procedure division.
>
> sayHello.
> *> Move characters from the source to the build area
> perform varying iSourceIdx from 1 by 1
> until iSourceIdx > 11
> *> Sync the output index with the input
> set iDispIdx to iSourceIdx
> *> Move the character
> move sSourceChar (iSourceIdx) to sDispChar (iDispIdx)
> *> Increment the move counter
> add 1 to iMoveCounter
> *> Here ends the loop
> end-perform
>
> *> Display a salutation to this terrestrial ball....
> display sDisplayHello
>
> *> Let the user know how much work this was
> display "(and it only took " iMoveCounter " moves!)"
>
> *> Make a blank line come out on the screen
> display " "
>
> *> Now let's have some fun with it....
> display function reverse (sDisplayHello) " | " sDisplayHello
> display "It's like looking in a mirror!"
>
> *> Apologize for wasting the user's time
> display " "
> display "Sorry for wasting your time..."
> display " have a swell day!"
>
> *> Enough of this nonsense
> stop run
> .
>
> -->8--
>
> And the output...
>
> HELLO WORLD
> (and it only took 11 moves!)
>
> DLROW OLLEH | HELLO WORLD
> It's like looking in a mirror!
>
> Sorry for wasting your time...
> have a swell day!
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
> ~ / \ / ~ Live from Montgomery, AL! ~
> ~ / \/ o ~ ~
> ~ / /\ - | ~ daniel@thebelowdomain ~
> ~ _____ / \ | ~ http://www.djs-consulting.com ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
> ~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
> ~ h---- r+++ z++++ ~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
>
> "Who is more irrational? A man who believes in a God he doesn't see, or a
> man who's offended by a God he doesn't believe in?" - Brad Stine
| |
|
| P. Raulerson wrote:
> LOL! I'm filing the serial numbers off that one and putting in my notebook
> to use on the next appropriate occasion!! :) :)
Glad you enjoyed it. It's open-source, so feel free to redistribute and
modify at your amusemen...er, convenience.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
| Oliver Wong 2006-12-13, 4:05 pm |
|
"LX-i" <lxi0007@netscape.net> wrote in message
news:9f7a8$457c810a$454920f8$32723@KNOLO
GY.NET...
> Inbal wrote:
>
> Here's a sample with lots of documentation. I'd be surprised if you get
> what you're looking for by asking like that, though - if you tell us more
> about what you're looking for, we may be able to help you. Are you
> prototyping, looking for free training, curious about what COBOL can do,
> or something else?
Perhaps they have a COBOL source code analysis tool and they want to
test it on a "real world" project. I'm in a similar situation, except that
my company already has a contract with some insurance company, and so I've
got access to their proprietary (i.e. I can't share it with anyone else)
COBOL code to play with.
- Oliver
| |
|
| Oliver Wong wrote:
> "LX-i" <lxi0007@netscape.net> wrote in message
> news:9f7a8$457c810a$454920f8$32723@KNOLO
GY.NET...
>
> Perhaps they have a COBOL source code analysis tool and they want to
> test it on a "real world" project. I'm in a similar situation, except that
> my company already has a contract with some insurance company, and so I've
> got access to their proprietary (i.e. I can't share it with anyone else)
> COBOL code to play with.
That makes sense - but, without sharing their needs, folks here won't
know if they can help them or not, and whether it will be free or not... :)
I wonder what an analysis tool would do with my little program. Can
computers laugh?
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
|
| Hi,
yes we indeed need it to test an anlysis tool that we developed. And
therefore we need a real application.
Thanks,
Inbal
On Dec 10, 3:42 pm, "Inbal" <ronen.in...@gmail.com> wrote:
> Hi,
>
> we are looking for a mid-size COBOL application with extensive
> documentation inside. Could someone provide us with such sample code?
>
> Thanks,
> Inbal
| |
| Pete Dashwood 2006-12-13, 4:05 pm |
|
"Inbal" <ronen.inbal@gmail.com> wrote in message
news:1165915041.581714.71730@79g2000cws.googlegroups.com...
> Hi,
>
> yes we indeed need it to test an anlysis tool that we developed. And
> therefore we need a real application.
>
> Thanks,
> Inbal
>
> On Dec 10, 3:42 pm, "Inbal" <ronen.in...@gmail.com> wrote:
>
Sorry, but I have to ask this...
Why didn't you obtain a reasonably sized sample of how people document COBOL
BEFORE designing a tool to "anlysis" this...?
Couldn't it have some bearing on the design of the tool?
I dunno... maybe it's me...
Pete.
| |
| Howard Brazee 2006-12-13, 4:06 pm |
| On Tue, 12 Dec 2006 23:18:21 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>Sorry, but I have to ask this...
Don't be sorry.
>Why didn't you obtain a reasonably sized sample of how people document COBOL
>BEFORE designing a tool to "anlysis" this...?
>
>Couldn't it have some bearing on the design of the tool?
>
>I dunno... maybe it's me...
No.
CoBOL is pretty much self-documenting. The type of documentation I
like to see is:
*** The following code is to implement what Joe Accountant wrote in
memo A-110.
*** This field was modified to match the 2005 update to My Dunning
Company's security needs.
*** This checksum uses the Mistletoe algorithm
*** Yes, I meant this - we need to remove all spaces except for two
at the end.
*** Denver no longer uses this program - it uses SIPR1234 instead to
do this function. If you change this program, please check to see
if that program needs changing as well.
*** Tests done in June of 2000 showed that an area sweep was faster
for Boulder campus, but a set search was faster for Health Science.
| |
| Alistair 2006-12-13, 4:06 pm |
|
Pete Dashwood wrote:
> "Inbal" <ronen.inbal@gmail.com> wrote in message
> news:1165915041.581714.71730@79g2000cws.googlegroups.com...
> Sorry, but I have to ask this...
>
> Why didn't you obtain a reasonably sized sample of how people document COBOL
> BEFORE designing a tool to "anlysis" this...?
>
> Couldn't it have some bearing on the design of the tool?
>
> I dunno... maybe it's me...
>
Shades of Doc Dwarf. Seeing as the old man is fast approaching his
expire-by-date, do you have designs upon asuming his mantle?
| |
| Pete Dashwood 2006-12-13, 4:06 pm |
|
"Alistair" <alistair@ld50macca.demon.co.uk> wrote in message
news:1165946730.204209.327660@80g2000cwy.googlegroups.com...
>
> Pete Dashwood wrote:
>
> Shades of Doc Dwarf. Seeing as the old man is fast approaching his
> expire-by-date, do you have designs upon asuming his mantle?
>
Treason!
I would never presume...
Besides, hopefully, the Doc will be posting here for a long time to come.
And, as an aside, Alistair, the Doc does not have a monopoly on being right.
Sometimes his view and mine may just coincide... sometimes they won't.
Pete.
| |
| Pete Dashwood 2006-12-13, 4:06 pm |
|
"Howard Brazee" <howard@brazee.net> wrote in message
news:pejtn2tuh3gtplobvnvtkjfrft7aelch0u@
4ax.com...
> On Tue, 12 Dec 2006 23:18:21 +1300, "Pete Dashwood"
> <dashwood@removethis.enternet.co.nz> wrote:
>
>
> Don't be sorry.
>
>
> No.
>
> CoBOL is pretty much self-documenting. The type of documentation I
> like to see is:
>
> *** The following code is to implement what Joe Accountant wrote in
> memo A-110.
>
> *** This field was modified to match the 2005 update to My Dunning
> Company's security needs.
>
> *** This checksum uses the Mistletoe algorithm
>
> *** Yes, I meant this - we need to remove all spaces except for two
> at the end.
>
> *** Denver no longer uses this program - it uses SIPR1234 instead to
> do this function. If you change this program, please check to see
> if that program needs changing as well.
>
> *** Tests done in June of 2000 showed that an area sweep was faster
> for Boulder campus, but a set search was faster for Health Science.
Being of the "old school" I have always made it a habit to write modular
(SECTIONed) code and start each section with a brief description of what it
is trying to achieve.
I would also agree with the use of in-line comments as described above.
It is my opinion that COBOL code should be clearly and consistently
formatted. I have found this to be helpful when reading it in the past, so,
for example, with a complex PERFORM, I don't put them on one line but rather
like:
perform
varying something
from initialValue
by increment
until condition
after somethingElse
from anotherInitialValue
by anotherIncrement
until anotherCondition
... etc
end-perfom
As a result, my code ends up as "blocks" delimited by scope delimiters, as
the Lords of COBOL (shades of Battlestar Galactica!) intended.
However, recently I became irritated when it was necessary to cut some code
and "relocate" it to the right because new conditions had been added that
required further indentation.
The Fujitsu IDE that I use for COBOL has a "box edit" facility that allows
you to select the exact outline of what you want to edit, cut, paste etc so
this would be pretty easy, EXCEPT for the comments (which are tied to
starting in column 7)
Here's the problem...
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
*** here's a comment
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
*** here's another comment
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
I want to move ALL of the above say, six columns to the right...
I have to go back after the move and re-align each comment line back to
column 7.
This is no big deal in the trivial example above, but is tedious when there
are say, 70 lines...
But wait...!!!
We now have the *> comment facility. If I use this, my comments are
"relocatable", just like the rest of my code...
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
*> here's a comment
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
*> here's another comment
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
Hooray!
I have taken to using this form of inline comment, exclusively.
Yet, when it first "came out" I heard people muttering "Why do we need that?
We have perfectly good comment facilities through NOTE and asterisk in
column 7..."
These were people who were using SPF mainly, and who were not in the habit
of moving blocks of code left and right, simply for aesthetics, or even for
clarity...
My point is that sometimes the use for something is not immediately obvious,
and only when we change the way we do things does it become apparent.
Pete.
| |
| P. Raulerson 2006-12-13, 4:06 pm |
| <grin> Pete - stop thinking - you are liable to confuse him! :)
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4u7dvfF16sjdlU1@mid.individual.net...
>
> "Inbal" <ronen.inbal@gmail.com> wrote in message
> news:1165915041.581714.71730@79g2000cws.googlegroups.com...
> Sorry, but I have to ask this...
>
> Why didn't you obtain a reasonably sized sample of how people document
> COBOL BEFORE designing a tool to "anlysis" this...?
>
> Couldn't it have some bearing on the design of the tool?
>
> I dunno... maybe it's me...
>
> Pete.
>
| |
| P. Raulerson 2006-12-13, 4:06 pm |
| LOL! I've heard this sentiment so many times that a new rendition of it is
definitely a surprise. You see, usually I hear it from Mainframers used to
using ISPF to indent and outdent things using >> and << operators. Most
COBOL programmers on the mainframe also have a little macro that does
indent/outdents but ignores comment lines. REXX is a wonderful thing!
-Paul
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4u8qbkF172fj4U1@mid.individual.net...
>
> "Howard Brazee" <howard@brazee.net> wrote in message
> news:pejtn2tuh3gtplobvnvtkjfrft7aelch0u@
4ax.com...
>
> Being of the "old school" I have always made it a habit to write modular
> (SECTIONed) code and start each section with a brief description of what
> it is trying to achieve.
>
> I would also agree with the use of in-line comments as described above.
>
> It is my opinion that COBOL code should be clearly and consistently
> formatted. I have found this to be helpful when reading it in the past,
> so, for example, with a complex PERFORM, I don't put them on one line but
> rather like:
>
> perform
> varying something
> from initialValue
> by increment
> until condition
> after somethingElse
> from anotherInitialValue
> by anotherIncrement
> until anotherCondition
> ... etc
> end-perfom
>
> As a result, my code ends up as "blocks" delimited by scope delimiters, as
> the Lords of COBOL (shades of Battlestar Galactica!) intended.
>
> However, recently I became irritated when it was necessary to cut some
> code and "relocate" it to the right because new conditions had been added
> that required further indentation.
>
> The Fujitsu IDE that I use for COBOL has a "box edit" facility that allows
> you to select the exact outline of what you want to edit, cut, paste etc
> so this would be pretty easy, EXCEPT for the comments (which are tied to
> starting in column 7)
>
> Here's the problem...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *** here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *** here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
> I want to move ALL of the above say, six columns to the right...
>
> I have to go back after the move and re-align each comment line back to
> column 7.
>
> This is no big deal in the trivial example above, but is tedious when
> there are say, 70 lines...
>
> But wait...!!!
>
> We now have the *> comment facility. If I use this, my comments are
> "relocatable", just like the rest of my code...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
> Hooray!
>
> I have taken to using this form of inline comment, exclusively.
>
> Yet, when it first "came out" I heard people muttering "Why do we need
> that? We have perfectly good comment facilities through NOTE and asterisk
> in column 7..."
>
> These were people who were using SPF mainly, and who were not in the habit
> of moving blocks of code left and right, simply for aesthetics, or even
> for clarity...
>
> My point is that sometimes the use for something is not immediately
> obvious, and only when we change the way we do things does it become
> apparent.
>
> Pete.
>
| |
| Arnold Trembley 2006-12-13, 4:06 pm |
|
P. Raulerson wrote:
> LOL! I've heard this sentiment so many times that a new rendition of it is
> definitely a surprise. You see, usually I hear it from Mainframers used to
> using ISPF to indent and outdent things using >> and << operators. Most
> COBOL programmers on the mainframe also have a little macro that does
> indent/outdents but ignores comment lines. REXX is a wonderful thing!
>
> -Paul
When I need to shift code left or right in ISPF, I use (( and )) line
commands instead of << and >>. I've forgotten what the difference is,
but I think there is one.
The style I am most used to is paragraphs only, with a "flower box" of
comments at the beginning. If there are inline comments, they're
flower-boxed too. So I haven't run into any real problems shifting
code left or right with comments.
A bigger irritation for me is a logic structure indented so many times
that I run out of room on the right...
--
http://arnold.trembley.home.att.net/
| |
| Clark F Morris 2006-12-13, 4:06 pm |
| On Wed, 13 Dec 2006 11:55:45 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>
>"Howard Brazee" <howard@brazee.net> wrote in message
> news:pejtn2tuh3gtplobvnvtkjfrft7aelch0u@
4ax.com...
>
>Being of the "old school" I have always made it a habit to write modular
>(SECTIONed) code and start each section with a brief description of what it
>is trying to achieve.
>
>I would also agree with the use of in-line comments as described above.
>
>It is my opinion that COBOL code should be clearly and consistently
>formatted. I have found this to be helpful when reading it in the past, so,
>for example, with a complex PERFORM, I don't put them on one line but rather
>like:
>
> perform
> varying something
> from initialValue
> by increment
> until condition
> after somethingElse
> from anotherInitialValue
> by anotherIncrement
> until anotherCondition
> ... etc
> end-perfom
>
>As a result, my code ends up as "blocks" delimited by scope delimiters, as
>the Lords of COBOL (shades of Battlestar Galactica!) intended.
>
>However, recently I became irritated when it was necessary to cut some code
>and "relocate" it to the right because new conditions had been added that
>required further indentation.
>
>The Fujitsu IDE that I use for COBOL has a "box edit" facility that allows
>you to select the exact outline of what you want to edit, cut, paste etc so
>this would be pretty easy, EXCEPT for the comments (which are tied to
>starting in column 7)
>
>Here's the problem...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>*** here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>*** here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
>I want to move ALL of the above say, six columns to the right...
>
>I have to go back after the move and re-align each comment line back to
>column 7.
>
>This is no big deal in the trivial example above, but is tedious when there
>are say, 70 lines...
>
>But wait...!!!
>
>We now have the *> comment facility. If I use this, my comments are
>"relocatable", just like the rest of my code...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
>Hooray!
>
>I have taken to using this form of inline comment, exclusively.
>
>Yet, when it first "came out" I heard people muttering "Why do we need that?
>We have perfectly good comment facilities through NOTE and asterisk in
>column 7..."
>
>These were people who were using SPF mainly, and who were not in the habit
>of moving blocks of code left and right, simply for aesthetics, or even for
>clarity...
The use of SPF and lack of moving blocks left or right are not
related. The shifting abilities are quite good and I have used them
since the early 1980's. It was the only way to keep IF statements
readable. You could even bound it by columns.
>
>My point is that sometimes the use for something is not immediately obvious,
>and only when we change the way we do things does it become apparent.
>
>Pete.
>
| |
| Howard Brazee 2006-12-13, 4:06 pm |
| On Tue, 12 Dec 2006 19:13:14 -0600, "P. Raulerson"
<paul.rl@raulersons.com> wrote:
>LOL! I've heard this sentiment so many times that a new rendition of it is
>definitely a surprise. You see, usually I hear it from Mainframers used to
>using ISPF to indent and outdent things using >> and << operators. Most
>COBOL programmers on the mainframe also have a little macro that does
>indent/outdents but ignores comment lines. REXX is a wonderful thing!
">>" works with NUM COBOL - except that the 10 MY-FIELD turns into
10 MY-FIELD, losing the second space after the 10.
Unfortunately, neither my pre-compiler nor my compiler know how to
handle in-line comments such as Mr. Dashwood recommends.
| |
| Howard Brazee 2006-12-13, 4:06 pm |
| On Wed, 13 Dec 2006 03:56:31 GMT, Arnold Trembley
<arnold.trembley@worldnet.att.net> wrote:
>When I need to shift code left or right in ISPF, I use (( and )) line
>commands instead of << and >>. I've forgotten what the difference is,
>but I think there is one.
) - Shift right one or more columns.
( - Shift left one or more columns.
> - Shift data right one or more characters.
< - Shift data left one or more characters.
With NUM COBOL I do the following:[color=darkred]
---1----+----2----+----3----+----4----+----5
002800 05 GETDBKEY-DISPLAY-DBKEY. 002810 ** XXXXXX
002900 10 GETDBKEY-PAGE PIC X(8). 003000 10
GETDBKEY-PAGE-N REDEFINES GETDBKEY-PAGE PIC 9(8). >>4 00 10
GETDBKEY-DASH PIC X(1). 003200 10 GETDBKEY-POS PIC
X(3).
to get:
002700 01 GETDBKEY-RECORD. =COLS>
---1----+----2----+----3----+----4----+----5
002800 05 GETDBKEY-DISPLAY-DBKEY. 002810 ** XXXXXX
002900 10 GETDBKEY-PAGE PIC X(8). 003000 10
GETDBKEY-PAGE-N REDEFINES GETDBKEY-PAGE PIC 9(8).
003100 10 GETDBKEY-DASH PIC X(1). 003200 10
GETDBKEY-POS PIC X(3).
Notice the 10s are now followed by one space instead of by two.[color=darkred]
=COLS>
----+----1----+----2----+----3----+----4----+----5----+----6----+---
0032 05 GETDBKEY-DISPLAY-DBKEY. 000033 **
XXXXXX 000034 10 GETDBKEY-PAGE PIC X(8). 000035
10 GETDBKEY-PAGE-N REDEFINES GETDBKEY-PAGE PIC 9(8).
000036 10 GETDBKEY-DASH PIC X(1). >>4 37
10 GETDBKEY-POS PIC X(3). 000038 10 GETDBKEY-POS-N
REDEFINES GETDBKEY-POS PIC 9(3).
After undoing this change I do an UNNUM and enter the following:
000031 01 GETDBKEY-RECORD. =COLS>
----+----1----+----2----+----3----+----4----+-
000032 05 GETDBKEY-DISPLAY-DBKEY. 000033 **
XXXXXX 000034 10 GETDBKEY-PAGE PIC X(8). 000035
10 GETDBKEY-PAGE-N REDEFINES GETDBKEY-PAGE PIC 9(8).
000036 10 GETDBKEY-DASH PIC X(1). 000037
10 GETDBKEY-POS PIC X(3). 000038 10 GETDBKEY-POS-N
REDEFINES GETDBKEY-POS PIC 9(3).
| |
| Frank Swarbrick 2006-12-13, 9:55 pm |
| Pete Dashwood<dashwood@removethis.enternet.co.nz> 12/12/06 3:55 PM >>>
>
>
>Being of the "old school" I have always made it a habit to write modular
>(SECTIONed) code and start each section with a brief description of what it
>is trying to achieve.
>
>I would also agree with the use of in-line comments as described above.
>
>It is my opinion that COBOL code should be clearly and consistently
>formatted. I have found this to be helpful when reading it in the past, so,
>for example, with a complex PERFORM, I don't put them on one line but
rather
>like:
>
> perform
> varying something
> from initialValue
> by increment
> until condition
> after somethingElse
> from anotherInitialValue
> by anotherIncrement
> until anotherCondition
> ... etc
> end-perfom
>
>As a result, my code ends up as "blocks" delimited by scope delimiters, as
>the Lords of COBOL (shades of Battlestar Galactica!) intended.
For better or for worse I don't think I've ever written a complex perform
statement such as that. And I'm not sure I'd ever want to! :-)
>However, recently I became irritated when it was necessary to cut some code
>and "relocate" it to the right because new conditions had been added that
>required further indentation.
>
>The Fujitsu IDE that I use for COBOL has a "box edit" facility that allows
>you to select the exact outline of what you want to edit, cut, paste etc so
>this would be pretty easy, EXCEPT for the comments (which are tied to
>starting in column 7)
>
>Here's the problem...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>*** here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>*** here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
>I want to move ALL of the above say, six columns to the right...
>
>I have to go back after the move and re-align each comment line back to
>column 7.
>
>This is no big deal in the trivial example above, but is tedious when there
>are say, 70 lines...
Yep, I run in to this all too often.
>But wait...!!!
>
>We now have the *> comment facility. If I use this, my comments are
>"relocatable", just like the rest of my code...
>
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's a comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> *> here's another comment
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
> xxxxxxxxxxxxxxxxxxxxxxxxxxx cobol stuff xxxxxxxxxxxxxxxxxxxxxxxx
>
>Hooray!
>
>I have taken to using this form of inline comment, exclusively.
Oh, if only my COBOL vendor were responsive to implementing such things!
(Does anyone know if IBM Enterprise COBOL supports inline comments? I'm too
lazy to look.)
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
| |
| Frank Swarbrick 2006-12-13, 9:55 pm |
| P. Raulerson<paul.rl@raulersons.com> 12/12/06 6:13 PM >>>
>LOL! I've heard this sentiment so many times that a new rendition of it is
>definitely a surprise. You see, usually I hear it from Mainframers used to
>using ISPF to indent and outdent things using >> and << operators. Most
>COBOL programmers on the mainframe also have a little macro that does
>indent/outdents but ignores comment lines. REXX is a wonderful thing!
>
>-Paul
They do? I guess I'm not in the class of "Most COBOL programmers on the
mainframe".
Of course we don't have REXX available in our editor, either. Nonetheless,
I might be able to use what we do have to do something like this. Never
really thought of it.
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
| |
|
| Arnold Trembley wrote:
> A bigger irritation for me is a logic structure indented so many times
> that I run out of room on the right...
This observation is limited to my experience, and pepper liberally with
my opinion - but I'm going to state it as fact. :) Also, the reasoning
behind the way I feel has more to do with maintenance (i.e., can the
next guy understand what I was doing) than anything else. With that said...
Code indented that much usually can (and should) be broken up into
smaller chunks, or different structures used so that the nesting isn't
so deep. This is yet another reason that indenting is good - it can
tell you when you're getting too complex!
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
|
| Howard Brazee wrote:
> Unfortunately, neither my pre-compiler nor my compiler know how to
> handle in-line comments such as Mr. Dashwood recommends.
I'll bet it does when the "*" starts in column 7... :) I've taken to
doing that in my fixed-format code (basically everything at work), in
case some day we're able to move to free format. At that point, they
could be moved as Mr. Dashwood described.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
| P. Raulerson 2006-12-13, 9:55 pm |
| The indent / outdent is built into ISPF, and I am surprised indeed you don't
have REXX on your image. You can always write a little a little program to
do it (Assembler works well for that) but you might want to take your
sysprogs to lunch and mention REXX.
-Paul
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ubm5eF17sbtuU2@mid.individual.net...
> P. Raulerson<paul.rl@raulersons.com> 12/12/06 6:13 PM >>>
>
>
>
> They do? I guess I'm not in the class of "Most COBOL programmers on the
> mainframe".
>
> Of course we don't have REXX available in our editor, either.
> Nonetheless,
> I might be able to use what we do have to do something like this. Never
> really thought of it.
>
> Frank
>
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
| |
| Howard Brazee 2006-12-14, 6:55 pm |
| On Wed, 13 Dec 2006 18:02:39 -0700, "Frank Swarbrick"
<Frank.Swarbrick@efirstbank.com> wrote:
>
>
>They do? I guess I'm not in the class of "Most COBOL programmers on the
>mainframe".
A lot of people using IBM mainframes don't know Rexx and aren't even
aware of the Rexx library that they have - having to be shown commands
such as ZOOM, SUMMARY, TRACKS, & SHOWPROC.
| |
| Frank Swarbrick 2006-12-14, 6:55 pm |
| Should have clarified. We are a VSE shop. No ISPF. We use something
called CA-Vollie as our editor. It does support ">>" and "<<", but as far
as I know there's no consideration for comment lines.
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
The indent / outdent is built into ISPF, and I am surprised indeed you don't
have REXX on your image. You can always write a little a little program to
do it (Assembler works well for that) but you might want to take your
sysprogs to lunch and mention REXX.
-Paul
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ubm5eF17sbtuU2@mid.individual.net...[color=darkred]
> P. Raulerson<paul.rl@raulersons.com> 12/12/06 6:13 PM >>>
is[color=darkred]
>
to[color=darkred]
>
>
> They do? I guess I'm not in the class of "Most COBOL programmers on the
> mainframe".
>
> Of course we don't have REXX available in our editor, either.
> Nonetheless,
> I might be able to use what we do have to do something like this. Never
> really thought of it.
>
> Frank
>
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
| |
| Pete Dashwood 2006-12-14, 9:55 pm |
|
"Howard Brazee" <howard@brazee.net> wrote in message
news:9980o25u3u6ofhria8b4k1qd5uncfsdldp@
4ax.com...
> On Tue, 12 Dec 2006 19:13:14 -0600, "P. Raulerson"
> <paul.rl@raulersons.com> wrote:
>
>
> ">>" works with NUM COBOL - except that the 10 MY-FIELD turns into
> 10 MY-FIELD, losing the second space after the 10.
>
> Unfortunately, neither my pre-compiler nor my compiler know how to
> handle in-line comments such as Mr. Dashwood recommends.
I have no idea which COBOL standard implemented this (I'm sure Bill Klein
will know...) but it has been in Fujitsu COBOL since version 3, so it is
definitely pre-2000.
What are you uisng, Howard?
Pete.
| |
| Pete Dashwood 2006-12-14, 9:55 pm |
|
"LX-i" <lxi0007@netscape.net> wrote in message
news:7bef9$4580aefc$454920f8$14504@KNOLO
GY.NET...
> Howard Brazee wrote:
>
> I'll bet it does when the "*" starts in column 7... :) I've taken to
> doing that in my fixed-format code (basically everything at work), in case
> some day we're able to move to free format. At that point, they could be
> moved as Mr. Dashwood described.
>
> "Who is more irrational? A man who believes in a God he doesn't see, or a
> man who's offended by a God he doesn't believe in?" - Brad Stine
I think you put your finger on it, Daniel. It works with free-format COBOL.
I can't remember when I gave up worrying about going beyond col 73 or using
identifiers in source books (74-80) or sequence numbers in 1-6. It was fine
(and necessary) when we used punched cards for source decks...
So, you put an asterisk in col 7, then later in the same line put the "real"
comment, preceded by "*>"? :-)
If you move to free format you simply run something to remove all asterisks
from col 7 and you are in business.
I admire your foresight. (And ingenuity...)
Pete.
| |
| Pete Dashwood 2006-12-14, 9:55 pm |
|
"Clark F Morris" <cfmpublic@ns.sympatico.ca> wrote in message
news:3r50o21doi0krn4hci72un9bpe3at28ukb@
4ax.com...
> On Wed, 13 Dec 2006 11:55:45 +1300, "Pete Dashwood"
> <dashwood@removethis.enternet.co.nz> wrote:
<snipped>[color=darkred]
>
> The use of SPF and lack of moving blocks left or right are not
> related. The shifting abilities are quite good and I have used them
> since the early 1980's. It was the only way to keep IF statements
> readable. You could even bound it by columns.
As someone who used SPF for over twenty years and also wrote REXX when it
became available, do you think I am unaware of what the facilities in it
are?
My innocent comment above was not a criticism of SPF or people who use it,
it was simply a statement of fact. The people who commented negatively on
the "new" comment facility were in the group stated above.
Had they not been in that group and were used to writing free-format code,
they may not have made such comment.
Pete.
| |
| Howard Brazee 2006-12-14, 9:55 pm |
| On Fri, 15 Dec 2006 14:41:12 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>
>What are you uisng, Howard?
>
>Pete.
IBM Enterprise COBOL for z/OS 3.4.1
| |
|
| Pete Dashwood wrote:
> "LX-i" <lxi0007@netscape.net> wrote in message
> news:7bef9$4580aefc$454920f8$14504@KNOLO
GY.NET...
>
> I think you put your finger on it, Daniel. It works with free-format COBOL.
>
> I can't remember when I gave up worrying about going beyond col 73 or using
> identifiers in source books (74-80) or sequence numbers in 1-6. It was fine
> (and necessary) when we used punched cards for source decks...
>
> So, you put an asterisk in col 7, then later in the same line put the "real"
> comment, preceded by "*>"? :-)
Nope - * in 7 and > in 8. :) But I'm sure you knew that. Now, a shop
standard we have is to footprint (from 73 onward) changes with the
control number under which they were made. (This is quite handy, as we
can cut-and-paste the number to our CM system, and make sure that our
change doesn't contradict a previous change.) I start those with *> as
well. We use SlickEdit to manipulate our code, and doing this has the
added benefit of making the footprints be colored the same as comments. :)
Yours is certainly a good thought, though... :)
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
| Pete Dashwood 2006-12-14, 9:55 pm |
|
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ublvnF17sbtuU1@mid.individual.net...
> Pete Dashwood<dashwood@removethis.enternet.co.nz> 12/12/06 3:55 PM >>>
>
>
> rather
>
>
> For better or for worse I don't think I've ever written a complex perform
> statement such as that. And I'm not sure I'd ever want to! :-)
Just think "wheels within wheels..." it isn't as difficult as some of the
file manipulation you do every day.
OK... suppose you have a three dimensional array as follows...
01 sales-results.
12 territory occurs 10
indexed by sr-x1.
15 salesman occurs 3
indexed by sr-x2.
18 month-figures pic s9(9)v99 comp occurs 12
indexed by sr-x3.
We wish to know the total sales for the last 12 months, across all
territories and salesmen. (Other variations on this can be easily achieved
by controlling the limits on each level of the following PERFORM...see
below)
move zero to grand-total
perform
varying sr-x1
from 1
by 1
until sr-x1 > 10
after sr-x2
from 1
by 1
until sr-x2 > 3
after sr-x3
from 1
by 1
until sr-x2 > 12
add month-figures (sr-x1, sr-x2, sr-x3) to
grand-total
end-perform
The whole thing can be coded to use variables as initial values and boundary
conditions so you could get all the sales for Bob Balderdash (salesman
number one in the Dreamsville territory) for January through April with
something like...
set sr-x1 to Dreamsville
move Dreamsville to terr-limit
set sr-x2 to Balderdash
move Balderdash to salesman-limit
set sr-x3 to January
move April to month-limit
move zero to grand-total
perform
varying sr-x1
from sr-x1
by 1
until sr-x1 > terr-limit
after sr-x2
from sr-x2
by 1
until sr-x2 > salesman-limit
after sr-x3
from sr-x3
by 1
until sr-x2 > month-limit
add month-figures (sr-x1, sr-x2, sr-x3) to
grand-total
end-perform
Of course you would hide the perform in a performed section and simply set
the parameters to it in your mainline. Note that this is a one size fits all
approach, so minimum code and efficient object code...
Lets get the year's figures for Peter Polishemov, number 2 in the
Dreamsville territory...
MAINLINE
*> get year's figures for Peter Polishemov
set sr-x1 to Dreamsville
move Dreamsville to terr-limit
set sr-x2 to Polishemov
move Polishemov to salesman-limit
set sr-x3 to January
move December to month-limit
perform calc-grand-total
...
SUBROUTINE
*>--------------------------------------------------------------------------------
calc-grand-total section.
cgt000.
*> this code returns a calculated grand total for combinations of
territory,
*> salesman, and month that have been preset before it is activated.
*>
move zero to grand-total
perform
varying sr-x1
from sr-x1
by 1
until sr-x1 > terr-limit
after sr-x2
from sr-x2
by 1
until sr-x2 > salesman-limit
after sr-x3
from sr-x3
by 1
until sr-x2 > month-limit
add month-figures (sr-x1, sr-x2, sr-x3) to
grand-total
end-perform
| |
| Pete Dashwood 2006-12-15, 3:55 am |
|
"LX-i" <lxi0007@netscape.net> wrote in message
news:3ed7e$45820b0f$454920f8$13730@KNOLO
GY.NET...
> Pete Dashwood wrote:
>
> Nope - * in 7 and > in 8. :) But I'm sure you knew that.
No, I have to fess up... I didn't. :-)
There is still a problem with this if you are wanting to move code left, but
NOT from the start of the line. I tried to explain this in my original post
but it wasn't very clear... It happens when you have a "box edit" facility
that lets you select a "box" of code (MS word has this facilty if you hold
down Alt as you select lines; many people are unaware of it and it is very
useful.)
If you DON'T box edit you very quickly get stuff running off the right hand
edge of the page as couple of people mentioned.
>Now, a shop standard we have is to footprint (from 73 onward) changes with
>the control number under which they were made.
Many places do this. It ties you to fixed format code.
(This is quite handy, as we
> can cut-and-paste the number to our CM system, and make sure that our
> change doesn't contradict a previous change.) I start those with *> as
> well.
That's a good idea...
We use SlickEdit to manipulate our code, and doing this has the
> added benefit of making the footprints be colored the same as comments.
> :)
Cool!
>
> Yours is certainly a good thought, though... :)
It works for me...:-)
Pete.
| |
| Pete Dashwood 2006-12-15, 3:55 am |
|
"Howard Brazee" <howard@brazee.net> wrote in message
news:e414o29gd5pmt7amjvip1damhokh8h1778@
4ax.com...
> On Fri, 15 Dec 2006 14:41:12 +1300, "Pete Dashwood"
> <dashwood@removethis.enternet.co.nz> wrote:
>
>
>
> IBM Enterprise COBOL for z/OS 3.4.1
Is there a compile option for free format maybe? I can't imagine Big Blue
not implementing a standard...
Pete.
| |
| P. Raulerson 2006-12-15, 3:55 am |
| How do they live without 'em? :)
-Paul
"Howard Brazee" <howard@brazee.net> wrote in message
news:fqm2o2lsm6pvi3enr3oaj3jr3vldpgum5c@
4ax.com...
> On Wed, 13 Dec 2006 18:02:39 -0700, "Frank Swarbrick"
> <Frank.Swarbrick@efirstbank.com> wrote:
>
>
> A lot of people using IBM mainframes don't know Rexx and aren't even
> aware of the Rexx library that they have - having to be shown commands
> such as ZOOM, SUMMARY, TRACKS, & SHOWPROC.
| |
| P. Raulerson 2006-12-15, 3:55 am |
| Yeah, what you call 'box edit' we call manipulating columns. ;) It's a
pretty standard feature in z/OS and z/VM mainframe shops. I don't know about
the VSE world. Been around for decades.
Now, the replacement for ISPF and XEDIT is LEXX- which runs on a PC and does
all sorts of wonderful things. Comes with the development clients for
iSeries and zSeries, as well the IBM COBOL compilers. Really really nice.
-Paul
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4ueho5F17bkuoU1@mid.individual.net...
>
> "LX-i" <lxi0007@netscape.net> wrote in message
> news:3ed7e$45820b0f$454920f8$13730@KNOLO
GY.NET...
> No, I have to fess up... I didn't. :-)
>
> There is still a problem with this if you are wanting to move code left,
> but NOT from the start of the line. I tried to explain this in my original
> post but it wasn't very clear... It happens when you have a "box edit"
> facility that lets you select a "box" of code (MS word has this facilty if
> you hold down Alt as you select lines; many people are unaware of it and
> it is very useful.)
>
> If you DON'T box edit you very quickly get stuff running off the right
> hand edge of the page as couple of people mentioned.
>
>
> Many places do this. It ties you to fixed format code.
>
> (This is quite handy, as we
>
> That's a good idea...
>
> We use SlickEdit to manipulate our code, and doing this has the
>
> Cool!
>
>
> It works for me...:-)
>
> Pete.
>
>
| |
| Karl Kiesel 2006-12-15, 3:55 am |
| "Pete Dashwood" <dashwood@removethis.enternet.co.nz> schrieb im Newsbeitrag
news:4uecpoF1813aeU1@mid.individual.net...
>
> "Howard Brazee" <howard@brazee.net> wrote in message
> news:9980o25u3u6ofhria8b4k1qd5uncfsdldp@
4ax.com...
>
> I have no idea which COBOL standard implemented this (I'm sure Bill Klein
> will know...) but it has been in Fujitsu COBOL since version 3, so it is
> definitely pre-2000.
Pete,
in-line comments for *free format* were already specified in the CODASYL
Journal of Development 1984 - then they were delimited by "<<", and later
changed to "*>" (at least in the updates of the 1985 issue); these adopted
into the working draft 1.0 (1995) for the current 2002 standard; in-line
comments for *fixed format* appear (for the 1st time?) in the 1997 committe
draft 1.1 for the current standard
regrads
Karl Kiesel
| |
| HeyBub 2006-12-15, 6:55 pm |
| LX-i wrote:
> Howard Brazee wrote:
>
> I'll bet it does when the "*" starts in column 7... :) I've taken to
> doing that in my fixed-format code (basically everything at work), in
> case some day we're able to move to free format. At that point, they
> could be moved as Mr. Dashwood described.
Instead of an " * " in column 7, some suggest " *> " in col 7+8.
| |
| HeyBub 2006-12-15, 6:55 pm |
| Pete Dashwood wrote:
>
> Just think "wheels within wheels..." it isn't as difficult as some of
> the file manipulation you do every day.
>
> OK... suppose you have a three dimensional array as follows...
>
> 01 sales-results.
> 12 territory occurs 10
> indexed by sr-x1.
> 15 salesman occurs 3
> indexed by sr-x2.
> 18 month-figures pic s9(9)v99 comp occurs 12
> indexed by sr-x3.
>
> We wish to know the total sales for the last 12 months, across all
> territories and salesmen. (Other variations on this can be easily
> achieved by controlling the limits on each level of the following
> PERFORM...see below)
>
> move zero to grand-total
> perform
> varying sr-x1
> from 1
> by 1
> until sr-x1 > 10
> after sr-x2
> from 1
> by 1
> until sr-x2 > 3
> after sr-x3
> from 1
> by 1
> until sr-x2 > 12
> add month-figures (sr-x1, sr-x2,
> sr-x3) to grand-total
> end-perform
>
Alternatively:
01 Filler redefines Sales-Results.
02 Minor-Field occurs 360 pic s9(9)v99.
Perform Varying Indx from 1 by 1 until Indx > 360
Add Minor-Field (Indx) to Tot
End-Perform.
Just a thought....
| |
| Clark F Morris 2006-12-15, 6:55 pm |
| On Fri, 15 Dec 2006 15:00:10 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>
>"Clark F Morris" <cfmpublic@ns.sympatico.ca> wrote in message
> news:3r50o21doi0krn4hci72un9bpe3at28ukb@
4ax.com...
><snipped>
>As someone who used SPF for over twenty years and also wrote REXX when it
>became available, do you think I am unaware of what the facilities in it
>are?
>
>My innocent comment above was not a criticism of SPF or people who use it,
>it was simply a statement of fact. The people who commented negatively on
>the "new" comment facility were in the group stated above.
>
>Had they not been in that group and were used to writing free-format code,
>they may not have made such comment.
Unfortunately we are still stuck with fixed format for z series COBOL.
We are also stuck with 8 character module names and copybook names
except possibly when we are using Unix System Services.
>
>Pete.
>
>
| |
| Clark F Morris 2006-12-15, 6:55 pm |
| On Fri, 15 Dec 2006 16:07:03 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>
>"Howard Brazee" <howard@brazee.net> wrote in message
> news:e414o29gd5pmt7amjvip1damhokh8h1778@
4ax.com...
>
>Is there a compile option for free format maybe? I can't imagine Big Blue
>not implementing a standard...
I can. See a previous response. They have yet to see a business case
for much of the standard despite SHARE requirements submitted by
myself and others that note IBM strategic objectives.
>
>Pete.
>
| |
| Howard Brazee 2006-12-15, 6:55 pm |
| On Fri, 15 Dec 2006 16:07:03 +1300, "Pete Dashwood"
<dashwood@removethis.enternet.co.nz> wrote:
>
>Is there a compile option for free format maybe? I can't imagine Big Blue
>not implementing a standard...
I don't believe so.
I once used VAX CoBOL where we had a choice between having the
standard CoBOL columns or moving everything 6 or 7 columns to the
left, depending on whether the old column 7 was being used. (I
believe when we moved to the left, it also freed up more space on the
right.)
| |
| Frank Swarbrick 2006-12-15, 6:55 pm |
| This LEXX sounds interesting. I tried googling for it but only got stuff
about the Unix lexx application. Do you know where I could find information
on this product?
[color=darkred]
Yeah, what you call 'box edit' we call manipulating columns. ;) It's a
pretty standard feature in z/OS and z/VM mainframe shops. I don't know about
the VSE world. Been around for decades.
Now, the replacement for ISPF and XEDIT is LEXX- which runs on a PC and does
all sorts of wonderful things. Comes with the development clients for
iSeries and zSeries, as well the IBM COBOL compilers. Really really nice.
| |
| Rick Smith 2006-12-15, 6:55 pm |
|
"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:12o5c9fspsnnb04@news.supernews.com...
> Pete Dashwood wrote:
>
> Alternatively:
>
> 01 Filler redefines Sales-Results.
> 02 Minor-Field occurs 360 pic s9(9)v99.
>
> Perform Varying Indx from 1 by 1 until Indx > 360
> Add Minor-Field (Indx) to Tot
> End-Perform.
>
> Just a thought....
Or, as an alternative without redefinition, ...
compute grand-total = function sum
(month-figures (all all all))
| |
| William M. Klein 2006-12-15, 6:55 pm |
| Inline comments "*>" and free form reference format were NOT in the Standard
until 2002. Many compilers supported it earlier. There were also other
"variations" on both before this. (Including Micro Focus allowing an "*" in
column 1 with their pre-02 free form).
I am not certain which vendor(s) (if any) have implemented the new "alphanumeric
literal" continuation, that I think was one of the best things to come in with
the format changes, e.g.
"abc"-
"def"
instead of
"abc"
- "def"
NOTE:
This works differently than "abc" & "def" - literal concatenation that does
NOT treat the literals as a single text word in COPY/REPLACING and REPLACE.
--
Bill Klein
wmklein <at> ix.netcom.com
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4uecpoF1813aeU1@mid.individual.net...
>
> "Howard Brazee" <howard@brazee.net> wrote in message
> news:9980o25u3u6ofhria8b4k1qd5uncfsdldp@
4ax.com...
>
> I have no idea which COBOL standard implemented this (I'm sure Bill Klein will
> know...) but it has been in Fujitsu COBOL since version 3, so it is definitely
> pre-2000.
>
> What are you uisng, Howard?
>
> Pete.
>
| |
| William M. Klein 2006-12-15, 6:55 pm |
| Not only does IBM *not* support free form reference format (along with many
other things from the '02 Standard), many of their users have said they do not
WANT it. (I think ignorance, but you never know).
Many of them still use 80 column wide "character based" editors (ISPF, XEDIT,
etc) on "3270" emulators.
Furthermore, they want 132 character "listings" (whether hard copy or online).
My best guess is that *IF* they actually got used to free form, there are parts
of it they would like. On the other hand, NONE of the IBM COBOL "add-on"
debuggers are prepared for it, so that too would be a problem (Xpediter,
Intertest, etc)
--
Bill Klein
wmklein <at> ix.netcom.com
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4uehqnF16l0hkU1@mid.individual.net...
>
> "Howard Brazee" <howard@brazee.net> wrote in message
> news:e414o29gd5pmt7amjvip1damhokh8h1778@
4ax.com...
>
> Is there a compile option for free format maybe? I can't imagine Big Blue not
> implementing a standard...
>
> Pete.
>
| |
| HeyBub 2006-12-15, 6:55 pm |
| Rick Smith wrote:
> "HeyBub" <heybubNOSPAM@gmail.com> wrote in message
> news:12o5c9fspsnnb04@news.supernews.com...
>
> Or, as an alternative without redefinition, ...
>
> compute grand-total = function sum
> (month-figures (all all all))
Well, that's . More interesting than the night the cat learned to open
the gerbil's cage.
| |
| William M. Klein 2006-12-15, 6:55 pm |
| Just to follow-up on Karl's comment, I was a (the?) strong advocate for saying
that there MUST be a way that the same '02 Standard conforming source code could
be used by both fixed and free form reference format. This is why if you follow
these rules, you can (with an '02 conforming compiler - if one is ever
developed)
1) Only put code between column 8 and the "R-margin" (often column 72 or 80 -
but dependent upon compiler
2) Use "new-style" alphanumeric literal continuation, eg. "abc"- instead of
column 7
3) Use ">>D" for debugging lines (not D in column 7)
4) Use "*>" for comment lines (and inline comments)
5) use >>PAGE instead of "/" in column 7
6) Use hex-literals rather than "unprintable" characters within alphanumeric
literals (There are SLIGHTLY different rules for free and fix format on handling
of unprintable characters)
***
If you follow these rules (especially form copy text), then you will never need
to "worry" about whether you have fixed or free format "turned on".
--
Bill Klein
wmklein <at> ix.netcom.com
"Karl Kiesel" <Karl.Kiesel@fujitsu-siemens.com> wrote in message
news:eltng4$okt$1@nntp.fujitsu-siemens.com...
> "Pete Dashwood" <dashwood@removethis.enternet.co.nz> schrieb im Newsbeitrag
> news:4uecpoF1813aeU1@mid.individual.net...
>
> Pete,
> in-line comments for *free format* were already specified in the CODASYL
> Journal of Development 1984 - then they were delimited by "<<", and later
> changed to "*>" (at least in the updates of the 1985 issue); these adopted
> into the working draft 1.0 (1995) for the current 2002 standard; in-line
> comments for *fixed format* appear (for the 1st time?) in the 1997 committe
> draft 1.1 for the current standard
>
> regrads
> Karl Kiesel
>
| |
| Howard Brazee 2006-12-15, 6:55 pm |
| On Fri, 15 Dec 2006 21:15:20 GMT, "William M. Klein"
<wmklein@nospam.netcom.com> wrote:
>Not only does IBM *not* support free form reference format (along with many
>other things from the '02 Standard), many of their users have said they do not
>WANT it. (I think ignorance, but you never know).
>
>Many of them still use 80 column wide "character based" editors (ISPF, XEDIT,
>etc) on "3270" emulators.
I do, but that can be used with free form.
>Furthermore, they want 132 character "listings" (whether hard copy or online).
I do - and that can also be adapted.
>My best guess is that *IF* they actually got used to free form, there are parts
>of it they would like.
Of course.
>On the other hand, NONE of the IBM COBOL "add-on"
>debuggers are prepared for it, so that too would be a problem (Xpediter,
>Intertest, etc)
I suspect pre-compilers may also have problems.
| |
| Pete Dashwood 2006-12-15, 6:55 pm |
| Thanks for that, Karl.
Despite my overall disappointment and frustration with the standards
process, I realise a lot of people did a lot of good work on it.
Pete.
TOP POST - nothing more below.
"Karl Kiesel" <Karl.Kiesel@fujitsu-siemens.com> wrote in message
news:eltng4$okt$1@nntp.fujitsu-siemens.com...
> "Pete Dashwood" <dashwood@removethis.enternet.co.nz> schrieb im
> Newsbeitrag news:4uecpoF1813aeU1@mid.individual.net...
>
> Pete,
> in-line comments for *free format* were already specified in the CODASYL
> Journal of Development 1984 - then they were delimited by "<<", and later
> changed to "*>" (at least in the updates of the 1985 issue); these adopted
> into the working draft 1.0 (1995) for the current 2002 standard; in-line
> comments for *fixed format* appear (for the 1st time?) in the 1997
> committe draft 1.1 for the current standard
>
> regrads
> Karl Kiesel
>
| |
| Pete Dashwood 2006-12-15, 6:55 pm |
|
"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:12o5c9fspsnnb04@news.supernews.com...
> Pete Dashwood wrote:
>
> Alternatively:
>
> 01 Filler redefines Sales-Results.
> 02 Minor-Field occurs 360 pic s9(9)v99.
>
> Perform Varying Indx from 1 by 1 until Indx > 360
> Add Minor-Field (Indx) to Tot
> End-Perform.
>
> Just a thought....
And a good thought insofar as limiting matrices to as few dimensions as
possible is usually a good thing.
It is a contrived example that was simply designed to underline the point I
was trying to make: There is nothing wrong with using the power of COBOL, if
people are taught to do so, and examples are explained.
I hope you'd agree, Jerry that the single dimensional model is much less
flexible than the example posted. What happens when new territories/salesmen
are added? Suppose we decide to extend to a two-year reporting period? and
so on... It is intuitively easier to extend the appropriate dimension, than
it is to figure out how this affects the single dimensional view.
Pete.
| |
| Pete Dashwood 2006-12-15, 6:55 pm |
|
"Rick Smith" <ricksmith@mfi.net> wrote in message
news:12o5u2iqtmbl4f7@corp.supernews.com...
>
> "HeyBub" <heybubNOSPAM@gmail.com> wrote in message
> news:12o5c9fspsnnb04@news.supernews.com...
>
> Or, as an alternative without redefinition, ...
>
> compute grand-total = function sum
> (month-figures (all all all))
>
Nice one! I like the use of functions.
And the other examples...? OK, we solved the immediate problem; sufficient
unto the morrow the evils thereof... :-)
Pete.
| |
| Pete Dashwood 2006-12-15, 6:55 pm |
| Thanks Bill.
As usual, excellent advice.
I found the free format comment one by experience, but I'll take on board
the other points mentioned also.
Pete.
TOP POST - nothing new below
"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:6tEgh.538691$eS1.249830@fe05.news.easynews.com...
> Just to follow-up on Karl's comment, I was a (the?) strong advocate for
> saying that there MUST be a way that the same '02 Standard conforming
> source code could be used by both fixed and free form reference format.
> This is why if you follow these rules, you can (with an '02 conforming
> compiler - if one is ever developed)
>
> 1) Only put code between column 8 and the "R-margin" (often column 72 or
> 80 - but dependent upon compiler
>
> 2) Use "new-style" alphanumeric literal continuation, eg. "abc"- instead
> of column 7
>
> 3) Use ">>D" for debugging lines (not D in column 7)
>
> 4) Use "*>" for comment lines (and inline comments)
>
> 5) use >>PAGE instead of "/" in column 7
>
> 6) Use hex-literals rather than "unprintable" characters within
> alphanumeric literals (There are SLIGHTLY different rules for free and fix
> format on handling of unprintable characters)
>
> ***
>
> If you follow these rules (especially form copy text), then you will never
> need to "worry" about whether you have fixed or free format "turned on".
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Karl Kiesel" <Karl.Kiesel@fujitsu-siemens.com> wrote in message
> news:eltng4$okt$1@nntp.fujitsu-siemens.com...
>
>
| |
| P. Raulerson 2006-12-15, 6:55 pm |
| Well, I'm not surprised - 'LEXX' is the z/VM version of the IBM LPEX editor,
which is what I meant. I cannot reach any of the IBM websites right now for
some reason - perhaps they are having difficulties at my ISP. However, you
might try a good search for 'IBM LPEX Editor". It is the standard editor
with all WebSphere development clients, on both the z and the i.
-Paul
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ug8qmF17sjsiU2@mid.individual.net...
> This LEXX sounds interesting. I tried googling for it but only got stuff
> about the Unix lexx application. Do you know where I could find
> information
> on this product?
>
> Yeah, what you call 'box edit' we call manipulating columns. ;) It's a
> pretty standard feature in z/OS and z/VM mainframe shops. I don't know
> about
>
> the VSE world. Been around for decades.
>
> Now, the replacement for ISPF and XEDIT is LEXX- which runs on a PC and
> does
>
> all sorts of wonderful things. Comes with the development clients for
> iSeries and zSeries, as well the IBM COBOL compilers. Really really nice.
>
>
| |
| HeyBub 2006-12-15, 6:55 pm |
| Pete Dashwood wrote:
>
> And a good thought insofar as limiting matrices to as few dimensions
> as possible is usually a good thing.
>
> It is a contrived example that was simply designed to underline the
> point I was trying to make: There is nothing wrong with using the
> power of COBOL, if people are taught to do so, and examples are
> explained.
> I hope you'd agree, Jerry that the single dimensional model is much
> less flexible than the example posted. What happens when new
> territories/salesmen are added? Suppose we decide to extend to a
> two-year reporting period? and so on... It is intuitively easier to
> extend the appropriate dimension, than it is to figure out how this
> affects the single dimensional view.
Sure. I'm all for generalization.
How about :
Num-Iterations = Length(Sales-Results) / 11
Perform Varying Indx from 1 by 1 until Indx > Num-Iterations
Add Minor-Field(Indx) to Tot
End-perform.
There we are.
| |
| Frank Swarbrick 2006-12-15, 6:55 pm |
| Looks interesting. I have a very bad feeiling that it would not have any
VSE support.
Ah well,
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
Well, I'm not surprised - 'LEXX' is the z/VM version of the IBM LPEX editor,
which is what I meant. I cannot reach any of the IBM websites right now for
some reason - perhaps they are having difficulties at my ISP. However, you
might try a good search for 'IBM LPEX Editor". It is the standard editor
with all WebSphere development clients, on both the z and the i.
-Paul
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ug8qmF17sjsiU2@mid.individual.net...[color=darkred]
> This LEXX sounds interesting. I tried googling for it but only got stuff
> about the Unix lexx application. Do you know where I could find
> information
> on this product?
>
> Yeah, what you call 'box edit' we call manipulating columns. ;) It's a
> pretty standard feature in z/OS and z/VM mainframe shops. I don't know
> about
>
> the VSE world. Been around for decades.
>
> Now, the replacement for ISPF and XEDIT is LEXX- which runs on a PC and
> does
>
> all sorts of wonderful things. Comes with the development clients for
> iSeries and zSeries, as well the IBM COBOL compilers. Really really
nice.
>
>
| |
| Rick Smith 2006-12-15, 9:55 pm |
|
"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:4ugjl6F18110sU1@mid.individual.net...
>
> "Rick Smith" <ricksmith@mfi.net> wrote in message
> news:12o5u2iqtmbl4f7@corp.supernews.com...
>
> Nice one! I like the use of functions.
>
> And the other examples...? OK, we solved the immediate problem;
sufficient
> unto the morrow the evils thereof... :-)
Perhaps those other examples are best left
as an exercise for the reader. <g>
However, I will provide one not mentioned.
perform varying x from 1 by 1 until x > 12
compute month-total (x) = function sum
(month-figures (all all x))
end-perform
| |
|
| Rick Smith wrote:
> Or, as an alternative without redefinition, ...
>
> compute grand-total = function sum
> (month-figures (all all all))
Thank you for posting this. I looked and couldn't find it, and had a
whole "where is this documented" question typed out. Then, it occurred
to me to check one more place, and I found it. :) I had never seen
"all" used as a subscript before.
It's a shame that my professional association with COBOL has a little
over a month left...
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
| Rick Smith 2006-12-16, 3:55 am |
|
"LX-i" <lxi0007@netscape.net> wrote in message
news:f0a2e$45836c52$454920f8$3284@KNOLOG
Y.NET...
> Rick Smith wrote:
>
> Thank you for posting this.
You're welcome.
> I looked and couldn't find it, and had a
> whole "where is this documented" question typed out. Then, it occurred
> to me to check one more place, and I found it. :) I had never seen
> "all" used as a subscript before.
For those in a similar situation, the discussion of
the ALL subscript should be in the language
reference manual under general information
about intrinsic functions.
> It's a shame that my professional association with COBOL has a little
> over a month left...
Circumstances may change and you may find yourself
programming in COBOL again one day. That may be
either a blessing or a curse! <g>
| |
|
| Rick Smith wrote:
> "LX-i" <lxi0007@netscape.net> wrote in message
> news:f0a2e$45836c52$454920f8$3284@KNOLOG
Y.NET...
>
> You're welcome.
>
>
> For those in a similar situation, the discussion of
> the ALL subscript should be in the language
> reference manual under general information
> about intrinsic functions.
I can vouch for that - that's where I found it! :)
>
> Circumstances may change and you may find yourself
> programming in COBOL again one day. That may be
> either a blessing or a curse! <g>
It wouldn't bother me in the least. Probably my biggest regret about
the past 9 years is that we were never able to get our subroutines (copy
procs/copybooks converted to subprograms, and other subprograms we have)
structured so that we could swap them out without having to rebuild all
programs that use a certain copy member or subprogram.
The facilities exist on our platform (Unisys ClearPath 2200/IX), but I
never could convince the customers that it was worth "one final rebuild"
to make it happen. There was also the time we accidentally compiled
nearly all programs using a prototype I was working on (that failed
horribly). I think that left them apprehensive about that structure.
Who knows - maybe the folks to come after me will be able to make it
happen. It would be good for the system long-term.
--
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
~ / \ / ~ Live from Montgomery, AL! ~
~ / \/ o ~ ~
~ / /\ - | ~ daniel@thebelowdomain ~
~ _____ / \ | ~ http://www.djs-consulting.com ~
~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
~ GEEKCODE 3.12 GCS/IT d s-:+ a C++ L++ E--- W++ N++ o? K- w$ ~
~ !O M-- V PS+ PE++ Y? !PGP t+ 5? X+ R* tv b+ DI++ D+ G- e ~
~ h---- r+++ z++++ ~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
"Who is more irrational? A man who believes in a God he doesn't see, or
a man who's offended by a God he doesn't believe in?" - Brad Stine
| |
| Pete Dashwood 2006-12-16, 6:55 pm |
|
"HeyBub" <heybubNOSPAM@gmail.com> wrote in message
news:12o6a0gei0elmc8@news.supernews.com...
> Pete Dashwood wrote:
>
>
> Sure. I'm all for generalization.
>
> How about :
>
> Num-Iterations = Length(Sales-Results) / 11
>
> Perform Varying Indx from 1 by 1 until Indx > Num-Iterations
> Add Minor-Field(Indx) to Tot
> End-perform.
>
> There we are.
I don't think so...
Can you show me the examples for Bob Balderdash and Peter Polishemov coded
with this technique?
Pete.
>
| |
| P. Raulerson 2006-12-17, 3:55 am |
| Actually, it just might. You probably want to call your IBM Rep and badger
them into doing some research. Don't take the first 'no' they come back with
either. ;)
-Paul
"Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
news:4ugrsiF1812s7U1@mid.individual.net...
> Looks interesting. I have a very bad feeiling that it would not have any
> VSE support.
>
> Ah well,
> Frank
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
>
> Well, I'm not surprised - 'LEXX' is the z/VM version of the IBM LPEX
> editor,
>
> which is what I meant. I cannot reach any of the IBM websites right now
> for
>
> some reason - perhaps they are having difficulties at my ISP. However,
> you
>
> might try a good search for 'IBM LPEX Editor". It is the standard editor
> with all WebSphere development clients, on both the z and the i.
>
> -Paul
>
> "Frank Swarbrick" <Frank.Swarbrick@efirstbank.com> wrote in message
> news:4ug8qmF17sjsiU2@mid.individual.net...
> nice.
>
>
>
>
|
|
|
|
|