Here's a simple call to printf from LE-enabled assembler.

         ceedsa ,
         ceecaa ,
prntit   ceeentry main=YES
         call  PRINTF,(fmtstr,3)
         ceeterm
ppa      ceeppa ,
fmtstr   dc    c'Test %d!',x'0'
         end   prntit

Output is:
Test 3!

-----Original Message-----
From: IBM Mainframe Assembler List <[email protected]> On Behalf 
Of Charles Mills
Sent: Tuesday, April 18, 2023 12:59 PM
To: [email protected]
Subject: [EXTERNAL] Re: Automatic Variable Insertion

I know I have seen an example somewhere of calling printf() from assembler. 
Printf() does not really do a WTO, but the form of it named sprint() returns a 
string that you could WTO.

The printf() family is super powerful -- more than you could hope to achieve in 
a reasonable amount of macro coding.

Charles


-----Original Message-----
From: IBM Mainframe Assembler List [mailto:[email protected]] On 
Behalf Of Gary Weinhold
Sent: Tuesday, April 18, 2023 9:33 AM
To: [email protected]
Subject: Re: Automatic Variable Insertion

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.

The information contained in this electronic communication and any document 
attached hereto or transmitted herewith is confidential and intended for the 
exclusive use of the individual or entity named above. If the reader of this 
message is not the intended recipient or the employee or agent responsible for 
delivering it to the intended recipient, you are hereby notified that any 
examination, use, dissemination, distribution or copying of this communication 
or any part thereof is strictly prohibited. If you have received this 
communication in error, please immediately notify the sender by reply e-mail 
and destroy this communication. Thank you.

Reply via email to