Thanks, but quoting the Fine Manual here:

“The WHEN-COMPILED function returns the date and time that the program was 
compiled as provided by the system on which the program was compiled.”

It does provide the actual date and time compiled, but not the 
installation-specific information which our SCLM generates into the SERVICE 
string.

Peter

From: IBM Mainframe Discussion List <[email protected]> On Behalf Of 
salva
Sent: Sunday, December 28, 2025 3:53 AM
To: [email protected]
Subject: Re: How to extract the compile-time SERVICE string at runtime?

For Enterprise Cobol try WHEN-COMPILED intrisic function.

https://urldefense.com/v3/__https://www.ibm.com/docs/en/cobol-zos/6.5.0?topic=functions-when-compiled__;!!Ebr-cpPeAnfNniQ8HSAI-g_K5b7VKg!PCmlHukmlZxHzykGE0WSYlnbzc3jGZFG2HL8GZqUPIfqTv1Q0QLqBv6EUNCmJYHAabE841mdOh6P0QK6CQI$

El dom, 28 dic 2025, 9:42, Farley, Peter <
mailto:[email protected]> escribió:

> Both the Enterprise COBOL and PL/I compilers have the compile-time option
> SERVICE to store an identifying string in the generated program.  In our
> shop the SCLM process generates an identifying string for each compile run
> telling when and from where (project ID) and by whom (TSO ID) the program
> was last translated.
>
> However, unless I missed it there is no documented way to extract that
> string at runtime (e.g., to log the version that is executing).
>
> Aside from control-block chasing within the generated code (PPA1/2/3/4,
> etc.), does anyone know if there is a function available to do that?
>
> I have looked over the LE Vendor Interfaces guide, but that only seems to
> show in which control block the SERVICE string can be found and does not
> document a function to retrieve the string.
>
> TIA for any help you can provide.
>
> Peter
--

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 [email protected] with the message: INFO IBM-MAIN

Reply via email to