Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cobol vs. PL/1

351 views
Skip to first unread message

jg...@my-dejanews.com

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
according to Accredited Standards Committee last revision of COBOL :

"The USAGE COMPUTATIONAL clause specifies that a radix and format specified by
the implementor is used to
represent a numeric item in the storage of the computer. Each implementor
specifies the precise effect of the
USAGE COMPUTATIONAL clause upon the alignment and representation of the data
item in the storage of the
computer, including the representation of any algebraic sign, and upon the
range of values that the data item may hold." This implies that this may vary
between COBOL implementors.

My question is what is the the equivalent of PIC S9(4) COMP IN PL/1 ? That
is how do you declare this in Pl/1?

Johanes Gislason
Please send your respond to jg...@rb.is
thanks in advance


-----------== Posted via Deja News, The Discussion Network ==----------
http://www.dejanews.com/ Search, Read, Discuss, or Start Your Own

Peter Flass

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
jg...@my-dejanews.com wrote:
>
> according to Accredited Standards Committee last revision of COBOL :
>
> "The USAGE COMPUTATIONAL clause specifies that a radix and format specified by
> the implementor is used to
> represent a numeric item in the storage of the computer. Each implementor
> specifies the precise effect of the
> USAGE COMPUTATIONAL clause upon the alignment and representation of the data
> item in the storage of the
> computer, including the representation of any algebraic sign, and upon the
> range of values that the data item may hold." This implies that this may vary
> between COBOL implementors.
>
> My question is what is the the equivalent of PIC S9(4) COMP IN PL/1 ? That
> is how do you declare this in Pl/1?
>
Naturally, if the COBOL encoding is implementation-defined, the answer
would depend on what implementation of COBOL you're talking about ;-)
In the last COBOL I worked with, s9(1) to s9(4) comp would generate a
binary halfword (=fixed bin(15,0) ). To be exact, it should be fixed
bin(14,0): 4 decimal digits, ceil(4*3.32)=14.

Gunnar Opheim

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
Peter Flass <Fl...@Leginfo.LBDC.State.NY.US> wrote in article
<37135D...@Leginfo.LBDC.State.NY.US>...
> jg...@my-dejanews.com wrote:
> > ...

> > My question is what is the the equivalent of PIC S9(4) COMP IN PL/1
? That
> > is how do you declare this in Pl/1?
> >
> Naturally, if the COBOL encoding is implementation-defined, the answer
> would depend on what implementation of COBOL you're talking about ;-)
> In the last COBOL I worked with, s9(1) to s9(4) comp would generate a
> binary halfword (=fixed bin(15,0) ). To be exact, it should be fixed
> bin(14,0): 4 decimal digits, ceil(4*3.32)=14.
>

COBOL PIC S9(4) is guarantied equivalent to PL/I FIXED BIN(15,0) only if
compiled with the TRUNC(BIN) option. With TRUNC(STD) the value is
truncated to the number of digits (decimal) in the PIC clause. PL/I does
not perform such truncation.

Gunnar.

Robert M. Pritchett

unread,
Apr 13, 1999, 3:00:00 AM4/13/99
to
Depending on which Cobol compiler options are chosen as to truncation, the
full 2-byte signed 15-bit field is available.


Robert M. Pritchett, President - RMP Consulting Partners LLC
http://rmpcp.com - rm...@pobox.com - Dallas, TX - Member ICCA
"Quality means doing it right the first time!"
See http://www.headhunter.net/jobstv/0j/j04651mjxt8trch80j.htm?ShowJob
Contractors: tired of hearing "W-2 only"? Join us and let us help you get
that same contract on a 1099 as a self-employed independent contractor!


Peter Flass wrote in message <37135D...@Leginfo.LBDC.State.NY.US>...

Fitz Michael

unread,
Apr 15, 1999, 3:00:00 AM4/15/99
to
jg...@my-dejanews.com wrote:

>My question is what is the the equivalent of PIC S9(4) COMP IN PL/1 ? That
>is how do you declare this in Pl/1?

PIC S9(1) to PIC S9(4) COMP: BIN FIXED(15)
PIC S9(5) COMP and above: BIN FIXED(31)

PIC S9(n) COMP-3: DEC FIXED(n)

(on any IBM-Mainframes)

CUL8R!

Ing. Michael Fitz
A-2410 Hainburg; Carnuntumstr. 21
<st...@lords.com> <mf...@aon.at>
=== PGP-Key on request ===

Denis

unread,
Apr 16, 1999, 3:00:00 AM4/16/99
to
FItz,

This is not 100% correct

In COBOL (At least on IBM MF):

PIC S9(10) COMP through PIC S9(18) COMP variables are held on 64 bits (=8
bytes).

I do not know the quivalent of this in PL/I


Fitz Michael wrote in message <3713cb19...@news.aon.at>...

Fitz Michael

unread,
Apr 17, 1999, 3:00:00 AM4/17/99
to
"Denis" <gro...@antispam.skynet.be> wrote:

>In COBOL (At least on IBM MF):
>
>PIC S9(10) COMP through PIC S9(18) COMP variables are held on 64 bits (=8
>bytes).
>
>I do not know the quivalent of this in PL/I

You are right. And there is no standard PLI-equivalent.

Mark Yudkin

unread,
Apr 18, 1999, 3:00:00 AM4/18/99
to
On VA PL/I V2.1 with CSD#1 or above, the equivalent is:
fixed bin (63)
You will need to specify the compiler options limits(fixedbin(63)).
(Warning: there are quite a few bugs in the CSD#1 support. CSD#2 or above is
recommended)

This feature should be available on OS/390 when the VA PL/I compiler is
released on OS/390 in 9/1999, but not for OS PL/I or PL/I for MVS.

Fitz Michael wrote in message <3717a504...@news.aon.at>...

0 new messages