ASSIGN namespace

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

 



Hello, 

I'm compiling, or would compile, a program that has a SELECT statement
as follows:

000150     SELECT CUSTMAS ASSIGN CUSTMAS
000160            ORGANIZATION SEQUENTIAL ACCESS MODE SEQUENTIAL.

and the complaint is: 

	error: redefinition of 'CUSTMAS'

I am told the program compiles under MicroFocus Cobol.  

I think the complaint may be too strict.  AFAICT, the 2nd CUSTMAS does
not name a variable.  It's a user-defined word, and has no meaning
anywhere except as the argument to ASSIGN.  

Neither the GNU Cobol manual nor IBM's "Enterprise COBOL for z/OS, V5.1
Language Reference" clearly states whether or not the target of the
ASSIGN clause is in a namespace distinct from other variables.  

For
	SELECT CUSTMAS

IBM says this "identifies a file in the COBOL program to be associated
with an external data set" and that CUSTMAS "must be unique within this
program".  

For
	ASSIGN CUSTMAS

IBM says this "associates the name of a file in a program with the
actual external name", and the rules are different than for variables.
Specifically this name: 

	"is not the name of a data item, and ... cannot be contained in
a data item. It is just a character string. It cannot contain an
underscore character."

Now, it's not really just a character string.  It can be a literal
string (not in this case) or it can be a "user-defined word", in which
case, 

	? The name can contain from one to eight characters.	? The name can contain the characters A-Z, a-z, and 0-9.	? The leading character must be alphabetic.	? The name cannot contain an underscore.

There's one more aspect.  IBM also says, 

	"The name component of assignment-name-1 is initially treated
as a ddname. If no file has been allocated using this ddname, then name
is treated as an environment variable."

and goes on to describe how the environment variable is interpreted.
(The rules are similar to those described in the GNU Cobol manual.)  

I am using  "-std=mf -frelax-syntax".  (I tried -fsyntax-extension,
too, but that option was rejected as invalid.)   

Is there a way to compile this program as is?  Is the syntax valid?  

--jkl






[Index of Archives]     [Gcc Help]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Info]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux