Thanks David, that is ALMOST what I need. I did RTFM on that function, but its primary input variable is a “dsa_ptr” pointing to the current DSA, which I presume means the contents of R13 of the running COBOL program. Plus the “calling convention” seems to be documented as usable only from assembler, not from an HLL, and depends on an address in the CAA pointed to by R12. Apparently CWI interfaces aren’t supposed to be used by HLL’s.
I wonder if using the address of the first or only variable in the LOCAL-STORAGE SECTION (COBOL-speak for stack storage that disappears on exit from a program or subroutine) would be good enough? I will have to try that out and see if it works. I know I can set up a COBOL PROCEDURE-POINTER to execute some object code stored in a COBOL variable to invoke the CEEYEPAF service with a parameter list hung off R1, but that is totally unsupported; it might work, but it would be impossible to pass an audit with such code. Unfortunately, COBOL has no preprocessor like the superb one that PL/I provides. Would that It did, but no such luck. I did see something recently about a new DEFINE operator/operation for COBOL that might only be available in V6.5. We’re on V6.4 and I don’t think we have that facility yet. <*Sigh*>. I guess it is time to bite the bullet and write the assembler code and try to get it approved. IBM really ought to support this rather than make us do it ourselves. Maybe I should write a new "idea" for IBM to reject. Peter From: IBM Mainframe Discussion List <[email protected]> On Behalf Of Thomas David Rivers Sent: Sunday, December 28, 2025 1:26 PM To: [email protected] Subject: Re: How to extract the compile-time SERVICE string at runtime? Hi Peter! The SERVICE string is part of the TIMESTAMP/VERSION information. It's a 2-byte length prefix followed by the character string at offset 20 (X'14') The offset from the PPA2 to the TIMESTAMP/VERSION information can be found at the 4-byte field in the PPA2 beginning at offset 12 (X'0C') in the PPA2. The PPA2 can be found using the CEEYEPAF LE service given an address in a running function's DSA. So, the path is DSA -> PPA2 -> TIMESTAMP/VERSION where you can find the SERVICE string. This is all described in the LE VENDOR INTERFACEs documentation. The 6.2 PL/I compiler for z/OS also has a preprocessor builtin (SERVICE) that returns the value of the SERVICE option. I don't know if COBOL has something similar? - Dave Rivers - -- 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
