You also want to be careful about the parameters. Some C routines expect values on the stack (i.e., in-line in the parameter list) and others expect pointers to the values with most using a mix. That is typically my problem calling or getting called from C: getting that sequence straight.
Lloyd ----- Original Message ---- From: Gord Tomlin <[email protected]> To: [email protected] Sent: Fri, October 14, 2011 10:28:26 AM Subject: Re: Need simple example - Calling c subroutine like printf from HLASM program You want to make sure you are not creating and destroying a LE environment for every call, or it will get expensive. If your calling Assembler program is Language Environment-conforming, have a look in "z/OS V1R12.0 Language Environment Writing ILC Applications", section "14.5 Assembler Main Calling HLL Subroutines for Better Performance" http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA4180/14.5?SHELF=cee2bkc0&DT=20100628162151 If your calling Assembler program is not LE-conforming, go to "z/OS V1R13.0 Language Environment Programming Guide", "5.3 Chapter 30. Using preinitialization services" to read about the use of CEEPIPI http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEEA21C0/5.3?SHELF=cee2bkc0&DT=20110618162445 -- Regards, Gord Tomlin Action Software International (a division of Mazda Computer Corporation) Tel: (905) 470-7113, Fax: (905) 470-6507 On 2011-10-14 09:33, McKown, John wrote: > I know that I've seen somebody do this before. But I cannot remember how they >did it. Does anybody have a code snippet that shows how to call a C subroutine >like sprintf() or strncmp() from HLASM? Also the compile& link JCL would be >appreciated. I've tried reading the LE manuals and the C manuals, but I'm just >not finding it. > > -- > John McKown > Systems Engineer IV > IT > > Administrative Services Group > > HealthMarkets(r) > > 9151 Boulevard 26 * N. Richland Hills * TX 76010 > (817) 255-3225 phone * > [email protected] * www.HealthMarkets.com > > Confidentiality Notice: This e-mail message may contain confidential or >proprietary information. If you are not the intended recipient, please contact >the sender by reply e-mail and destroy all copies of the original message. >HealthMarkets(r) is the brand name for products underwritten and issued by the >insurance subsidiaries of HealthMarkets, Inc. -The Chesapeake Life Insurance >Company(r), Mid-West National Life Insurance Company of TennesseeSM and The >MEGA >Life and Health Insurance Company.SM > >
