Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
chinna

New User


Joined: 04 Oct 2005
Posts: 5
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

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
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: 186
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: 186
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: 287
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: 85
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: 85
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: 85
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: 85
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: 27
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
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
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: 27
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
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
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
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 27
Location: chennai

PostPosted: Fri Mar 14, 2008 12:33 pm    Post subject:
Reply with quote

Kavya,

Thanks a lot..but i m getting MCTIME NOT FOUND error.. icon_redface.gif

how can i clear it..
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Fri Mar 14, 2008 12:44 pm    Post subject:
Reply with quote

Hi Thilakvs

I used IEF376I word in the macro which will be the last statement in JESYSMSG and it will give the CPU time as follows.

Code:
IEF376I  JOB/MAPCOMP$/STOP  2008071.1837 CPU    0MIN 00.53SEC SRB    0MIN 00.00SEC


Check your JESYSMSG for IEF376I in the spool and then try it again.


Kavya
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Fri Mar 14, 2008 12:49 pm    Post subject:
Reply with quote

Hi Thilakvs,

Sorry for the confusion made by me...

MCTIME is the Macro(name which i have passed in the rexx exec to call macro)
So you please copy it in a member and save it as MCTIME.

The macro code was already provided to you.
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Thu Mar 20, 2008 10:08 am    Post subject:
Reply with quote

Hi Thilakvs,
You can also use this code to find the CPU time
but as i already said 'U153134.TEMP' should be replaced by your own flat file.
It will be created at the begining and deleted automatically at the end.


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 DSN('U153134.TEMP') NEW SPACE(10 5) CYLINDERS   
   BLKSIZE(800) LRECL(80) RECFM(F B)"                     
"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)"                           
"ALLOC F(INPDD) DA('U153134.TEMP') SHR"                               
X=OUTTRAP("SUB.")                                                     
"EXECIO * DISKR INPDD (STEM SUB. FINIS"                               
X=OUTTRAP("OFF")                                                     
P=SUB.0                                                               
P1 = POS('CPU',SUB.P)                                                 
IF P1 = 0 THEN SAY 'UNABLE TO FIND CPU TIME IN JESYSMSG IN SPOOL'     
ELSE DO                                                               
STR = SUBSTR(SUB.P,P1,20)                                             
SAY STR                                                               
END                                                                   
"FREE DD(INPDD)" 
"DELETE "U153134.TEMP""                                                   
EXIT           
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 205
Location: Bangalore

PostPosted: Mon Apr 07, 2008 6:46 pm    Post subject: Reply to: Checking the SPOOL for no of jobs using REXX
Reply with quote

Hi,

When i execute the below rexx code, i am getting the error:

IKJ56701I Missing dataset name
IKJ56701I Missing name of dataset to be allocated.
IRX0555E The input or output file ISFIN is not allocated. It can not be opened for I/O.
IRX067OE EXECIO error while trying to GET or PUT a record.

Code:

/********************** rexx ****************************/
ARG JOBNAME JOBID
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('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)"                             
EXIT 


So, I changed the code to replace:
"ALLOC F(ISFIN) TRACKS SPACE(1) REU" /* USED BY SDSF */
by
"ALLOC F(ISFIN) NEW DELETE REU " , /* USED BY SDSF */
"TRACKS SPACE(2) LRECL(133) RECFM(F,B,A) DSORG(PS)"

I don't know the DCB parameters for ISFIN dataset, but i assumed that
they will be same as ISFOUT's. But, now i am getting the below errors:

IEC020I 001-4,9AB,AAPQ,ISFIN,,VIO
IEC020I SYS08098.T074634.RA000.9AB.R0187344
IEC020I DCB=EROPT=ABE or an invalid code AND/OR no synad exit specified.

ISF012I SDSF abend system 001 at 00da5b4e in module ISFIO Offset Unknown

Is it a system error (with respect to address of error handling routing not being resolved) ? How can the error be resolved ?


Thanks,
Ajay
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
This topic is locked: you cannot edit posts or make replies. Rexx to create GDG by scanning JJ result krish.deepu CLIST & REXX 5 Tue Oct 25, 2016 5:32 pm
No new posts Replace repeated JCL with looping REXX prino CLIST & REXX 3 Thu Oct 13, 2016 5:30 am
This topic is locked: you cannot edit posts or make replies. Need to code a Rexx PGM sundaram.naveen CLIST & REXX 18 Thu Oct 06, 2016 6:45 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us