bug-gnucobol
[Top][All Lists]
Advanced

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

Re: [open-cobol-list] Version 1.1 Bug in File-Control ?


From: Bill Klein
Subject: Re: [open-cobol-list] Version 1.1 Bug in File-Control ?
Date: Tue, 19 Feb 2008 16:07:26 -0600

The "text" after the ASSIGN TO is implementer defined and there are LOTS of
different things that it can mean.

SEVERAL compilers allow one to put an "environment variable" name there.  In
that case, there is no "data-name" within the program that matches and the
file name is found at run-time by getting it from the environment variable.
(If there is no defined environment variable with that name and there is not
data item with that name and the rules don't try and make the text itself
into a physical name, then the OPEN fails).

FYI,  
  The '02 Standard uses
   ASSIGN USING data-name
to handle the case of getting a value from a data name.  However, I don't
know how many implementers (if any) have adopted this. 

> -----Original Message-----
> From: address@hidden 
> [mailto:address@hidden On 
> Behalf Of Kurt Derichs
> Sent: Tuesday, February 19, 2008 5:32 AM
> To: address@hidden
> Subject: [open-cobol-list] Version 1.1 Bug in File-Control ?
> 
> Hello,
> 
> I was wondering weather or not this is a compiler error that 
> the following program can be compiled without error message.
> SELECT INFILE ASSIGN        TO INFILE-FILE-NAME
> but due to a typo the variable was never defined
> 03 INFILE-FILENAME                pic x(256).
> 
> I tested the program on open cobol 1.1 compiled on ubuntu 
> 7.10 64 bit. If you need more infos just let me now.
> 
> Bye
> 
> Kurt
> 
> PS: I registered in the OpenCobol Forum but I can login. 
> Perhaps someone can help me with this as well.
> 
>       PROGRAM-ID. hello
>        AUTHOR. Kurt Derichs
>        DATE-COMPILED. 20080210
> 
>        ENVIRONMENT DIVISION.
>        CONFIGURATION SECTION.
>        SOURCE-COMPUTER. x86.
>        OBJECT-COMPUTER. x86.
> 
>        INPUT-OUTPUT SECTION.
>        FILE-CONTROL.
>            SELECT INFILE ASSIGN        TO INFILE-FILE-NAME
>                   ORGANIZATION         IS LINE SEQUENTIAL
>                   ACCESS MODE          IS SEQUENTIAL
>                   FILE STATUS          IS INFILE-ERR-STATUS.
> 
>        DATA DIVISION.
>        FILE SECTION.
>        FD INFILE
>           data record is infile-satz.
>        01 INFILE-SATZ              PIC X(80). 
> 
>        WORKING-STORAGE SECTION.
>        01 INFILE-DATA.
>              03 INFILE-FILENAME                pic x(256).
>              03 INFILE-ERR-STATUS              pic 99.
> 
>        PROCEDURE DIVISION.
>        start-10.
>            move "/tmp/test" to infile-filename.
>            move zero          to infile-err-status.
>            open input infile.
>            close infile.
> 
>        start-99.
>        STOP RUN.
> 
> -- 
> Psssst! Schon vom neuen GMX MultiMessenger gehört?
> Der kann`s mit allen: http://www.gmx.net/de/go/multimessenger
> 
> --------------------------------------------------------------
> -----------
> This SF.net email is sponsored by: Microsoft
> Defy all challenges. Microsoft(R) Visual Studio 2008.
> http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
> _______________________________________________
> open-cobol-list mailing list
> address@hidden
> https://lists.sourceforge.net/lists/listinfo/open-cobol-list
> 




reply via email to

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