On Monday 18 February 2013 15:57:12 Clark Morris wrote:
> On 18 Feb 2013 08:30:24 -0800, in bit.listserv.ibm-main you wrote:
> >The plumbing needed to implement Paul Gilmartin's suggestion is more
> >complex than he perhaps implies it to be. An implementation is
> >straightforward in PL/I, e.g.,
> >
> >declare infile file record sequential buffered ;
> >...
> >declare read_file aligned bit ; /* boolean */
> >...
> >on endfile(infile) read_infile = '0'b ;
> >...
> >open file(infile) input ;
> >...
> >read_infile = '1'b ;
> >do while(read_infile) repeat(read_infile) ;
> > read file(infile) set(inrecp) ;
> >end ;
> >
> >Unfortunately there is nothing in COBOL corresponding to the
> >asynchronously entered ON unit here. COBOL is resolutely synchronous.
>
> If you add status codes to the SELECT statement for a file, you can
> code
> IF HOLD-FILE-A-KEY not = HIGH-VALUE
> READ FILE-A
> IF FILE-STATUS = '00' '97'
> PERFORM PROCESS-FILE-A
> ELSE
> MOVE HIGH-VALUE to HOLD-FILE-A-KEY
> END-IF
> END-IF
>
> There also are declaratives which are separate and that I never
> bothered figuring out how to use.
>
The Declaratives Section essentially works the way "on <condition>"
works in
PL/I:
Declaratives.
Section-name-1 Section.
Use after standard error procedure on File-Name-1.
* Statements to do something when an error occurs during I/O on
* File-Name-1.
Use after standard error procedure on File-Name-2.
* Statements to do something when an error occurs during I/O on
* File-Name-2.
End-Declaratives.
Leslie
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN