For Programmers: Free Programming Magazines  


Home > Archive > Cobol > September 2004 > Paragraph name flagged as unknown verb during compilation by MICROFOCUS









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 Paragraph name flagged as unknown verb during compilation by MICROFOCUS
kigs

2004-09-10, 3:55 pm

This problem is driving us crazy. We have embedded SQL in our COBOL
program. When the beginning of the PROCEDURE DIVISION looks like
this:

PROCEDURE DIVISION.
EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.
MAINLINE.

The compiler will complain that MAINLINE is an unknown verb. When we
comment out the EXEC SQL code before the paragraph name, it compiled
fine. When we commented out the paragraph name, it compiled fine.
When we insert any COBOL verb in between the EXEC SQL statement and
MAINLINE paragraph, it compiles fine. Why is the compiler complaining
when the EXEC SQL statement is followed by the MAILINE paragraph? I
tried this in mainframe and it didn't have any problem with it. It's
only with MICROFOCUS. Did anybody encounter this before? Can anybody
here help us with this?

By the way, here's the directive we are using:
CASE
ANS85
VSC2
OSVS
NOTRUNC
DEFFILETYPE"NT"
DEFFILE
OUTDD"$MYDIR\OUT.TXT"
p(cobsql) csqlt=syb c2s verbose end-c -a -m p(cp) sy endp

Can anybody help me?

Thanks.
Russell Styles

2004-09-10, 3:55 pm


"LX-i" <lxi0007@netscape.net> wrote in message
news:G860d.48168$5s3.38133@fe40.usenetserver.com...
> kigs wrote:
>


Aha - another "pointy hair" problem.







> Point him to this newsgroup. As is reiterated here over and over, one
> person's experience doth not universal truth make. :) I was going to
> suggest the same thing, but I saw 4 other people had suggested it already.
>
> (The problem, I'd bet, is in the precompiler; as such, they often are
> unknowledgeable on the finer points of COBOL. Also, though, I'm not
> sure it's standard to omit one paragraph name, then put another in.)
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
> ~ / \ / ~ Live from Montgomery, AL! ~
> ~ / \/ o ~ ~
> ~ / /\ - | ~ LXi0007@Netscape.net ~
> ~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~ I do not read e-mail at the above address ~
> ~ Please see website if you wish to contact me privately ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~ 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++++ ~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
>



Richard

2004-09-11, 8:55 pm

int_21h@yahoo.com (kigs) wrote

> This problem is driving us crazy. We have embedded SQL in our COBOL
> program. When the beginning of the PROCEDURE DIVISION looks like
> this:
>
> PROCEDURE DIVISION.
> EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.
> MAINLINE.
>
> The compiler will complain that MAINLINE is an unknown verb.


What happens if you put a paragraph name before the EXEC ?
Robert Wagner

2004-09-12, 3:55 am

On 8 Sep 2004 19:32:44 -0700, int_21h@yahoo.com (kigs) wrote:

>Thanks for the response guys. But even though putting the paragraph
>name before the EXEC works fine, our PM wants the code to have the
>EXEC SQL WHENEVER... statement first, then the paragraph name. He
>claims that it worked on the other work site, and it should work here
>as well. I know better than to argue.


Try putting a period-space in front of MAINLINE.
Michael Mattias

2004-09-12, 8:55 am

> This problem is driving us crazy. We have embedded SQL in our COBOL
> program. When the beginning of the PROCEDURE DIVISION looks like
> this:
>
> PROCEDURE DIVISION.
> EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.
> MAINLINE.
>
> The compiler will complain that MAINLINE is an unknown verb.


Doesn't the first "thing" after "PROCEDURE DIVISION" need to be a paragraph
name?

When the EXEC SQL is expanded, it's probably a bunch of MOVE and CALL
statements without a paragraph name.....

So try this....

PROCEDURE DIVISION.
MAINLINE.
EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.

... which should result in the same execution path...


MCM



Robert Wagner

2004-09-12, 8:55 am

On 8 Sep 2004 03:16:14 -0700, int_21h@yahoo.com (kigs) wrote:

>This problem is driving us crazy. We have embedded SQL in our COBOL
>program. When the beginning of the PROCEDURE DIVISION looks like
>this:
>
> PROCEDURE DIVISION.
> EXEC SQL WHENEVER SQLWARNING CONTINUE END-EXEC.
> MAINLINE.
>
>The compiler will complain that MAINLINE is an unknown verb. When we
>comment out the EXEC SQL code before the paragraph name, it compiled
>fine. When we commented out the paragraph name, it compiled fine.
>When we insert any COBOL verb in between the EXEC SQL statement and
>MAINLINE paragraph, it compiles fine. Why is the compiler complaining
>when the EXEC SQL statement is followed by the MAILINE paragraph? I
>tried this in mainframe and it didn't have any problem with it. It's
>only with MICROFOCUS. Did anybody encounter this before? Can anybody
>here help us with this?


The culpret is the Pro*Cobol precompiler, not Micro Focus. Looking at
the intermediate .cob file should reveal the answer. I'd first
suspect a missing period or something else on the last line of
generated code.

Although Micro Focus doesn't require a paragraph name after the
procedure division header, Pro*Cobol probably does. Try putting
MAINLINE before the EXEC SQL.
kigs

2004-09-12, 8:55 am

Thanks for the response guys. But even though putting the paragraph
name before the EXEC works fine, our PM wants the code to have the
EXEC SQL WHENEVER... statement first, then the paragraph name. He
claims that it worked on the other work site, and it should work here
as well. I know better than to argue.

I tried registering in microfocus.com but I don't have the our serial
number, and I'm being asked for it.
Ron

2004-09-12, 3:55 pm

int_21h@yahoo.com (kigs) wrote:
>Thanks for the response guys. But even though putting the paragraph
>name before the EXEC works fine, our PM wants the code to have the
>EXEC SQL WHENEVER... statement first, then the paragraph name. He
>claims that it worked on the other work site, and it should work here
>as well. I know better than to argue.


COBOL requires each paragraph to have a name. Permitting an
unnamed paragraph is an IBM extension[1]. If you insist on
writing code that violates standards, you can reasonably expect
to get bitten by occasional problems generated by that approach.

--
Ron
(user ron
in domain spamblocked.com)

[1]
http://publib.boulder.ibm.com/infoc...l.doc/rlext.htm
see the part "Procedure division"
Robert Wagner

2004-09-12, 3:55 pm

On Thu, 09 Sep 2004 08:40:57 -0400, Ron <ron@address.below> wrote:

> COBOL requires each paragraph to have a name. Permitting an
>unnamed paragraph is an IBM extension[1]. If you insist on
>writing code that violates standards, you can reasonably expect
>to get bitten by occasional problems generated by that approach.


The 2002 standard does not require a name on the first paragraph.

William M. Klein

2004-09-12, 3:55 pm

Robert,
To bad you cut out the context of my post - which was:

>
> The 2002 standard does not require a name on the first paragraph.


You'll notice that your comment about the 2002 Standard was in reply to another
comment about "writing code that violates standards"

I'll stand by my response being responsive (in context)

--
Bill Klein
wmklein <at> ix.netcom.com
"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:gvn1k09bt07p7iiv7dblkg07auil06uoik@
4ax.com...
> On Thu, 09 Sep 2004 18:26:10 GMT, "William M. Klein"
> <wmklein@nospam.netcom.com> wrote:
>
>
> The original posting didn't say the compiler was in
> standard-conforming mode. In default mode, which is far more common,
> existing compilers from IBM, Micro Focus and Realia don't require a
> paragraph name after the procedure division header. I didn't try
> Fujitsu. The manual says it is required except in this case:
>
> "In this implementation of COBOL, if all of the procedure division
> statements are sequentially executed or in-line (using the xxx/END-xxx
> structure), the names of sections and paragraphs in the PROCEDURE
> DIVISION may be omitted. "
>
> Realia fails when there are no paragraph names. Putting one at the
> bottom makes it happy.
>



Russell Styles

2004-09-13, 8:55 pm


"LX-i" <lxi0007@netscape.net> wrote in message
news:G860d.48168$5s3.38133@fe40.usenetserver.com...
> kigs wrote:
>


Aha - another "pointy hair" problem.







> Point him to this newsgroup. As is reiterated here over and over, one
> person's experience doth not universal truth make. :) I was going to
> suggest the same thing, but I saw 4 other people had suggested it already.
>
> (The problem, I'd bet, is in the precompiler; as such, they often are
> unknowledgeable on the finer points of COBOL. Also, though, I'm not
> sure it's standard to omit one paragraph name, then put another in.)
>
> --
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
> ~ / \ / ~ Live from Montgomery, AL! ~
> ~ / \/ o ~ ~
> ~ / /\ - | ~ LXi0007@Netscape.net ~
> ~ _____ / \ | ~ http://www.knology.net/~mopsmom/daniel ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~ I do not read e-mail at the above address ~
> ~ Please see website if you wish to contact me privately ~
> ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~ ~
> ~ 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++++ ~
> ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~
>



docdwarf@panix.com

2004-09-14, 3:55 am

In article <dabf410c.0409081832.759e8f1c@posting.google.com>,
kigs <int_21h@yahoo.com> wrote:

[snip]

>He
>claims that it worked on the other work site, and it should work here
>as well.


It may well be, then, that a default setting at this other site is
different than one you are presently using and a simple telephone-call
there will clarify matters.

DD
Michael Mattias

2004-09-14, 8:55 am

"kigs" <int_21h@yahoo.com> wrote in message
news:dabf410c.0409081832.759e8f1c@posting.google.com...
> Thanks for the response guys. But even though putting the paragraph
> name before the EXEC works fine, our PM wants the code to have the
> EXEC SQL WHENEVER... statement first, then the paragraph name. He
> claims that it worked on the other work site, and it should work here
> as well. I know better than to argue.


Maybe my attitude comes from being my own boss for eleven years, but ....

This PM apparently does not have sufficient education to understand that
WHENEVER may be specified multiple times within a program.

So what does he/she suggest would be the proper style/location if the
WHENEVER would need to change somewhere during the program run? Huh?

And, who gives a rat's butt where an "EXEC SQL" appears in the source code
as long as the software works correctly, is relatively efficient, and
maintainable?

Sheesh.

--
Michael Mattias
Tal Systems, Inc.
Racine WI
mmattias@talsystems.com





William M. Klein

2004-09-15, 3:55 am

Unfortunately, there aren't (currently) any compilers that even CLAIM to fully
conform to the 2002 Standard, so the original statement is almost certainly
correct for EXISTING compilers (when running in Standard-conforming mode).

--
Bill Klein
wmklein <at> ix.netcom.com
"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:pms0k01p7e33po2if61isrf0q753sauvni@
4ax.com...
> On Thu, 09 Sep 2004 08:40:57 -0400, Ron <ron@address.below> wrote:
>
>
> The 2002 standard does not require a name on the first paragraph.
>



William M. Klein

2004-09-15, 3:55 pm

Robert,
To bad you cut out the context of my post - which was:

>
> The 2002 standard does not require a name on the first paragraph.


You'll notice that your comment about the 2002 Standard was in reply to another
comment about "writing code that violates standards"

I'll stand by my response being responsive (in context)

--
Bill Klein
wmklein <at> ix.netcom.com
"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:gvn1k09bt07p7iiv7dblkg07auil06uoik@
4ax.com...
> On Thu, 09 Sep 2004 18:26:10 GMT, "William M. Klein"
> <wmklein@nospam.netcom.com> wrote:
>
>
> The original posting didn't say the compiler was in
> standard-conforming mode. In default mode, which is far more common,
> existing compilers from IBM, Micro Focus and Realia don't require a
> paragraph name after the procedure division header. I didn't try
> Fujitsu. The manual says it is required except in this case:
>
> "In this implementation of COBOL, if all of the procedure division
> statements are sequentially executed or in-line (using the xxx/END-xxx
> structure), the names of sections and paragraphs in the PROCEDURE
> DIVISION may be omitted. "
>
> Realia fails when there are no paragraph names. Putting one at the
> bottom makes it happy.
>



Robert Wagner

2004-09-16, 3:56 pm

On Thu, 09 Sep 2004 18:26:10 GMT, "William M. Klein"
<wmklein@nospam.netcom.com> wrote:

>Unfortunately, there aren't (currently) any compilers that even CLAIM to fully
>conform to the 2002 Standard, so the original statement is almost certainly
>correct for EXISTING compilers (when running in Standard-conforming mode).


The original posting didn't say the compiler was in
standard-conforming mode. In default mode, which is far more common,
existing compilers from IBM, Micro Focus and Realia don't require a
paragraph name after the procedure division header. I didn't try
Fujitsu. The manual says it is required except in this case:

"In this implementation of COBOL, if all of the procedure division
statements are sequentially executed or in-line (using the xxx/END-xxx
structure), the names of sections and paragraphs in the PROCEDURE
DIVISION may be omitted. "

Realia fails when there are no paragraph names. Putting one at the
bottom makes it happy.

Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com