View previous topic :: View next topic |
Author |
Message |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Sun Feb 09, 2003 11:59 pm Post subject: How to execute SDSF Commands thro REXX |
|
|
In our firm, Usually, we lose connection to our mainframe server and most of the times the TSO session still remains alive, not allowing us to re-connect to the server. so, we used to login in to some other's id and go to SDSF panel and PURGE the job running with the TSO username. I want to automate this procedure by writing a REXX routine.
I read the articles on CANCELLING TSO SESSION, but that didn't work. How can we execute any SDSF commands. via REXX.
Please advise,
Thanks,
Phantom |
|
Back to top |
|
 |
blowbeat Beginner
Joined: 07 Feb 2003 Posts: 6 Topics: 0
|
Posted: Mon Feb 10, 2003 8:38 am Post subject: |
|
|
Hi,
I'm not sure why you would insist on using SDSF. Since what you'd obviously want is to issue an MVS CANCEL command, you could use (if authorisation is granted) the TSO CONSOLE command from a Rexx exec to issue MVS commands.
Cheers, Jan. |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Mon Feb 10, 2003 9:33 am Post subject: |
|
|
Hi Blowbeat,
Can you please elaborate on your suggestion. Some example would be very useful. I'm new to Rexx.
Thanks for your suggestion. |
|
Back to top |
|
 |
Phantom Data Mgmt Moderator

Joined: 07 Jan 2003 Posts: 1056 Topics: 91 Location: The Blue Planet
|
Posted: Mon Feb 10, 2003 10:38 pm Post subject: |
|
|
Blowbeat,
I just tried using TSO CONSOLE command. But it said that I don't have the authority. Is there a different solution to this problem.
Thanks,
Phantom |
|
Back to top |
|
 |
blowbeat Beginner
Joined: 07 Feb 2003 Posts: 6 Topics: 0
|
Posted: Tue Feb 11, 2003 3:22 am Post subject: |
|
|
Hi,
Not sure if you can issue commands when running SDSF in batch or from a Rexx.
There's a "SDSF Gudie & Reference" manual. I guess you could look up how to run SDSF in batch and use that in Rexx.
Alternatively you could go to your security admin and ask him access to TSO CONSOLE since you can already issue commands through SDSF.
Cheers, Jan. |
|
Back to top |
|
 |
dorkhead Beginner
Joined: 07 Jan 2003 Posts: 25 Topics: 0 Location: Lux
|
Posted: Wed Feb 12, 2003 8:03 am Post subject: |
|
|
hi there :
an exemple of issueing SDSF cmds thru REXX :
arg k7num
trace off
/* rexx */
/* developped by EAB for S/390er */
/* uses SLS commands, returns SLS info on a volume */
/* visit us at WWW.s390er.com */
"newstack"
x=MSG(OFF)
"free fi(sysin)"
"DELETE '"USERID()".test.sdsf'"
x=MSG(On)
queue "/#D v "k7num
queue "log "
queue "DOWN m"
queue "++all"
"ALLOC FI(ISFIN) UNIT(SYSDA) NEW DELETE"
"EXECIO" QUEUED() "DISKW ISFIN (finis"
"ALLOC FI(ISFOUT) DA('"USERID()".test.sdsf') new catalog Space(5,2)",
"TRACK RECFM(F B a) BLKSIZE(13300) LRECL(80) REUSE"
Address ispexec "select pgm(sdsf)"
say rc
"free fi(isfin isfout)"
address tso
"ALLOC FI(SYSOUT) DUMMY"
"ALLOC FI(SYSPRINT) DA(*)"
"ALLOC FI(SORTIN) DA('"USERID()".TEST.SDSF') SHR REUSE"
"ALLOC FI(SORTOUT) DA('"USERID()".TEST.SDSF') SHR REUSE"
"ALLOC FI(SORTWK01) DUMMY"
CMD.1=" 77,6,CH,EQ,C'"K7NUM"') "
CMD.2=" INCLUDE COND=(61,8,CH,EQ,C'SLS0600I',AND,"
CMD.3=" SORT FIELDS=COPY"
DO J=1 TO 3 /* write above sort statements into sysin file */
PUSH CMD.J
END
"ALLOC FI(sysIN) UNIT(SYSDA) NEW DELETE"
"EXECIO" QUEUED() "DISKW SYSIN (FINIS"
ADDRESS ISPEXEC "SELECT PGM(SORT) "
ADDRESS TSO
"FREE FI(SYSIN SYSPRINT SYSOUT SORTIN SORTWK01)"
"execio * diskr sortout (finis"
"FREE FI(sORTout)"
if queued()>1 then n=queued()
else n=1
do I=1 to queued()
parse pull var jj 1 . 38 77 k7 83 100 total 123
end
total=k7 ' 'total
x=MSG(OFF)
"DELETE '"USERID()".test.sdsf'"
x=MSG(On)
"delstack"
return total
to call it would be
say name('k7number')
have fun
u may change Address ispexec "select pgm(sdsf)" by a tso call only if u're running in batch, as u would need an ispf-
environment-compliant type of job. (basically IKJEFT01 pgm with ISPF
allocations). _________________ Dorkhead |
|
Back to top |
|
 |
|
|