For Programmers: Free Programming Magazines  


Home > Archive > Cobol > August 2006 > INSPECT question (Bill Klein?)









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 INSPECT question (Bill Klein?)
Roger While

2006-08-11, 6:55 pm

Is an INSPECT allowed on a numeric/numeric-edited field ?
AFAICS in 2002/2008 not. Bill, Is/was it allowed in 85 ?
If not there is a problem with the Cobol85 testsuite, specifically
NC216A.CBL which does exactly this.

Roger


Rick Smith

2006-08-11, 6:55 pm


"Roger While" <simrw@sim-basis.de> wrote in message
news:ebi5jc$jeq$03$1@news.t-online.com...
> Is an INSPECT allowed on a numeric/numeric-edited field ?
> AFAICS in 2002/2008 not. Bill, Is/was it allowed in 85 ?
> If not there is a problem with the Cobol85 testsuite, specifically
> NC216A.CBL which does exactly this.


AFAICS, yes to both. The requirement is usage
display (or national).

This is mentioned in syntax rule 1 everywhere I see it.

Thus

05 my-numeric pic 9(5).

while numeric, is also implicitly usage display and
may be used in an INSPECT statement; such as,

inspect my-numeric replacing "0" by "9".



William M. Klein

2006-08-11, 6:55 pm

I agree. (if anyone cares <G> )

--
Bill Klein
wmklein <at> ix.netcom.com
"Rick Smith" <ricksmith@mfi.net> wrote in message
news:12dpc63fddl9s23@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:ebi5jc$jeq$03$1@news.t-online.com...
>
> AFAICS, yes to both. The requirement is usage
> display (or national).
>
> This is mentioned in syntax rule 1 everywhere I see it.
>
> Thus
>
> 05 my-numeric pic 9(5).
>
> while numeric, is also implicitly usage display and
> may be used in an INSPECT statement; such as,
>
> inspect my-numeric replacing "0" by "9".
>
>
>



Roger While

2006-08-12, 3:55 am

OK. Next question -
If we allow INSPECT FUNCTION ..... TALLYING ....
is there any reason that INSPECT literal TALLYING ....
should not be allowed ?
Before anybody says what use is that, the statement may have
been generated as a result of COPY REPLACING.

Roger

"William M. Klein" <wmklein@nospam.netcom.com> schrieb im Newsbeitrag
news:1n6Dg.286722$1Q1.9879@fe03.news.easynews.com...
>I agree. (if anyone cares <G> )
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com
> "Rick Smith" <ricksmith@mfi.net> wrote in message
> news:12dpc63fddl9s23@corp.supernews.com...
>
>



Rick Smith

2006-08-12, 7:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:ebjsut$rtf$00$1@news.t-online.com...
> OK. Next question -
> If we allow INSPECT FUNCTION ..... TALLYING ....
> is there any reason that INSPECT literal TALLYING ....
> should not be allowed ?
> Before anybody says what use is that, the statement may have
> been generated as a result of COPY REPLACING.


Since the INSPECT statement only refers to identifier
(INSPECT identifier-1 TALLYING ...), allowing
INSPECT literal TALLYING ... would be an extension
to the standard and, therefore, not allowed in conforming
programs.

As to whether INSPECT literal TALLYING ... should not
be allowed as an extension, well ... maybe because it is not
allowed in conforming programs and the following may be
used instead.

From library text,

move :tallying-field: to known-field
inspect known-field tallying ...

and, in source text,

copy ... replacing ==:tallying-field:== by =="some literal"==.

or

copy ... replacing ==:tallying-field:== by ==some-identifier==.



Sponsored Links







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

Copyright 2008 codecomments.com