|
|
| Author |
Message |
chinna
New User
Joined: 04 Oct 2005 Posts: 6 Location: Hyderabad
|
|
|
|
Hi Group,....
I have requirement to check the SPOOl of all the team members to see how many jobs are present in their spool. For any member, if the no.of jobs exceed by a given number (say30), I need to send a email to that particular team member asking to delete unnecessary jobs in order to save space.
Now I am planning to automate the above process using REXX. I know how to send emails using rexx. But I was wondering how can I check the SPOOL of other members using REXX. All the jobs of a particular team member starts with his mainframe id. I am wondering if the SPOOL info is stored in any PS, so that I can get the info from it. If yes, plz tell me the name of that PS.
If any of you have any different approach for my requirement, please let me know, I would be greately thankful!!!
Regards,
Praveen. |
|
| Back to top |
|
 |
References
|
Posted: Thu Mar 02, 2006 12:19 am Post subject: Re: Checking the SPOOL for no of jobs using REXX |
 |
|
|
 |
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 1898 Location: Israel
|
|
|
|
Hi -
What you need is SDSF in batch from within REXX. Please search this forum (and the "neighbour" forum) for examples I had posted in the past.
O. |
|
| Back to top |
|
 |
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 192 Location: India
|
|
|
|
Hi Chinna,
I am sending u a sample code for monitoring the spool for a job - ISDXI42M.
| Code: |
/* rexx */
address tso
"alloc f(isfin) tracks space(1) reu" /* used by sdsf */
"alloc f(isfout) new delete reu " , /* used by sdsf */
"tracks space(100,100) lrecl(133) recfm(f,b,a) dsorg(ps)"
"alloc f(tempprt) da('<DSN>') shr"
jobid = 'isdxi42m'
queue "pre isdxi42*" /* sdsf commands in batch*/
queue "st"
/*queue "filter jobid eq "jobid*/
queue "find " jobid
queue "++?" /* open output of job */
queue "find NDMCMDS"
queue "++s" /* browse msgusr dataset */
queue "print file tempprt " /* print to temp dataset */
queue "print 1 999999"
queue "print close"
queue "end"
queue "exit"
"execio" queued()" diskw isfin (finis" /* input to sdsf batch */
address ispexec "select pgm(isfafd) parm('++25,80')"/* invoke sdsf */
exit
|
|
|
| Back to top |
|
 |
Sathishk
New User
Joined: 16 Feb 2006 Posts: 8
|
|
|
|
Hi Amit,
How can i know the return code of the job in rexx itself?
i.e
My requirement is I am submitting a job from rexx & based on its completion code (RC) I have to display a output file name created in that job. How this can be achieved?
Thanks
Sathish |
|
| Back to top |
|
 |
amitava Warnings : 1 Active User
Joined: 30 Oct 2005 Posts: 192 Location: India
|
|
|
|
Hey Sathisk,
Whatever the code I have already sent in this post will do that thing.
However I am sending you the code for checking the return code. Ok! Just run the following REXX routine and then add the logic in your REXX routine to read the DS - AAAA.BBBB.CCCC(Here) and find out the return code.
| Code: |
/* rexx */
address tso
"alloc f(isfin) tracks space(1) reu" /* used by sdsf */
"alloc f(isfout) new delete reu " , /* used by sdsf */
"tracks space(100,100) lrecl(133) recfm(f,b,a) dsorg(ps)"
"alloc f(tempprt) da('[i]AAAA.BBBB.CCCC[/i]') shr"
jobid = 'isdxi42m'
queue "pre isdxi42*" /* sdsf commands in batch*/
queue "st"
/*queue "filter jobid eq "jobid*/
queue "print file tempprt " /* print to temp dataset */
queue "print 1 999999"
queue "print close"
queue "end"
queue "exit"
"execio" queued()" diskw isfin (finis" /* input to sdsf batch */
address ispexec "select pgm(isfafd) parm('++25,80')"/* invoke sdsf */
exit
|
Now add the logic what I have mentioned earlier. |
|
| Back to top |
|
 |
martin9
Active User
Joined: 01 Mar 2006 Posts: 270 Location: Basel, Switzerland
|
|
|
|
hy sathisk,
the above example is a very good one...
just change the filter command to filter
the OWNER parameter, because the job's name
can be of different name...
martin9
note: you can use any sdsf command, as you are used to do
yourself in online. sdsf batch is a simulated onlien session... |
|
| Back to top |
|
 |
tarunsharma1981
New User
Joined: 18 Jul 2006 Posts: 1
|
|
|
|
Hi Everybody,
i also have a similar requirement in CMS, i want a way to check the return codes of steps in a job using REXX. Its more like running a rexx code to know whether a job ran fine or had any unacceptable returncode on a step.
Any help will be highly appreciated. |
|
| Back to top |
|
 |
Huzefa
New User
Joined: 05 Dec 2006 Posts: 49 Location: Bangalore
|
|
|
|
Hi all
I just don't want to save the spool output in the file, but insead put it in a stem.
How can I do that |
|
| Back to top |
|
 |
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 30 Location: Stockholm, Sweden
|
|
|
|
Sounds like EXECIO might be what you're looking for ?!
| Code: |
"EXECIO * DISKR" filename "(STEM" yourstem" FINIS" |
(and tarunsharma1981 EXECIO comes from CMS ?!) |
|
| Back to top |
|
 |
Steve Coalbran
New User
Joined: 01 Feb 2007 Posts: 30 Location: Stockholm, Sweden
|
|
|
|
| of course I suspect SDSF doesn't run under CMS? (Les K?! are you on this forum - what does this function in VM/CMS ?) |
|
| Back to top |
|
 |
Huzefa
New User
Joined: 05 Dec 2006 Posts: 49 Location: Bangalore
|
|
|
|
Hi All
I tried with the below code to get the spool details for a particular jobname or jobid but None of the output got listed. Could anyone tell me why
/* REXX */
ADDRESS TSO
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"
"ALLOC F(TEMPPRT) DA('NBDY8ZO.TEMP.JOB2') SHR"
JOBID = "JOB04056"
QUEUE "PRE NBDLBWU*" /* SDSF COMMANDS IN BATCH*/
QUEUE "ST"
QUEUE "FILTER JOBNAME " JOBID
QUEUE "PRINT FILE TEMPPRT" /* PRINT TO TEMP DATASET */
QUEUE "PRINT 1 999999"
QUEUE "PRINT CLOSE"
QUEUE "END"
QUEUE "EXIT"
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* INPUT TO SDSF BATCH */
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
EXIT |
|
| Back to top |
|
 |
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 29 Location: chennai
|
|
|
|
| by using this can i get CPU time from spool |
|
| Back to top |
|
 |
kavya123
New User
Joined: 11 Jul 2007 Posts: 35 Location: hyderabad
|
|
|
|
Thilakvs,
By using the above code i am not able to get CPU time...
Could you please help.
I am getting the tempory dataset as an empty file. |
|
| Back to top |
|
 |
thilakvs Warnings : 1 New User
Joined: 07 Aug 2007 Posts: 29 Location: chennai
|
|
|
|
Kavya,
I m also trying the same requirement..if i got the results i let u know..mean while if u got the result..let me know  |
|
| Back to top |
|
 |
kavya123
New User
Joined: 11 Jul 2007 Posts: 35 Location: hyderabad
|
|
|
|
Thilakvs,
For the below code pass JOBNAME JOBID as arguments.
also replace 'U153134.TEMP' with your own flat file(PS).
I have used this in two places in my code.
The 1st one is rexx exec and the next code is macro.
copy both of them in to different members and try.
| Code: |
ADDRESS TSO
ARG JOBNAME JOBID
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */
"ALLOC F(ISFOUT) NEW DELETE REU " , /* USED BY SDSF */
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"
"ALLOC F(TEMPPRT) DA('U153134.TEMP') SHR"
QUEUE "SET CONFIRM OFF"
QUEUE "OWNER *"
QUEUE "PREFIX *"
QUEUE "ST"
QUEUE "SELECT "JOBNAME JOBID
QUEUE "AFD REFRESH"
QUEUE "FIND "JOBNAME
QUEUE "++?"
QUEUE "FIND JESYSMSG"
QUEUE "++S"
QUEUE "PRINT FILE TEMPPRT"
QUEUE "PRINT"
QUEUE "PRINT CLOSE"
QUEUE "END"
QUEUE " "
"EXECIO" QUEUED()" DISKW ISFIN (FINIS" /* INPUT TO SDSF BATCH */
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++25,80')"/* INVOKE SDSF */
ADDRESS TSO "FREE F(ISFIN,ISFOUT,TEMPPRT)"
ADDRESS ISPEXEC "EDIT DATASET('U153134.TEMP') MACRO(MCTIME)"
EXIT |
Macro:
to display CPU time.
| Code: |
ADDRESS ISREDIT
"ISREDIT MACRO"
"(D) = DATASET"
"CURSOR = 1 1"
"FIND IEF376I WORD LAST"
"(R,C) = CURSOR"
/*SAY R C*/
"(STR) = LINE .ZCSR"
/*SAY STR*/
P1 = POS('CPU',STR)
/*SAY 'P1=' P1*/
STR = SUBSTR(STR,P1,20)
SAY STR
"END" |
|
|
| Back to top |
|
 |
|
|