Home > Archive > Cobol > February 2007 > Cobol Picture clause and 'IS'
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 |
Cobol Picture clause and 'IS'
|
|
| Jamesm 2007-02-14, 6:55 pm |
| Am I reading the standard correctly that a PICTURE clause must contain
an IS. I have seen it written both ways in production code. But none of
the standards (>=85 I don't have one from before then) list it as
optional (ie not inside an []).
| |
| Frank Swarbrick 2007-02-14, 6:55 pm |
| Hmm, I don't think so. Since it is not underlined it means that it is
optional.
In 13.16.38.1 of ISO/IEC 1989:2002(E) it states
{ PICTURE / PIC} IS character-string
With only PICTURE and PIC being underlined.
5.1.1 Keywords
Keywords are reserved words or context-sensitive words. They are shown in
uppercase and underlined in general
formats. They are required in order to select the functionality associated
with that keyword, subject to the
conventions specified in 5.1.5, Options, and syntax rules specified for the
general format.
5.1.2 Optional words
Optional words are reserved words or context-sensitive words. They are shown
in uppercase and not underlined
in general formats. They may be written to add clarity when the clause or
phrase in which they are defined is
written in the source unit.
Therefore either PICTURE or PIC is required, but IS is optional.
Frank
---
Frank Swarbrick
Senior Developer/Analyst - Mainframe Applications
FirstBank Data Corporation - Lakewood, CO USA
[color=darkred]
Am I reading the standard correctly that a PICTURE clause must contain
an IS. I have seen it written both ways in production code. But none of
the standards (>=85 I don't have one from before then) list it as
optional (ie not inside an []).
| |
| Jamesm 2007-02-14, 6:55 pm |
| Thank you. I should have read section 5 closer. I made the mistake of
thinking only things inside []'s were optional.
Frank Swarbrick wrote:
> Hmm, I don't think so. Since it is not underlined it means that it is
> optional.
>
> In 13.16.38.1 of ISO/IEC 1989:2002(E) it states
>
> { PICTURE / PIC} IS character-string
>
> With only PICTURE and PIC being underlined.
>
> 5.1.1 Keywords
> Keywords are reserved words or context-sensitive words. They are shown in
> uppercase and underlined in general
> formats. They are required in order to select the functionality associated
> with that keyword, subject to the
> conventions specified in 5.1.5, Options, and syntax rules specified for the
> general format.
>
> 5.1.2 Optional words
> Optional words are reserved words or context-sensitive words. They are shown
> in uppercase and not underlined
> in general formats. They may be written to add clarity when the clause or
> phrase in which they are defined is
> written in the source unit.
>
> Therefore either PICTURE or PIC is required, but IS is optional.
>
> Frank
>
> ---
> Frank Swarbrick
> Senior Developer/Analyst - Mainframe Applications
> FirstBank Data Corporation - Lakewood, CO USA
>
> Am I reading the standard correctly that a PICTURE clause must contain
> an IS. I have seen it written both ways in production code. But none of
> the standards (>=85 I don't have one from before then) list it as
> optional (ie not inside an []).
>
>
>
| |
| HeyBub 2007-02-14, 6:55 pm |
| Jamesm wrote:
> Am I reading the standard correctly that a PICTURE clause must contain
> an IS. I have seen it written both ways in production code. But none
> of the standards (>=85 I don't have one from before then) list it as
> optional (ie not inside an []).
In some contexts, it depends on what the definition of "is" is.
In COBOL you can omit the "is'es."
|
|
|
|
|