> -----Original Message----- > From: IBM Mainframe Assembler List > [mailto:[email protected]] On Behalf Of Tony Harminc > Sent: Friday, August 20, 2010 2:28 PM > To: [email protected] > Subject: Re: How can I best determine if assembler is running > under batch or uss > > On 20 August 2010 12:53, William M Klein > <[email protected]> wrote: > > If you are running as LE enabled, you can use the CEE3INF > callable service. > > > > > http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/CEE > A31B0/2.2.5.10 > > > > As indicated there, if the value of bit 6 of sys/subsys > tells you if you > > "Currently executing in a z/OS UNIX environment" > > That can be useful, but it doesn't have anything to say about running > under a UNIX shell. You can be running in a z/OS UNIX environment at > the same time as you are running in a TSO environment or a batch > environment. > > Tony H.
But what about UNIX bit ON, TSO bit OFF, CICS bit OFF, batch bit OFF? I'd likely use this function to see if UNIX, then use the BPX1ITY to see if filedescriptor 1 is a TTY. If both, then you are golden. Of course, fd/1 can still not be a TTY and the program running in the shell if stdout is redirected. So you could also try BPX1FST to see if fd/1 is valid or not. But then again, that could be true in batch. Could cheat and see if the $PPID is for /bin/sh? -- John McKown Systems Engineer IV IT Administrative Services Group HealthMarkets(r) 9151 Boulevard 26 * N. Richland Hills * TX 76010 (817) 255-3225 phone * (817)-691-6183 cell [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
