If you need the stepname the code I posted will work, assuming you reference tiocjstn in the last line.
Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Barkow, Eileen Sent: Thursday, January 11, 2018 5:36 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C code to get running job name. __jobname(), __stepname() etc are not documented in the XL C/C++ Runtime Library Reference Version 2 Release 2 SC14 manual. Where are they documented? -----Original Message----- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Thomas David Rivers Sent: Thursday, January 11, 2018 8:19 AM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Re: C code to get running job name. John McKown wrote: >On Wed, Jan 10, 2018 at 11:19 AM, Thomas David Rivers ><riv...@dignus.com> >wrote: > > > >> >>> >>> >>> >>In Systems/C , this is simply: >> >> #include <machine/tiot.h> >> #include <stdio.h> >> >> main() >> { >> printf("Job name is %s\n", __jobname()); } >> >> >> >> >That is a nice enhancement for the C language under z/OS. As a general >rule, I _try_ to avoid any functions which start with one or two >underscores. These are generally "reserved" for the implementer and so may >not be available on a different compiler. The __jobname() is a nice example >of a reasonable extension for z/OS, or z/VSE. Another nice one might be >__userid() to return the RACF id under which the process is running. > > > Hi John, Yes - identifiers that begin with double-underscore are reserved for the C implementation; that's why our implementation uses those (to avoid conflicts.) Along with __jobname(), we have: __stepname() __procname() __get_cpuid() __userid() which can make it very handy indeed. The Dignus C library manual has more details. - Dave R. - -- riv...@dignus.com Work: (919) 676-0847 Get your mainframe programming tools at http://www.dignus.com ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ________________________________ This e-mail, including any attachments, may be confidential, privileged or otherwise legally protected. It is intended only for the addressee. If you received this e-mail in error or from someone who was not authorized to send it to you, do not disseminate, copy or otherwise use this e-mail or its attachments. Please notify the sender immediately by reply e-mail and delete the e-mail from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN