Sounds to me like the documentation writer was a bit confused.  Looks to me 
like it should read instead:

If the number 3.1416 is used in more than one place in the program, then you 
*should* declare it as a named constant.
If it requires specific data or precision attributes at different places in the 
program, then you *must* declare it as a named constant.

Peter

-----Original Message-----
From: IBM Mainframe Discussion List <IBM-MAIN@LISTSERV.UA.EDU> On Behalf Of 
Paul Gilmartin
Sent: Friday, September 4, 2020 1:01 PM
To: IBM-MAIN@LISTSERV.UA.EDU
Subject: Re: Constant Identifiers

On Fri, 4 Sep 2020 10:55:19 -0500, Steve Smith wrote:

>I'm not a PL/I novice, if not an expert.  Whatever you read, it does 
>not mean what you think it means.
>
Enterprise PL/I for z/OS Language Reference Version 5 Release 1 IBM 
SC27-8940-00 Datatypes and attributes. . . 17
    If the number 3.1416 is used in more than one place in the program,
    or if it requires specific data or precision attributes, you must declare
    it as a named constant. Thus, the above statement can be coded
    as follows:
        dcl Pi FIXED DECIMAL (5,4) VALUE(3.1416);
        area = (radius**2) * Pi;

Perhaps then it doesn't mean what it says.  I take "must" to indicate a rule, 
not a suggestion.  I haven't seen the rule.  I haven't looked very hard.  Does 
it apply alike to 3.1416, 2.7183, and 2?
--

This message and any attachments are intended only for the use of the addressee 
and may contain information that is privileged and confidential. If the reader 
of the message is not the intended recipient or an authorized representative of 
the intended recipient, you are hereby notified that any dissemination of this 
communication is strictly prohibited. If you have received this communication 
in error, please notify us immediately by e-mail and delete the message and any 
attachments from your system.


----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to