Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

EXTERNAL clarification
According to 2002/2008 standards :
"The EXTERNAL clause specifies that a data item or a file connector is
external."

Therefore is this legal -
01  WHATEVER.
03  FLD1  PIC .....
03  FLD2  PIC ...  EXTERNAL.

Or should the standard(s) be staing "data record".

Roger



Report this thread to moderator Post Follow-up to this message
Old Post
Roger While
07-15-06 08:55 AM


Re: EXTERNAL clarification
"Roger While" <simrw@sim-basis.de> wrote in message
news:e9a766$3a4$03$1@news.t-online.com...
> According to 2002/2008 standards :
> "The EXTERNAL clause specifies that a data item or a file connector is
> external."
>
> Therefore is this legal -
> 01  WHATEVER.
>        03  FLD1  PIC .....
>        03  FLD2  PIC ...  EXTERNAL.
>
> Or should the standard(s) be staing "data record".

For those who may wish to skp the detailed explanation,
the short answer is: No, to both.

13.16.20 EXTERNAL clause,
"The EXTERNAL clause specifies that a data item or a
file connector is external. The constituent data items and
group data items of an external data record are available
in a run unit to every runtime element that describes the
record as external."

13.16.20.2 [EXTERNAL clause] Syntax rules,
"1) The EXTERNAL clause may be specified only in file
description entries or in record description entries in the
working-storage section."

13.10 Record description entry,
"A record description entry consists of a set of data description
entries, the first of which shall have level-number 1,
that describe the characteristics of a particular record. Any
data item that has been described with level-number 1
is a record."
[Later, 77-level data description entry is described as a case
of record description entry.]

Applying SR 1, the example has a syntax error.

Changing the example to:

01  WHATEVER EXTERNAL.
03  FLD1  PIC ....
03  FLD2  PIC ....

and applying the definition "4.56 data item: A unit of data
defined by a data description entry or resulting from the
evaluation of an identifier." and substituting "WHATEVER"
for "data item" in the first sentence of the introduction; it
may be understood that "The EXTERNAL clause specifies
that WHATEVER ... is external."

The second sentence of the introduction applies to FLD1,
FLD2, etc., as "constituent data items and group data items
of an external data record".

In my opinion, there is insufficient reason, in this case, to
change the standard(s) from "data item" to "data record".




Report this thread to moderator Post Follow-up to this message
Old Post
Rick Smith
07-15-06 12:55 PM


Re: EXTERNAL clarification
Roger While wrote:
> According to 2002/2008 standards :
> "The EXTERNAL clause specifies that a data item or a file connector is
> external."
>
> Therefore is this legal -
> 01  WHATEVER.
>        03  FLD1  PIC .....
>        03  FLD2  PIC ...  EXTERNAL.
>
> Or should the standard(s) be staing "data record".
>
> Roger

I think you will find that what you have quoted is from the lead in to
the EXTERNAL clause (13.16.20), when you look at Syntax Rule 1 (SR1)
you will find that it can only be specified for record and file
descriptions, i.e. must be at the FD or 01 level.  You may have a point
in that the lead-in could also have stated the same thing, though
"lead-in"s are usually intended to give a broad description rather than
details. You could make a suggestion to the  J4 committee to tidy this
up.

Robert


Report this thread to moderator Post Follow-up to this message
Old Post
Robert Jones
07-15-06 12:55 PM


Re: EXTERNAL clarification
Well Rick and Robert, I would beg to differ about the wording in SR1 -
"IN file description entries or IN record description entries".
It does not say "ON".
In my copies of 2002/2008 it is 13.16.21
So either 13.16.21 is ambiguous or 13.16.21.2 (1) is ambiguous
or both.
It is sort of implied by 13.16.21.3 but not explicitely.

Why not simply refer to the 01 level (and 77 for WS).

Roger

"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12bhn8uds3uih19@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:e9a766$3a4$03$1@news.t-online.com... 
>
> For those who may wish to skp the detailed explanation,
> the short answer is: No, to both.
>
> 13.16.20 EXTERNAL clause,
> "The EXTERNAL clause specifies that a data item or a
> file connector is external. The constituent data items and
> group data items of an external data record are available
> in a run unit to every runtime element that describes the
> record as external."
>
> 13.16.20.2 [EXTERNAL clause] Syntax rules,
> "1) The EXTERNAL clause may be specified only in file
> description entries or in record description entries in the
> working-storage section."
>
> 13.10 Record description entry,
> "A record description entry consists of a set of data description
> entries, the first of which shall have level-number 1,
> that describe the characteristics of a particular record. Any
> data item that has been described with level-number 1
> is a record."
> [Later, 77-level data description entry is described as a case
> of record description entry.]
>
> Applying SR 1, the example has a syntax error.
>
> Changing the example to:
>
> 01  WHATEVER EXTERNAL.
>       03  FLD1  PIC ....
>       03  FLD2  PIC ....
>
> and applying the definition "4.56 data item: A unit of data
> defined by a data description entry or resulting from the
> evaluation of an identifier." and substituting "WHATEVER"
> for "data item" in the first sentence of the introduction; it
> may be understood that "The EXTERNAL clause specifies
> that WHATEVER ... is external."
>
> The second sentence of the introduction applies to FLD1,
> FLD2, etc., as "constituent data items and group data items
> of an external data record".
>
> In my opinion, there is insufficient reason, in this case, to
> change the standard(s) from "data item" to "data record".
>
>
>



Report this thread to moderator Post Follow-up to this message
Old Post
Roger While
07-15-06 12:55 PM


Re: EXTERNAL clarification
"Roger While" <simrw@sim-basis.de> wrote in message
news:e9aqs9$tss$00$1@news.t-online.com...
> "Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
> news:12bhn8uds3uih19@corp.supernews.com... 
[snip] 
[snip]
> Well Rick and Robert, I would beg to differ about the wording in SR1 -
> "IN file description entries or IN record description entries".
> It does not say "ON".
> In my copies of 2002/2008 it is 13.16.21
> So either 13.16.21 is ambiguous or 13.16.21.2 (1) is ambiguous
> or both.
> It is sort of implied by 13.16.21.3 but not explicitely.
>
> Why not simply refer to the 01 level (and 77 for WS).

From 13.10, shown above, one could reason that when
an EXTERNAL clause appears "in" data description entries
with level-numbers of 2 - 49, it (the clause) would not be "in"
a record description entry, since "A record description entry
consists of a set of data description entries, the first of which
shall have level-number 1". This would seem to imply that an
EXTERNAL clause could appear only in a data description
entry whose level-number is 1 (or, for other reasons, 77).

Furthermore, it is only the clauses at level-number 1, that
"describe the characteristics of a particular record." The
EXTERNAL clause describes the characteristics of a
record. This too would seem to imply that an EXTERNAL
clause could appear only in a data description entry whose
level-number is 1 (or, for other reasons, 77).

However, implication makes for wonderful guessing games.

The following was adopted from the GLOBAL clause and
modified as a possible substitute for the EXTERNAL clause,
syntax rule 1. Perhaps this would be more to your liking.

1) The EXTERNAL clause may be specified only in the following
entries:
a) A data description entry whose level-number is 1 or 77 that is
specified in the working-storage section.
b) A file description entry.




Report this thread to moderator Post Follow-up to this message
Old Post
Rick Smith
07-15-06 11:55 PM


Re: EXTERNAL clarification
Roger While wrote:
> According to 2002/2008 standards :
> "The EXTERNAL clause specifies that a data item or a file connector is
> external."
>
> Therefore is this legal -
> 01  WHATEVER.
>        03  FLD1  PIC .....
>        03  FLD2  PIC ...  EXTERNAL.
>
> Or should the standard(s) be staing "data record".

No answer to this, other than I agree with the others that EXTERNAL
should be allowed only at the 01 or 77 level.

In a related matter...in your email to me you state "Hmm, looking at
this again, I think the problem then was that not only
can you have EXTERNAL on an FD, you can also have an EXTERNAL
on the following record-description. (Implied when on the FD)."

Is your meaning that you can have EXTERNAL defined on the 01 level for
the record-descriptior of a FILE-SECTION item?  Or are you simply
stating that by making the file-descriptor EXTERNAL then its related
records are implicitly external?  I would agree with the latter, but not
with the former.

Frank

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
07-15-06 11:55 PM


Re: EXTERNAL clarification
"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12bi34hl2ctg0a2@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:e9aqs9$tss$00$1@news.t-online.com... 
> [snip] 
> [snip] 
>
> From 13.10, shown above, one could reason that when
> an EXTERNAL clause appears "in" data description entries
> with level-numbers of 2 - 49, it (the clause) would not be "in"
> a record description entry, since "A record description entry
> consists of a set of data description entries, the first of which
> shall have level-number 1". This would seem to imply that an
> EXTERNAL clause could appear only in a data description
> entry whose level-number is 1 (or, for other reasons, 77).
>
> Furthermore, it is only the clauses at level-number 1, that
> "describe the characteristics of a particular record." The
> EXTERNAL clause describes the characteristics of a
> record. This too would seem to imply that an EXTERNAL
> clause could appear only in a data description entry whose
> level-number is 1 (or, for other reasons, 77).
>
> However, implication makes for wonderful guessing games.
>
> The following was adopted from the GLOBAL clause and
> modified as a possible substitute for the EXTERNAL clause,
> syntax rule 1. Perhaps this would be more to your liking.
>
> 1) The EXTERNAL clause may be specified only in the following
> entries:
> a) A data description entry whose level-number is 1 or 77 that is
>    specified in the working-storage section.
> b) A file description entry.
>
>
Well exactly - What's wrong with that ?.
There is enough of this "lawyer" english that crept into the standards.
If, after 38 years of Cobol and being an Englishman, even I have
difficulty deciphering what is meant in these standards, then there
is something very wrong going on.

Roger



Report this thread to moderator Post Follow-up to this message
Old Post
Roger While
07-15-06 11:55 PM


Re: EXTERNAL clarification
Roger While wrote:
> "Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
> news:12bi34hl2ctg0a2@corp.supernews.com...
> 
>
> Well exactly - What's wrong with that ?.
> There is enough of this "lawyer" english that crept into the standards.
> If, after 38 years of Cobol and being an Englishman, even I have
> difficulty deciphering what is meant in these standards, then there
> is something very wrong going on.
>
> Roger
>
Don't get us going on this one Roger, i.e. 'legalese'. Rick pointed out
that some of Bill's examples didn't work with Micro Focus. Now
*assuming* what Bill showed were three valid options, apart from a brief
introduction, the 'legalese' could have been replaced by Bill's three
examples.

Before he had to quit - recall Chuck Steven's reply to me on this one.
Even though he was the newest to the J4 team, he got taken in hook line
and sinker by the legalese approach. I really would be curious to know
the reaction of vendor developers who actually have to translate the
'legal' definitions into workable compiler code - and not the people who
do/did front for them at J4.

Cor mate. Why can't they write in bleedin' English !

Jimmy

Report this thread to moderator Post Follow-up to this message
Old Post
James J. Gavan
07-15-06 11:55 PM


Re: EXTERNAL clarification
William M. Klein wrote:
> To clarify, the following three "variations" are all valid (and have been 
since
> the '85 Standard).
>
> Fd  This-File External.
> 01 This-Rec  Pic X(100).
>
>    ***
>
> FD  This-File.
> 01  This-Rec Pic X(100) External.
>
>    ***
>
> FD  This-File External.
> 01  This-Rec  Pic X(100) External.
>
>   ***
>
> The differences (and even the usefulness) are minimal, but they do exist.

Hmm, so what are the differences?  And where in the standard do you find
the language that supports the usage of EXTERNAL on an 01 level data
item in the file section?  (Not that I don't believe you.  I just cannot
find it.)

Frank

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
07-15-06 11:55 PM


Re: EXTERNAL clarification
Rick Smith wrote:
> "William M. Klein" <wmklein@nospam.netcom.com> wrote in message
> news:Xq9ug.240001$wA1.57510@fe03.news.easynews.com...
> 
>
> since
> 
>
>
> The last two seem to be invalid for Micro Focus. Only the
> last is shown here.
>
> * Micro Focus COBOL Version 3.2.24   L2.5 revision 000 15-Jul-06 15:31 Pag
e
> 1
> *                                 C:\CBL-CHAL\EXT-FILE.CBL
> * Options: WB EDITOR(MF) LIST() NOOSVS ANS85 NOVSC2 CSI XNIM ENSUITE(2)
> CONFIRM
>      1$set ans85 flag"ans85" flagas"s"
>      2 identification division.
>      3 program-id. ext-file.
>      4 environment division.
>      5 input-output section.
>      6 file-control.
>      7     select in-file assign to "afile.dat".
>      8 data division.
>      9 file section.
>     10 fd in-file external.
>     11 01 in-file-record pic x(80) external.
> * 241-S************************************
> **    Only allowed in WORKING-STORAGE section
>     12 procedure division.
> * 205-S*********
> **    RECORD missing or has zero size
>     13 begin.
>     14     read in-file
>     15       at end
>     16         continue
>     17     end-read
>     18     exit program.
>     19 end program ext-file.
> * Micro Focus COBOL Version 3.2.24   L2.5 revision 000
> * Last message on page: 1
> *
> * Total Messages:     2
> * Unrecoverable :     0                    Severe  :     2
> * Errors        :     0                    Warnings:     0
> * Informational :     0                    Flags   :     0
> * Data:         652     Code:         211

Ditto for COBOL for VSE/ESA 1.1.1:
IGYDS1326-S THE "EXTERNAL" CLAUSE WAS SPECIFIED FOR A DATA ITEM WHOSE
LEVEL-NUMBER WAS NOT AN 01 IN THE "WORKING-STORAGE SECTION".  THE
"EXTERNAL" CLAUSE WAS DISCARDED.

Frank

Report this thread to moderator Post Follow-up to this message
Old Post
Frank Swarbrick
07-15-06 11:55 PM


Sponsored Links




Last Thread Next Thread Next
Pages (3): [1] 2 3 »
Search this forum -> 
Post New Thread

Cobol archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 04:12 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.