RE: [Cobolforgcc-devel] Added function
Status: Pre-Alpha
Brought to you by:
timjosling
From: William M. K. <wm...@ix...> - 2000-12-17 13:02:15
|
There is NO restriction on using concatenation expressions in the Data Division. (can you point to something that told you there was?) The figurative constant rule "boils down" to the fact that you may *NOT* use "ALL" - but can use things like LOW-VALUE or ZERO. (each is treated as a single character). The biggest difference between concatenation and the new (or old) forms of continuation is that COPY/REPLACING treats "A"- "B" or "A" - "B" as a single text word of "AB" while it treats "A" & "B" as 3 separate text words - so a COPY xyz Replacing =="A"== by =="X"==. would match the concatenation example but NOT either of the 1st two. > -----Original Message----- > From: ti...@me... [mailto:ti...@me...]On Behalf Of Tim > Josling > Sent: Saturday, December 16, 2000 10:26 PM > To: William M. Klein; cobolforgcc-devel > Subject: Re: [Cobolforgcc-devel] Added function > > > Bill, > > Sorry I mean non-numeric literals, not C style null terminated > strings. I'm aware of the issues with figurative constants, ALL > etc. > > It appears that in the procedure division I can concatenate > literals like this > "a" & "b" > > but this is not allowed elsewhere eg in the working-storage. > There, one must do > "a"- > "b" > > Is that right? I must say I fail to see what good is achieved by > this irregularity. > > Currently I allow & anywhere, as in X/Open COBOL. > > Tim Josling > > "William M. Klein" wrote: > > > > I am a "mere" COBOL person. Can you tell me what you mean by "string > > literals"? I can think of several "possible" meanings (in > COBOL terms) but > > don't know what you mean by them. > > > > NOTE: The draft Standard provides a facility called "Concatenation > > Expression" (defined in "8.8.3 Concatenation expressions" on > page 124 of CD > > 1.10). If this is what you are talking about, make certain > that you look at > > rules concerning figurative constants, class and category, etc. > > > > P.S. If by "string literals," you are referring to (what I know as) > > ASCII-null-terminated-strings, then this is NOT allowed in the draft > > Standard - but is implemented (as an extension) in several > compilers by the > > use of Z-literals. If these are of interest, then I can point > to either IBM > > or MERANT LRM entries for them. > > > > |