For Programmers: Free Programming Magazines  


Home > Archive > Cobol > July 2006 > EXTERNAL clarification









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 EXTERNAL clarification
Roger While

2006-07-15, 3:55 am

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


Rick Smith

2006-07-15, 7:55 am


"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".



Robert Jones

2006-07-15, 7:55 am


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

Roger While

2006-07-15, 7:55 am

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".
>
>
>



Rick Smith

2006-07-15, 6:55 pm


"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][color=darkred]
[snip][color=darkred]
> 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.



Frank Swarbrick

2006-07-15, 6:55 pm

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
William M. Klein

2006-07-15, 6:55 pm

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.

--
Bill Klein
wmklein <at> ix.netcom.com
"Frank Swarbrick" <infocat@earthlink.net> wrote in message
news:Pn8ug.8514$PE1.3481@newsread2.news.pas.earthlink.net...
> Roger While wrote:
>
> 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



William M. Klein

2006-07-15, 6:55 pm

Did you see ('02 Standard),

Page 251
"A level 1 data description entry in the working-storage section determines
the internal or external attribute of the record and its subordinate data
items."


--
Bill Klein
wmklein <at> ix.netcom.com
"Roger While" <simrw@sim-basis.de> wrote in message
news:e9aqs9$tss$00$1@news.t-online.com...
> 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...
>
>



Rick Smith

2006-07-15, 6:55 pm


"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:Xq9ug.240001$wA1.57510@fe03.news.easynews.com...
> 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 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 Page
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



Roger While

2006-07-15, 6:55 pm


"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


James J. Gavan

2006-07-15, 6:55 pm

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
Frank Swarbrick

2006-07-15, 6:55 pm

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
Frank Swarbrick

2006-07-15, 6:55 pm

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 Page
> 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
Pete Dashwood

2006-07-16, 7:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:e9bgb8$6mp$01$1@news.t-online.com...
>
> "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.


Gee, Roger... d'you think? ;-)

You should have seen the battle that raged over this very point (the
verbosity and legalese of the last standard), in this forum, some time ago.

Never mind, water under the bridge. I smile to see that someone else has
exactly the same problem I had with it some years back.

I don't think any lessons were learned because the new standard is just as
bad.

Makes you wonder if a standard serves any purpose at all really... It
certainly doesn't if you can't USE it...

Pete.
>
> Roger
>
>
>




Rick Smith

2006-07-16, 6:55 pm


"Roger While" <simrw@sim-basis.de> wrote in message
news:e9bgb8$6mp$01$1@news.t-online.com...
>
> "Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
> news:12bi34hl2ctg0a2@corp.supernews.com...

[snip]
> 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.


Upon further investigation, I can find no intent by J4
to allow the EXTERNAL clause to be used with
level-number 77; but that further investigation revealed
three distinct patterns for expressing the same idea,
one of which contains a usage that is inconsistent with
the rest of the standard. It also revealed a rule that
appears to be incorrect.

Barring unforeseen problems, I will begin working on
the formal document (defect report?) tomorrow; but
I am not certain where to send it (not having done this
since the 2002 standard).



William M. Klein

2006-07-16, 6:55 pm

I must have been confusing it with GLOBAL. Does that compile cleanly (for all
3)?

--
Bill Klein
wmklein <at> ix.netcom.com
"Rick Smith" <ricksmith@mfi.net> wrote in message
news:12bih72cmf9ns33@corp.supernews.com...
>
> "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 Page
> 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
>
>
>



Frank Swarbrick

2006-07-16, 6:55 pm

William M. Klein wrote:
> I must have been confusing it with GLOBAL. Does that compile cleanly (for all
> 3)?
>


This works on COBOL/VSE. GLOBAL for both the FD and the 01 and just
GLOBAL for the FD appear to work exactly the same. (In other words,
GLOBAL at the FD level implicitly makes the related 01 levels global.)

If just the 01 level is declared GLOBAL then only the data area itself
is global, while the file is not. This, given the following...

IDENTIFICATION DIVISION.
PROGRAM-ID. GLOBTST.

ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION.
FILE-CONTROL.
SELECT MYFILE ASSIGN TO MYFILE.

DATA DIVISION.
FILE SECTION.
FD MYFILE GLOBAL.
01 MYREC PIC X(80) GLOBAL.

PROCEDURE DIVISION.
CALL 'NESTED'
CLOSE MYFILE
STOP RUN.


IDENTIFICATION DIVISION.
PROGRAM-ID. 'NESTED'.

DATA DIVISION.
WORKING-STORAGE SECTION.
01 LREC PIC X(40).

PROCEDURE DIVISION.
OPEN I-O MYFILE
READ MYFILE INTO LREC
MOVE 'ABCD' TO MYREC
WRITE MYREC
EXIT PROGRAM.
END PROGRAM 'NESTED'.

END PROGRAM 'GLOBTST'.

If MYFILE was *not* declared global then the OPEN, READ and WRITE
statements would not be valid (in the subprogram), while the MOVE
statement still would be.

This all seems correct to me. Is there some difference I should be
expecting with "FD GLOBAL/01 GLOBAL" versus just "FD GLOBAL"?


Frank
William M. Klein

2006-07-16, 6:55 pm

Check out the (obscure) GLOBAL phrase in I-O Declaratives.

Also, a GLOBAL for the "record" allows a WRITE (or REWRITE) even if you can't
OPEN, CLOSE, OR READ it. (Strange but true)

--
Bill Klein
wmklein <at> ix.netcom.com
"Frank Swarbrick" <infocat@sprynet.com> wrote in message
news:Yrxug.768$157.438@newsread3.news.pas.earthlink.net...
> William M. Klein wrote:
>
> This works on COBOL/VSE. GLOBAL for both the FD and the 01 and just GLOBAL
> for the FD appear to work exactly the same. (In other words, GLOBAL at the FD
> level implicitly makes the related 01 levels global.)
>
> If just the 01 level is declared GLOBAL then only the data area itself is
> global, while the file is not. This, given the following...
>
> IDENTIFICATION DIVISION.
> PROGRAM-ID. GLOBTST.
>
> ENVIRONMENT DIVISION.
> INPUT-OUTPUT SECTION.
> FILE-CONTROL.
> SELECT MYFILE ASSIGN TO MYFILE.
>
> DATA DIVISION.
> FILE SECTION.
> FD MYFILE GLOBAL.
> 01 MYREC PIC X(80) GLOBAL.
>
> PROCEDURE DIVISION.
> CALL 'NESTED'
> CLOSE MYFILE
> STOP RUN.
>
>
> IDENTIFICATION DIVISION.
> PROGRAM-ID. 'NESTED'.
>
> DATA DIVISION.
> WORKING-STORAGE SECTION.
> 01 LREC PIC X(40).
>
> PROCEDURE DIVISION.
> OPEN I-O MYFILE
> READ MYFILE INTO LREC
> MOVE 'ABCD' TO MYREC
> WRITE MYREC
> EXIT PROGRAM.
> END PROGRAM 'NESTED'.
>
> END PROGRAM 'GLOBTST'.
>
> If MYFILE was *not* declared global then the OPEN, READ and WRITE statements
> would not be valid (in the subprogram), while the MOVE statement still would
> be.
>
> This all seems correct to me. Is there some difference I should be expecting
> with "FD GLOBAL/01 GLOBAL" versus just "FD GLOBAL"?
>
>
> Frank



Frank Swarbrick

2006-07-16, 6:55 pm

William M. Klein wrote:
> Check out the (obscure) GLOBAL phrase in I-O Declaratives.


Sorry, Bill, I think you'll have to lead this horse to water...

Are you referring to the GLOBAL phrase of the USE statement? Even if
so, I'm still not sure to what you are referring.


> Also, a GLOBAL for the "record" allows a WRITE (or REWRITE) even if you can't
> OPEN, CLOSE, OR READ it. (Strange but true)


Hmm, I can see that. Weird, and I can't imagine anyone ever using it,
but it seems to be allowed "under the letter of the law".

Frank


Roger While

2006-07-17, 3:55 am


"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12bktp78gos372d@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:e9bgb8$6mp$01$1@news.t-online.com...
> [snip]
>
> Upon further investigation, I can find no intent by J4
> to allow the EXTERNAL clause to be used with
> level-number 77; but that further investigation revealed
> three distinct patterns for expressing the same idea,
> one of which contains a usage that is inconsistent with
> the rest of the standard. It also revealed a rule that
> appears to be incorrect.
>


Why not 77 ?
77 is just a special case of 01.

Roger


Rick Smith

2006-07-17, 3:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:e9fafg$6gk$01$1@news.t-online.com...
>
> "Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
> news:12bktp78gos372d@corp.supernews.com...

[snip]
>
> Why not 77 ?
> 77 is just a special case of 01.


I don't disagree; but there seems to be an problem that
occurred between the 1985 and 2002 standards.

The Micro Focus LRMs often quote the standard
verbatim, only changing text where required to reflect
that which is implementor-defined. Following are four
quotes from the LRM for Micro Focus 3.2, all marked
as ANS85, each followed by the text from WD 1.6.

1 -----
"A level 01 data description in the Working-Storage
Section determines the internal or external attribute of
the data record and it subordinate data items."

A level 1 data description entry in the working-storage
section determines the internal or external attribute of the
record and its subordinate data items.

2 -----
"5. The EXTERNAL clause can be specified only in
data description entries in the Working-Storage Section
whose level-number is 01."

[Missing from WD 1.6 and ISO 1989:2002]

3 -----
"1. The EXTERNAL clause can be specified only in
file description entries, or in record description entries
in the Working-Storage Section."

1) The EXTERNAL clause may be specified only in file
description entries or in record description entries in the
working-storage section.

4 -----
"2. In the same program, the data name specified as the
subject of the entry whose level-number is 01 that includes
the EXTERNAL clause must not be the same data-name
specified for any other data description entry which includes
the EXTERNAL clause."

2) In the same source element, the externalized name of
the subject of the entry that includes the EXTERNAL
clause shall not be the same as the externalized name of
any other entry that includes the EXTERNAL clause.
-----

If Micro Focus quoted the 1985 standard, accurately,
then a key rule that would have removed the uncertainty
was dropped during the creation of the 2002 standard.
That being the case, would establish an intent that the
EXTERNAL clause not appear on a data description
entry whose level-number is 77. On the other hand, were
there an intent to allow the EXTERNAL clause with
level-number 77, the first quote would not have retained
a reference to level-number 1.



Roger While

2006-07-17, 7:55 am

Ah, OK Rick, now I understand.

Roger

"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12bmk3ehnnc59f1@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:e9fafg$6gk$01$1@news.t-online.com...
> [snip]
>
> I don't disagree; but there seems to be an problem that
> occurred between the 1985 and 2002 standards.
>
> The Micro Focus LRMs often quote the standard
> verbatim, only changing text where required to reflect
> that which is implementor-defined. Following are four
> quotes from the LRM for Micro Focus 3.2, all marked
> as ANS85, each followed by the text from WD 1.6.
>
> 1 -----
> "A level 01 data description in the Working-Storage
> Section determines the internal or external attribute of
> the data record and it subordinate data items."
>
> A level 1 data description entry in the working-storage
> section determines the internal or external attribute of the
> record and its subordinate data items.
>
> 2 -----
> "5. The EXTERNAL clause can be specified only in
> data description entries in the Working-Storage Section
> whose level-number is 01."
>
> [Missing from WD 1.6 and ISO 1989:2002]
>
> 3 -----
> "1. The EXTERNAL clause can be specified only in
> file description entries, or in record description entries
> in the Working-Storage Section."
>
> 1) The EXTERNAL clause may be specified only in file
> description entries or in record description entries in the
> working-storage section.
>
> 4 -----
> "2. In the same program, the data name specified as the
> subject of the entry whose level-number is 01 that includes
> the EXTERNAL clause must not be the same data-name
> specified for any other data description entry which includes
> the EXTERNAL clause."
>
> 2) In the same source element, the externalized name of
> the subject of the entry that includes the EXTERNAL
> clause shall not be the same as the externalized name of
> any other entry that includes the EXTERNAL clause.
> -----
>
> If Micro Focus quoted the 1985 standard, accurately,
> then a key rule that would have removed the uncertainty
> was dropped during the creation of the 2002 standard.
> That being the case, would establish an intent that the
> EXTERNAL clause not appear on a data description
> entry whose level-number is 77. On the other hand, were
> there an intent to allow the EXTERNAL clause with
> level-number 77, the first quote would not have retained
> a reference to level-number 1.
>
>
>



Sponsored Links







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

Copyright 2008 codecomments.com