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

Re: [GNU-COBOL] New to list




> > > Alphanumeric fields : PIC strings contains A, X and 9 characters!
> >
> > Alphanumeric, or alphanumeric edited?
> 
> Alphanumeric fields are fields which can contain all possible codes.
> The picture can be contructed as a combination of A, X and 9.  Although
> it should be treated as if only X was used in the PIC string.

In standard COBOL, there are also alphanumeric edited fields, which
allow the /, B and 0 characters.  For example, if you move a data item
with a value of "102899" into a variable with PIC XX/XX/XX, the result
is "10/28/99".  The other characters are used similarly.  Moving
"ABC123" into a PIC XBXX/XXX gives "A BC/123".  And so forth.

COBOL 85 introduces a few new tricks that might have an influence on how
storage is handled in the Gnubol implementation.  The most important one
is the de-editing MOVE.  In COBOL 74, moving a PIC S9(4)V99 field into a
PIC $ZZZ,Z9.99 field was perfectly legal, but moving the latter into the
former was illegal.  COBOL 85 makes that possible.  Another trivial (to
My mind) change that can cause programmers to go nuts is the allowance
of the decimal point or comma as the rightmost character in a PIC clause
-- but ONLY if the ending period comes right after.

That means that

	15  MY-VAR1         COMP SYNC   PIC 999..

would be valid, but

        15  MY-VAR1         PIC 999.   COMP SYNC.

would not be.  Why would you want to do that?  I don't know, but them's
the rules.

> That would be great to get that copy. Please send it to :
> Fred Mobach
> Den Akker 8
> 4054 MD  Echteld
> The Netherlands

If you like, I could try to scan it in to the computer and just send it
via email; might that work better?

> BTW. The column with Inst. contains the mnemonic of the machine
> instructions. RR means the instruction has more than 1 register operand.
> RX means 1 register operand and 1 (indexed) memory location. You should
> find on other pages also SS, which means operations with 2 memory
> locations as operands.

I figured it was something like that; and yes, on the fourth page,
there's an SS, but on the third page the header is "Instruction and
Format."  There are also some footnotes that seem to have gotten cut
off.

> You will only get that warning if you're using a constant greater than
> 9999, I assume. Or is the DOS/VSE compiler so nice to check on the value
> boundaries after each arithmetic operation ?

No, that's the way it works.  We use the larger values to pass a large
comm area in CICS; the variable that goes into the CICS command is
required to be a signed binary half-word, but sometimes the comm area is
bigger than 9999 bytes long ...

> > No, it isn't impossible; it's fairly common actually.  Just like USAGE
> > IS DISPLAY, it's always assumed to be positive, and on many systems
> > will then be able to store a higher value.  (For instance, the PIC
> > S9(4) COMP field mentioned above could store a value of up to 65,535
> > if declared as unsigned.)
> 
> We're using different compilers. This will generate some traffic on this
> list in the future. Do we have enought bandwidth ?

It would appear that We are using different compilers.  I'm not sure
that the storage of 5 digit values in a variable declared as 9(4) is
"standard" COBOL, but I'm pretty sure that unsigned COMP fields are.  I
guess We'd have to look at the ANSI specs to make sure instead of taking
what the different compilers allow.

> > What do you mean by floating-point variables?  Things like PIC 99V9?
> 
> Not exactly, I mean variables like in common use in Fortran and Algol
> with mantissa and exponent.

Yes, someone pointed that out.  I had a complete misunderstanding of you
there.


-- 
David R. Ondrejko - EDI/Referral - Safelite Glass Co.
 Mathematician by training - Programmer by trade - Philosopher by nature
 Genius by genetics - Atheist by conviction - Hedonist by desire!

--
This message was sent through the gnu-cobol mailing list.  To remove yourself
from this mailing list, send a message to majordomo@lusars.net with the
words "unsubscribe gnu-cobol" in the message body.  For more information on
the GNU COBOL project, send mail to gnu-cobol-owner@lusars.net.