View previous topic :: View next topic |
Author |
Message |
Sreejith Intermediate
Joined: 02 Dec 2002 Posts: 155 Topics: 25 Location: N.Ireland
|
Posted: Mon Dec 02, 2002 8:39 am Post subject: To Cancel A TSO session |
|
|
To Cancel A TSO session use the following REXX code. you can opy this to SYSEXEC library and use as a tso command
Code: |
/* Rexx */
/* Rexx - To Logoff from a TSO Session */
/* */
/* Usage : TSO KILLME userid */
/* ----------------------------------------------------------------- */
ARG UID
clear
if UID=USERID() then
Say 'Do you want to logoff from your TSO session (Y/N)'
else
do
Say ' !!!!!! WARNING: This is not Your Userid. !!!!!!'
Say ' !!!!!! WARNING: This is not Your Userid. !!!!!!'
Say ' !!!!!! WARNING: This is not Your Userid. !!!!!!'
Say ' !!!!!! WARNING: This is not Your Userid. !!!!!!'
Say ' !!!!!! WARNING: This is not Your Userid. !!!!!!'
Say ' '
Say 'Are you sure you want to logoff TSO session of' UID '(Y/N)'
end
PULL ANSWER
if answer='Y' then,
do
Say "Logging off TSO Session of " UID
can_card.1 = "/*$VS,'C U="||UID||"'"
"FREE ATTRLIST(SBM)"
"FREE F(SUBMIT)"
"ATTRIB SBM LRECL(80) RECFM(F)"
"ALLOC F(SUBMIT) SYSOUT(A) WRITER(INTRDR) USING(SBM)"
"EXECIO 2 DISKW SUBMIT (STEM can_card. FINIS"
"FREE ATTRLIST(SBM)"
"FREE F(SUBMIT)"
end
else
if UID=USERID() then
Say "Good Boy. Don't logoff. Keep working."
else
Say "Good Boy. Don't logoff. Let" UID "working."
|
|
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Tue Dec 24, 2002 9:04 am Post subject: |
|
|
Hi
I tried this rexx, but my session was not getting logged off(I was trying for my own session, which I am working).. rexx is getting executed but session is still active.. can you pls tell me what the problem is..
Anand |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
|
Posted: Tue Dec 24, 2002 9:37 am Post subject: |
|
|
Anand,
Here is another way to cancel the userid.The following jcl will give you the desired results.
Code: |
//YOUR JOB CARD
//*
//STEP0100 EXEC PGM=IEFBR14
// COMMAND 'C U=XXXXXXX'
|
XXXXXX - Is Your TID
Hope this helps...
cheers
kolusu |
|
Back to top |
|
|
Anand_R Intermediate
Joined: 24 Dec 2002 Posts: 189 Topics: 60
|
Posted: Thu Dec 26, 2002 4:06 am Post subject: |
|
|
Kolusu,
I tried to cancel the session using your jcl.. but not getting cancelled. I was trying from the sam id which I am planning to cancel..
And how to specify particular system name( i mean sys1,sys2,sys3... etc) in that job..
I am pasting my job here..
//G1NX62TE JOB (CEFD-CEFTSOU,020),'CAN SESSION',CLASS=9,
// MSGCLASS=X,NOTIFY=&SYSUID
//*
//STEP0100 EXEC PGM=IEFBR14
// COMMAND 'C U=G1NX62T' |
|
Back to top |
|
|
DaveyC Moderator
Joined: 02 Dec 2002 Posts: 151 Topics: 3 Location: Perth, Western Australia
|
Posted: Thu Dec 26, 2002 7:55 am Post subject: |
|
|
Your systems programmers can turn off system commands from JCL input streams. And for good reason... _________________ Dave Crayford |
|
Back to top |
|
|
faisal Beginner
Joined: 05 Dec 2002 Posts: 8 Topics: 1
|
Posted: Fri Dec 27, 2002 1:17 pm Post subject: |
|
|
You should use the batch SDSF job for cancelling your id. I wrote a small java tool to run on the PC. It cancels a user-id by submitting a batch sdsf job via FTP. That way you won't need to login with another userid to submit the cancel jcl. If interested I can send the source code via email. |
|
Back to top |
|
|
naveen Beginner
Joined: 03 Dec 2002 Posts: 90 Topics: 31
|
Posted: Tue Dec 31, 2002 10:06 am Post subject: |
|
|
I don't know whether it works everywhere or not, Atleast on my installation , for terminating a TSO session ,you only need to write a '\t' on any command line ,and my TSO session get killed. |
|
Back to top |
|
|
dorkhead Beginner
Joined: 07 Jan 2003 Posts: 25 Topics: 0 Location: Lux
|
Posted: Tue Jan 07, 2003 11:56 am Post subject: |
|
|
try this bit of code :
Code: |
/* rexx */
arg uzr
if uzr='' then uzr=userid()
queue 'c u='uzr
queue 'end'
oper
|
_________________ Dorkhead |
|
Back to top |
|
|
cilesiz Beginner
Joined: 08 Jan 2003 Posts: 1 Topics: 0
|
Posted: Wed Jan 08, 2003 1:59 am Post subject: |
|
|
Or try it with SDSF:
Code: | /* Rexx KANCEL
!
! Data Set : RE03063.MACRO.EXEC(KANCEL)
! Name : Ugur Cilesiz
! Date : 08.01.2003
! Parameter : UserId
! Description: CANCEL User from TSO or ISPF- Session
!
! TSO %KANCEL UserId
*/
Arg User_ID
If User_Id = ''
Then User_ID = Userid()
"CLEAR"
If User_ID <> Userid()
Then Do
Say ' !! ACHTUNG: WOLLEN SIE WIRKLICH USER = '!! User_ID
Say ' !! CANCELN ???????'
Say ' '
Say ' !! C U='!! User_ID ' (Y/N) ?'
Pull Antwort
If Antwort = 'Y'
Then Do
Signal DoIt
End
Else Signal Exitus
End
DoIt:
SDSFCMD = "/C U=" !! User_ID
"ISPEXEC SELECT PGM(ISFISP) PARM("SDSFCMD")"
Exitus:
Exit |
|
|
Back to top |
|
|
satyajit_datta Beginner
Joined: 03 Oct 2004 Posts: 5 Topics: 1
|
Posted: Wed Feb 04, 2009 5:11 am Post subject: |
|
|
//YOUR JOB CARD
//*
//STEP0100 EXEC PGM=IEFBR14
// COMMAND 'C U=XXXXXXX'
Works fine.
Can anyone explain how it works. |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Feb 04, 2009 8:12 am Post subject: |
|
|
What you are doing is running a job. A job needs a step to execute hence the IEFBR14. As you know, IEFBR14 does not do anythig itself. However, the work is done by the COMMAND keyword which is executed at job execution time and issues the command to the OS (c u=userid) _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
bob_buxton Beginner
Joined: 20 Dec 2002 Posts: 44 Topics: 0 Location: Hampshire, England
|
Posted: Wed Feb 04, 2009 10:21 am Post subject: |
|
|
Nic Clouston wrote: | What you are doing is running a job. A job needs a step to execute hence the IEFBR14. As you know, IEFBR14 does not do anythig itself. However, the work is done by the COMMAND keyword which is executed at job execution time and issues the command to the OS (c u=userid) |
Actually the COMMAND is processed at JCL interpretation time not when the job actually executes.
If you ran a multistep Job
/YOUR JOB CARD
//*
//STEP0100 EXEC PGM=WAIT1HR
//STEP0200 EXEC PGM=IEFBR14
// COMMAND 'C U=XXXXXXX'
The command would be executed before the Wait an hour program and not after it has run.
In a production environment it is very dangerous to allow any user to cancel jobs or issue other operator commands so the use of Commands in JCL is usually banned. _________________ Bob Buxton
Ex Websphere MQ for zOS development |
|
Back to top |
|
|
Nic Clouston Advanced
Joined: 01 Feb 2007 Posts: 1075 Topics: 7 Location: At Home
|
Posted: Wed Feb 04, 2009 3:10 pm Post subject: |
|
|
I suspected that it would be at interpretation time but was not sure so erred on the side of caution. Anyway, I hope Satyajit understands what is happening. _________________ Utility and Program control cards are NOT, repeat NOT, JCL. |
|
Back to top |
|
|
|
|