If you want a CB chaining approach navigate PSA->TCB->STCB->JSAB and pick up the JSABJBID. The first character will be T for TSO and J for a batch job. Probably not a GUPI programming interface.
Charles -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of John McKown Sent: Friday, June 30, 2017 10:26 AM To: [email protected] Subject: Re: Assembler program On Fri, Jun 30, 2017 at 11:52 AM, PINION, RICHARD W. < [email protected]> wrote: > I need a program or snippet of code that determines if the program is > being executed from a TSO user or a batch job. > FIRST TENNESSEE > > EXTRACT macro: https://www.ibm.com/support/knowledgecenter/en/SSLTBW_2.1.0/com.ibm.zos.v2r1.ieaa200/iea3a2_Description6.htm Perhaps something like: EXTRACT ANSWERS,'S',FIELDS=(TSO,PSB) LT R5_32,@PSB JZ NOTTSO NOT TSO L R4_32,@TSO CLI 0(R4_32),0 JE BATCH_TMP * RUNNING TSO FOREGROUND ... BATCH_TMP DS 0H * RUNNING TSO IN BATCH ... NOTTSO DS 0H * NOT TSO ADDRESS SPACE. ... ANSWERS DS 0F @TSO DS A @PSB DS A ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
