For Programmers: Free Programming Magazines  


Home > Archive > Cobol > January 2007 > SORT and FILE STATUS









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 SORT and FILE STATUS
Roger While

2007-01-24, 3:55 am

Is FILE STATUS legal with a SORT file ?
Can't see anywhere in the standard that says it is not.
If so, when and under what conditions should the file
status be set in combination with the SORT/USING/GIVING/RELEASE/RETURN
statments.
The chapter 9.1.12 I-O status only refers to usual I/O statements.

Roger


Rick Smith

2007-01-24, 3:55 am


"Roger While" <simrw@sim-basis.de> wrote in message
news:ep755i$g5v$03$1@news.t-online.com...
> Is FILE STATUS legal with a SORT file ?
> Can't see anywhere in the standard that says it is not.
> If so, when and under what conditions should the file
> status be set in combination with the SORT/USING/GIVING/RELEASE/RETURN
> statments.
> The chapter 9.1.12 I-O status only refers to usual I/O statements.


ISO/IEC 1989:200x WD 1.6, 12.3.4.1 [File control
entry] General format, Format 4 (sort-merge), page 233,
contains no provision for a FILE STATUS clause.

12.3.4.2 [File control entry] Syntax rules, page 234,
"FORMAT 1
9) Format 1 shall be specified only for an indexed file.
The associated file description entry shall not be a
sort-merge file description entry.
FORMAT 2
10) Format 2 shall be specified only for a relative file.
The associated file description entry shall not be a
sort-merge file description entry.
....
FORMAT 3
12) Format 3 shall be specified only for a sequential
file or a report file. The associated file description entry
shall not be a sort-merge file description entry.
FORMAT 4
13) Format 4 shall be specified only for a sort-merge file.
The associated file description entry shall be a sort-merge
file description entry."

Formats 1, 2, and 3 (indexed, relative, and sequential,
respectively) have FILE STATUS clauses; but Format 4
does not.

Having a FILE STATUS clause with a sort-merge file
description entry would be an implementor extension.
Micro Focus allowed (allows) a SORT STATUS
clause (FILE STATUS was a synonym). Available
status keys were (are) 0/0 - Successful, 3/0 - Permanent
Error, and 9/nnn - Operating system error message
number. Status values were (are) updated after each
sort operation.

[I use a past (present) relation, above, because the
Micro Focus product I have will become a teenager
in a few months and information from the manuals I
have may not apply to current products.]



Roger While

2007-01-24, 7:55 am

OK.
Thanks Rick, I missed that.

Roger

"Rick Smith" <ricksmith@mfi.net> schrieb im Newsbeitrag
news:12rea0an97lrq8f@corp.supernews.com...
>
> "Roger While" <simrw@sim-basis.de> wrote in message
> news:ep755i$g5v$03$1@news.t-online.com...
>
> ISO/IEC 1989:200x WD 1.6, 12.3.4.1 [File control
> entry] General format, Format 4 (sort-merge), page 233,
> contains no provision for a FILE STATUS clause.
>
> 12.3.4.2 [File control entry] Syntax rules, page 234,
> "FORMAT 1
> 9) Format 1 shall be specified only for an indexed file.
> The associated file description entry shall not be a
> sort-merge file description entry.
> FORMAT 2
> 10) Format 2 shall be specified only for a relative file.
> The associated file description entry shall not be a
> sort-merge file description entry.
> ...
> FORMAT 3
> 12) Format 3 shall be specified only for a sequential
> file or a report file. The associated file description entry
> shall not be a sort-merge file description entry.
> FORMAT 4
> 13) Format 4 shall be specified only for a sort-merge file.
> The associated file description entry shall be a sort-merge
> file description entry."
>
> Formats 1, 2, and 3 (indexed, relative, and sequential,
> respectively) have FILE STATUS clauses; but Format 4
> does not.
>
> Having a FILE STATUS clause with a sort-merge file
> description entry would be an implementor extension.
> Micro Focus allowed (allows) a SORT STATUS
> clause (FILE STATUS was a synonym). Available
> status keys were (are) 0/0 - Successful, 3/0 - Permanent
> Error, and 9/nnn - Operating system error message
> number. Status values were (are) updated after each
> sort operation.
>
> [I use a past (present) relation, above, because the
> Micro Focus product I have will become a teenager
> in a few months and information from the manuals I
> have may not apply to current products.]
>
>
>



William M. Klein

2007-01-24, 6:55 pm

Rick gave the correct answer for the SD file itself. It is worth noting,
however, that one MAY specify a File Status clause for the Input/Output files.
In fact, this is exactly why IBM says that using the FASTSRT compiler option
(where their non-COBOL SORT utility does the I/O) is *not* ANSI/ISO conforming.
They do NOT update the FS (or more importantly reach I/O Declaratives) if there
is an I/O "problem" with Input/Output files during a SORT (without an
Input/Output procedure) when FASTSRT is in effect. They DO conform to the
Standard when NOFASTSRT is specified.

--
Bill Klein
wmklein <at> ix.netcom.com
"Roger While" <simrw@sim-basis.de> wrote in message
news:ep755i$g5v$03$1@news.t-online.com...
> Is FILE STATUS legal with a SORT file ?
> Can't see anywhere in the standard that says it is not.
> If so, when and under what conditions should the file
> status be set in combination with the SORT/USING/GIVING/RELEASE/RETURN
> statments.
> The chapter 9.1.12 I-O status only refers to usual I/O statements.
>
> Roger
>



Sponsored Links







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

Copyright 2008 codecomments.com