Code Comments
Programming Forum and web based access to our favorite programming groups.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 []).
Post Follow-up to this messageHmm, 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 []).
Post Follow-up to this messageThank 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 th
e
> general format.
>
> 5.1.2 Optional words
> Optional words are reserved words or context-sensitive words. They are sho
wn
> 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 []).
>
>
>
Post Follow-up to this messageJamesm 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."
Post Follow-up to this messagePowered by vBulletin
Copyright 2000-2006 Jelsoft Enterprises Limited.