Problem:
the code pasted below compiles without any Problem with Net Express 3.1, generates
errors 1309 == File related section or paragraph not allowed. ( Severe error ) with Net Express 4.0....
====> compile errors:
Micro Focus Net Express V4
Version 4.0.38 Copyright (C) 1984-2005 Micro Focus International Ltd.
URN AXCGG/AA0/00000
43 INPUT-OUTPUT SECTION. *> !!!!!
*1309-S************ **
** File related section or paragraph not allowed.
46 FILE SECTION. *> !!!!!
*1309-S**** **
** File related section or paragraph not allowed.
o
Checking complete - errors found
The compile "error" occurs on the cobol lines
... INPUT-OUTPUT SECTION.
... FILE SECTION.
defined within a method.....
Paste of the code:
*>-----------------------------------------------------------
*> Class description
*>-----------------------------------------------------------
class-id. DLL103
inherits from olebase.
*
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
*
object section.
class-control.
DLL103 is class "dll103"
*> OCWIZARD - start list of classes
*> OCWIZARD - end list of classes
*>---USER-CODE. Add any additional class names below.
.
*>-----------------------------------------------------------
working-storage section. *> Definition of global data
*>-----------------------------------------------------------
*
*>-----------------------------------------------------------
class-object. *> Definition of class data and methods
*>-----------------------------------------------------------
object-storage section.
end class-object.
*>-----------------------------------------------------------
object. *> Definition of instance data and methods
*>-----------------------------------------------------------
object-storage section.
*> OCWIZARD - start standard instance methods
*> OCWIZARD - end standard instance methods
*>---------------------------------------------------------------
method-id. "DLL103METH".
ENVIRONMENT DIVISION.
INPUT-OUTPUT SECTION. *> !!!!!
FILE-CONTROL. *> !!!!!
DATA DIVISION.
FILE SECTION. *> !!!!!
local-storage Section.
procedure division.
exit method.
end method "DLL103METH".
*>---------------------------------------------------------------
end object.
end class DLL103.
Resolution:
Extract of readme delivered in Websync updates ( cmp07n40.txt ):
o INPUT-OUTPUT SECTION and FILE-SECTION are not allowed in methods or
before FACTORY/STATIC paragraphs in class programs. They now receive
syntax errors.
-533616
===> ie: Net Express 3.1 could compile without any problem this COBOL syntax not conforming to the ISO2002 standard.... This "error" has been corrected.
===> You'll have to modify your program, as pasted below.
*>-----------------------------------------------------------
*> Class description
*>-----------------------------------------------------------
class-id. DLL103
inherits from olebase.
*
CONFIGURATION SECTION.
SPECIAL-NAMES.
DECIMAL-POINT IS COMMA.
*
object section.
class-control.
DLL103 is class "dll103"
*> OCWIZARD - start list of classes
*> OCWIZARD - end list of classes
*>---USER-CODE. Add any additional class names below.
.
INPUT-OUTPUT SECTION. *> !!!!!
FILE-CONTROL. *> !!!!!
select LSfile assign to "LSFILE.txt"
file status st1.
DATA DIVISION.
FILE SECTION. *> !!!!!
fd LSfile.
01 LSrec pic x(132).
*>-----------------------------------------------------------
working-storage section. *> Definition of global data
*>-----------------------------------------------------------
01 st1 pic xx.
*
*>-----------------------------------------------------------
class-object. *> Definition of class data and methods
*>-----------------------------------------------------------
object-storage section.
end class-object.
*>-----------------------------------------------------------
object. *> Definition of instance data and methods
*>-----------------------------------------------------------
object-storage section.
*> OCWIZARD - start standard instance methods
*> OCWIZARD - end standard instance methods
*>---------------------------------------------------------------
method-id. "DLL103METH".
ENVIRONMENT DIVISION.
*INPUT-OUTPUT SECTION. *> !!!!!
*FILE-CONTROL. *> !!!!!
DATA DIVISION.
*FILE SECTION. *> !!!!!
*
local-storage Section.
procedure division.
open output lsfile
if st1 not = "00" display "Pb Open file: " st1
else display "file opened OK " st1
end-if
close lsfile
if st1 not = "00" display "Pb close file: " st1
else display "file closed OK " st1
end-if
exit method.
end method "DLL103METH".
*>---------------------------------------------------------------
end object.
end class DLL103.
