gnucobol-users
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [open-cobol-list] Error on index sequential file.


From: John R. Culleton
Subject: Re: [open-cobol-list] Error on index sequential file.
Date: Fri, 13 Apr 2007 09:30:21 -0400
User-agent: KMail/1.9.4

On Friday 13 April 2007 02:25, Roger While wrote:
> Not sure what is going on here, however, some
> comments -
> Both INFILE ("pdftex.map") and REFFILE ("pfbref") must
> exist as there is no "OPTIONAL" clause on the SELECT
> statement. (INFILE opened INPUT, REFFILE opened I/O)
> If either (or both) do not exist however I would expect a
> status 35. eg.
> libcob: File does not exist (STATUS=35) File : 'pdftex.map'
>

> Or if I put an OPTIONAL on INFILE -
> libcob: File does not exist (STATUS=35) File : 'pfbref'
> WARNING - Implicit CLOSE of OUTFILE ("pfbfound")
> WARNING - Implicit CLOSE of INFILE ("pdftex.map")
>
> Are you sure you are not mixing TC files with OC files ?
>
Thanks to earlier comments by Bill I changed the programs enough to 
get everything to work using OC. I deleted the superfluous word 
SEQUENTIAL in the  SELECT clause as suggested by Bill Klein.  I made 
the ACCESS sequential instead of dynamic. 

I may have failed to delete an earlier version of REFFILE created in 
Tiny. That may have caused the error. Anyhow the current version 
works.

I really need to use COBOL more. It is amazing how much I have 
forgotten.   
> Can you post the prog that creates the files.
>
I don't use OPTIONAL because if a file is absent the program shouldn't 
run.  Here is the (modified) creation program, but since everything 
is working now it is no longer relevant. Copying to an email has 
messed up margins where line numbers are blank:

000010 IDENTIFICATION DIVISION.
000020 PROGRAM-ID. TEMPLATE.
000030 AUTHOR. JOHN CULLETON.
000040 INSTALLATION. WEXFORDPRESS
000045            Eldersburg MD.
000047*SECURITY. Copyright 2006 John R. Culleton, Jr. 
000050*REMARKS.
000060*    Creates the lookup file.  
000070 ENVIRONMENT DIVISION.
000080 
000090 CONFIGURATION SECTION.
000100 SOURCE-COMPUTER.  
000110      Linux.
000120 OBJECT-COMPUTER. 
000230      Linux.
000140 
000150 INPUT-OUTPUT SECTION.
000160 FILE-CONTROL.
                SELECT INFILE ASSIGN TO "pfbuniq" ORGANIZATION IS LINE
                  SEQUENTIAL.
                SELECT OUTFILE ASSIGN TO "pfbref" ORGANIZATION IS 
                   INDEXED  
                   ACCESS IS SEQUENTIAL RECORD KEY IS PFBKEY.

000180 DATA DIVISION.
000190
000200 FILE SECTION.
000210 FD   INFILE.
             01 INREC PICTURE X(40).
             FD   OUTFILE.
             01   OUTREC.
                02 PFBKEY PICTURE X(40).
000220 WORKING-STORAGE SECTION.
             77  END-FILE-FLAG PICTURE X VALUE "N".
                   88 END-FILE VALUE "Y".
000230
000240 PROCEDURE DIVISION.
000250 001-MAIN-PROCEDURE.
000260     OPEN INPUT INFILE OUTPUT OUTFILE.
                 PERFORM 100-READIT UNTIL END-FILE.
                CLOSE INFILE OUTFILE.
                STOP RUN.
000270 100-READIT. 
                  READ INFILE AT END MOVE "Y" TO END-FILE-FLAG.
                  IF NOT END-FILE PERFORM 200-RECORD-WRITE.
       200-RECORD-WRITE.
                 MOVE SPACES TO OUTREC.
                 MOVE INREC TO PFBKEY.
                WRITE OUTREC. 


Thanks very much for your and Bill's comments.  I'l try not to make 
any more stupid mistakes, but no promises :<)
-- 
John Culleton
Able Indexing and Typesetting
Precision typesetting (tm) at reasonable cost.
Satisfaction guaranteed. 
http://wexfordpress.com



_________________________________________________________________
Need personalized email and website? Look no further. It's easy
with Doteasy $0 Web Hosting! Learn more at www.doteasy.com


reply via email to

[Prev in Thread] Current Thread [Next in Thread]