We resolved this by creating using the TEXT= option with a register which allowed us to use a single WTO MF=L and a single WTO MF=E for all WTOs. The messages themselves are generated by a macro which has a LITERAL type (to generate the constants), a DSECT form (to name where the variables are), and a SPACE type, to reserve space in working storage for reentrant programs. We don't use a macro to fill in the variables though.
It seems like what you want is similar to an assembler version of the C language printf library function. Your macro would have to scan the WTO text for a symbol, e.g. "&", and match the following characters to a macro parameter (like &P1 matched to P1). Somehow the logic has to know the length to move in which has to be no more than the length reserved in the message text (otherwise it gets complicated). And it would have to loop to handle multiple input arguments and multiple &s in the TEXT. Fortunately, the length of the message precedes the message in the TEXT= format so you know when you're done scanning the text. Gary Weinhold Senior Application Architect DATAKINETICS | Data Performance & Optimization Phone:+1.613.523.5500 x216 Email: [email protected] Visit us online at www.DKL.com E-mail Notification: The information contained in this email and any attachments is confidential and may be subject to copyright or other intellectual property protection. If you are not the intended recipient, you are not authorized to use or disclose this information, and we request that you notify us by reply mail or telephone and delete the original message from your mail system. ________________________________ From: IBM Mainframe Assembler List <[email protected]> on behalf of Peter Relson <[email protected]> Sent: April 18, 2023 10:55 To: [email protected] <[email protected]> Subject: Re: Automatic Variable Insertion I suggest, by the way, that you use the TEXT keyword of WTO. It can make things much more flexible for you, since the message line is then not part of the WTO expansion, rather just the address of it. Peter Relson z/OS Core Technology Design
