Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Checking the SPOOL for no of jobs using REXX
Goto page 1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
chinna

New User


Joined: 04 Oct 2005
Posts: 6
Location: Hyderabad

PostPosted: Thu Mar 02, 2006 12:19 am    Post subject: Checking the SPOOL for no of jobs using REXX
Reply with quote

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
View user's profile Send private message
References
PostPosted: Thu Mar 02, 2006 12:19 am    Post subject: Re: Checking the SPOOL for no of jobs using REXX Reply with quote

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 1802
Location: Israel

PostPosted: Thu Mar 02, 2006 12:53 am    Post subject:
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 192
Location: India

PostPosted: Thu Mar 02, 2006 9:12 am    Post subject:
Reply with quote

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
View user's profile Send private message
Sathishk

New User


Joined: 16 Feb 2006
Posts: 8

PostPosted: Mon Mar 06, 2006 7:04 pm    Post subject: Re: Checking the SPOOL for no of jobs using REXX
Reply with quote

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
View user's profile Send private message
amitava
Warnings : 1

Active User


Joined: 30 Oct 2005
Posts: 192
Location: India

PostPosted: Tue Mar 07, 2006 9:47 am    Post subject:
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 270
Location: Basel, Switzerland

PostPosted: Thu Mar 09, 2006 8:56 pm    Post subject:
Reply with quote

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
View user's profile Send private message
tarunsharma1981

New User


Joined: 18 Jul 2006
Posts: 1

PostPosted: Fri Dec 08, 2006 8:57 pm    Post subject: Re: Checking the SPOOL for no of jobs using REXX
Reply with quote

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
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 45
Location: Bangalore

PostPosted: Thu Feb 08, 2007 7:14 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 30
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 1:05 am    Post subject: Re: Checking the SPOOL for no of jobs using REXX
Reply with quote

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
View user's profile Send private message
Steve Coalbran

New User


Joined: 01 Feb 2007
Posts: 30
Location: Stockholm, Sweden

PostPosted: Mon Feb 12, 2007 1:19 am    Post subject: Re: Checking the SPOOL for no of jobs using REXX
Reply with quote

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
View user's profile Send private message
Huzefa

New User


Joined: 05 Dec 2006
Posts: 45
Location: Bangalore

PostPosted: Mon Apr 30, 2007 5:09 pm    Post subject:
Reply with quote

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
View user's profile Send private message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 21
Location: chennai

PostPosted: Wed Mar 12, 2008 4:09 pm    Post subject:
Reply with quote

by using this can i get CPU time from spool
Back to top
View user's profile Send private message
kavya123

New User


Joined: 11 Jul 2007
Posts: 35
Location: hyderabad

PostPosted: Thu Mar 13, 2008 10:41 am    Post subject:
Reply with quote

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
View user's profile Send private message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 21
Location: chennai

PostPosted: Thu Mar 13, 2008 11:57 am    Post subject:
Reply with quote

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 icon_wink.gif
Back to top
View user's profile Send private message
kavya123

New User


Joined: 11 Jul 2007
Posts: 35
Location: hyderabad

PostPosted: Thu Mar 13, 2008 4:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 HoursGoto page 1, 2, 3  Next
Page 1 of 3