Discussion:
[hercules-os380] detecting TSO
kerravon86@yahoo.com.au [hercules-os380]
2018-06-15 22:03:29 UTC
Permalink
Some time ago I made this change:

- L R2,TCBJSCB
- USING IEZJSCB,R2
- SLR R3,R3
- ICM R3,B'0011',JSCBTJID
- ST R3,TYPE non-zero means TSO, 3rd parm to START
+* Find out if this is TSO or not
+ L R3,PSAAOLD-PSA get address of my ASCB
+ USING ASCB,R3
+ ICM R4,B'1111',ASCBASXB
+ BZ FINTSO
+ USING ASXB,R4
+ ICM R5,B'1111',ASXBLWA
+FINTSO DS 0H
+ ST R5,TYPE non-zero means TSO, 3rd parm to START


to detect whether this is a TSO environment
or not.

I believe longer ago than that I used to detect
the parameter string to see if there were 2
x'00'.

I have found a problem, probably with the
new code. When I do:

call 'sys2.linklib(pdptest)'

from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch.

So what should I do now? Go back to the
JSCBTJID or go back to detecting the
parm string or something else?

Thanks. Paul.
Joe Monk joemonk64@gmail.com [hercules-os380]
2018-06-15 23:01:54 UTC
Permalink
"from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch."

Wouldn't IKJPUTL would be used to give you the three stars?

Joe
- L R2,TCBJSCB
- USING IEZJSCB,R2
- SLR R3,R3
- ICM R3,B'0011',JSCBTJID
- ST R3,TYPE non-zero means TSO, 3rd parm to START
+* Find out if this is TSO or not
+ L R3,PSAAOLD-PSA get address of my ASCB
+ USING ASCB,R3
+ ICM R4,B'1111',ASCBASXB
+ BZ FINTSO
+ USING ASXB,R4
+ ICM R5,B'1111',ASXBLWA
+FINTSO DS 0H
+ ST R5,TYPE non-zero means TSO, 3rd parm to START
to detect whether this is a TSO environment
or not.
I believe longer ago than that I used to detect
the parameter string to see if there were 2
x'00'.
I have found a problem, probably with the
call 'sys2.linklib(pdptest)'
from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch.
So what should I do now? Go back to the
JSCBTJID or go back to detecting the
parm string or something else?
Thanks. Paul.
kerravon86@yahoo.com.au [hercules-os380]
2018-06-16 10:34:46 UTC
Permalink
Post by Joe Monk ***@gmail.com [hercules-os380]
Post by ***@yahoo.com.au [hercules-os380]
from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch."
Wouldn't IKJPUTL would be used to give you the three stars?
It is TSO that puts those stars on the terminal
I believe, not my application, and I assume that
TSO does a TPUT rather than invoke IKJPUTL.

BFN. Paul.
Joe Monk joemonk64@gmail.com [hercules-os380]
2018-06-16 12:29:41 UTC
Permalink
"and I assume that TSO does a TPUT rather than invoke IKJPUTL"

IKJPUTL is an alias of IKJEFT40.

IKJEFT80 which is the terminal command processor calls IKJPUTL using the
PUTLINE macro.

* /*****************************************************************/
00934000
* /* */ 00935000
* /* ISSUE THE PUTLINE MACRO TO INFORM THE TERMINAL USER */ 00936000

* /* */ 00937000
* /*****************************************************************/ 00938000
* 0294 00939000
* GENERATE; 0294 00940000
PUTLINE OUTPUT=((3),MULTLVL),TERMPUT=(EDIT),MF=(E,(1)) 00941000
* R14=R4; /* RESTORE RETURN ADDRESS */ 00942000
LR R14,R4 0295 00943000
* END PUT2MSG; /* END PUT2MSG PROCEDURE */ 00944000



PUTLINE calls IKJPUTL...

TM 444(15),B'10000000' IS PUTLINE LOADED ? 12766002
BNO IKJ@&SYSNDX NO - BRANCH TO LINK 12770002
L 15,444(0,15) YES - BALR TO PUTLINE 12774002
BALR 14,15 12778002
B IKJ$&SYSNDX 12782002
IKJ@&SYSNDX LINK EP=IKJPUTL LINK TO PUTLINE 12786002
IKJ$&SYSNDX DS 0H 12790002

So, your assumption appears to be incorrect.

Joe
Post by ***@yahoo.com.au [hercules-os380]
Post by Joe Monk ***@gmail.com [hercules-os380]
Post by ***@yahoo.com.au [hercules-os380]
from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch."
Wouldn't IKJPUTL would be used to give you the three stars?
It is TSO that puts those stars on the terminal
I believe, not my application, and I assume that
TSO does a TPUT rather than invoke IKJPUTL.
BFN. Paul.
Tony Harminc tharminc@gmail.com [hercules-os380]
2018-06-15 23:23:42 UTC
Permalink
Post by ***@yahoo.com.au [hercules-os380]
- L R2,TCBJSCB
- USING IEZJSCB,R2
- SLR R3,R3
- ICM R3,B'0011',JSCBTJID
- ST R3,TYPE non-zero means TSO, 3rd parm to START
Some time ago...? This would've stopped working with the very first
release of MVS (2.0) in 1972 or so.
Post by ***@yahoo.com.au [hercules-os380]
+* Find out if this is TSO or not
+ L R3,PSAAOLD-PSA get address of my ASCB
+ USING ASCB,R3
+ ICM R4,B'1111',ASCBASXB
+ BZ FINTSO
+ USING ASXB,R4
+ ICM R5,B'1111',ASXBLWA
+FINTSO DS 0H
+ ST R5,TYPE non-zero means TSO, 3rd parm to START
to detect whether this is a TSO environment or not.
It all depends on what you mean by a "TSO environment". There are
several possibilities, including at least "logged on to a TSO
terminal", "running under a TSO Terminal Monitor Program (TMP) in
batch or at a terminal", "running under one of the several services
(mostly newer than MVS/370) that provide a TSO-like environment",
"running under any program that acts like a TMP".
Post by ***@yahoo.com.au [hercules-os380]
I believe longer ago than that I used to detect
the parameter string to see if there were 2 x'00'.
2 x'00' where?
Post by ***@yahoo.com.au [hercules-os380]
I have found a problem, probably with the
call 'sys2.linklib(pdptest)'
from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch.
I'm glad you see it that way... I thought you had a different view
some time ago.
Post by ***@yahoo.com.au [hercules-os380]
So what should I do now? Go back to the
JSCBTJID
No, it won't work. In MVS that field is the ASID, and you can't not
have a non-zero one.
Post by ***@yahoo.com.au [hercules-os380]
or go back to detecting the
parm string or something else?
If you want to essentially discover both "will IKJPUTL work in this
environment" and "does the end user expect IKJPUTL to be used in this
environment", then probably analyzing the argument(s) is a good bet.
It's doubtless not perfect, but you can get the right answer almost
all the time, and I think the failing cases will be only those crafted
to defeat your scheme.

Tony H.
kerravon86@yahoo.com.au [hercules-os380]
2018-06-16 10:32:34 UTC
Permalink
Post by Tony Harminc ***@gmail.com [hercules-os380]
- L R2,TCBJSCB
- USING IEZJSCB,R2
- SLR R3,R3
- ICM R3,B'0011',JSCBTJID
- ST R3,TYPE non-zero means TSO, 3rd parm to START
Some time ago...? This would've stopped working with the very first
release of MVS (2.0) in 1972 or so.
Ok, I found out that although I had that code in
place, I was ignoring the result.
Post by Tony Harminc ***@gmail.com [hercules-os380]
It all depends on what you mean by a "TSO environment". There are
several possibilities, including at least "logged on to a TSO
If I have been invoked by TSO as if I was a TSO CP
like "listds" is.
Post by Tony Harminc ***@gmail.com [hercules-os380]
I believe longer ago than that I used to detect
the parameter string to see if there were 2 x'00'.
2 x'00' where?
Here is the code:

parmLen = ((unsigned int)p[0] << 8) | (unsigned int)p[1];
if ((parmLen > 0) && (p[2] == 0)) /* assume TSO */
...
progLen = ((unsigned int)p[2] << 8) | (unsigned int)p[3];
parmLen -= (progLen + 4);

And it is looking for a single x'00', not two.
Post by Tony Harminc ***@gmail.com [hercules-os380]
from my TSO session, it abends in IKJPUTL,
but I am not expecting PUTLINE to be used
in that circumstance. I expect that when
"call" is used, it should go through the same
logic as batch.
I'm glad you see it that way... I thought you had a different view
some time ago.
Not that I remember.
Post by Tony Harminc ***@gmail.com [hercules-os380]
If you want to essentially discover both "will IKJPUTL work in this
environment" and "does the end user expect IKJPUTL to be used in this
environment", then probably analyzing the argument(s) is a good bet.
Ok, thanks.

BFN. Paul.
Loading...