Sorry for jumping in VERY late.

If you have something like

    DCL X CHAR (6);

    X = DATE;

then you will get strange results, because DATE is not recognized as the well-known builtin function DATE which returns the current date. But instead it is a DECIMAL FLOAT(6) variable with an undefined value (given the "normal" default rules, inherited from FORTRAN, which defines an undefined variable depending on its first letter ... and, of course, if you don't have the more modern compiler options which prevent you from using undefined variables etc.).

Now, if you want the compiler to use the builtin function DATE instead of this undefined variable, you have two choices:

- declare DATE as a BUILTIN function

   DCL DATE BUILTIN;
   X = DATE;

- put parantheses after DATE; that is:

   X = DATE ();

   this way, DATE is known to be the BUILTIN function "by context".

Both variants will do.

Same goes for all other builtin functions without arguments.

HTH,
kind regards

Bernd
(PL/1 teacher since 1991 - and many other stuff, ASSEMBLER, C, DB2, ...)



Am 15.11.2023 um 18:34 schrieb Binyamin Dissen:
A PL/I source code member has

            DCL foobar BUILTIN

and must be compiled with RULES(LAXDCL)

I see no reference to FOOBAR as a function call.

My question is if FOOBAR was invoked, what does the BUILTIN clause do? A
different calling sequence? Looking for an internal label?

--
Binyamin Dissen <[email protected]>
http://www.dissensoftware.com

Director, Dissen Software, Bar & Grill - Israel

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to [email protected] with the message: INFO IBM-MAIN

Reply via email to