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 Previous  1, 2, 3  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
thilakvs
Warnings : 1

New User


Joined: 07 Aug 2007
Posts: 29
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
References
PostPosted: Fri Mar 14, 2008 12:33 pm    Post subject: Re: Reply with quote

kavya123

New User


Joined: 11 Jul 2007
Posts: 35
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

New User


Joined: 11 Jul 2007
Posts: 35
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

New User


Joined: 11 Jul 2007
Posts: 35
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: 121
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
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 3201
Location: Brussels once more ...

PostPosted: Mon Apr 07, 2008 7:16 pm    Post subject:
Reply with quote

Take a look at http://www.ibmmainframes.com/viewtopic.php?t=20505

For CPU time I would suggest SMF records, which your performance and capacity people should already have the details that you might need.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 121
Location: Bangalore

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

Sorry for putting you all in confusion:

I had by mistake added SHR to the line:
"
Quote:
ALLOC F(ISFIN) TRACKS SPACE(1) SHR REU" /* USED BY SDSF */


That was causing 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.


Now my code looks like this:
********************** 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 MDS9AB"
QUEUE "ST"
QUEUE "SELECT "JOBNAME JOBID
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


But now the problem is when I have more than 1 jobs with same jobname but different jobid, it is always picking up first job with same jobname. It seems like filter or Select for Jobid is not working . Though it works well when i do it manually online.

eg:
MDS9ABTT JOB123454
MDS9ABTT JOB123463
MDS9ABTT JOB123474

When i execute my exec with arguents 'MDS9ABTT JOB123463',
it is putting JESYSMSG of MDS9ABTT JOB123454 into print dataset.

It works well when there is only one job with a jobname.

I tried replacing:
QUEUE "SELECT "JOBNAME JOBID
with

QUEUE "filter JOBNAME eq " JOBNAME " JobID eq " JOBID"

But, still it is picking first job only.

Thanks,
Ajay
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 121
Location: Bangalore

PostPosted: Tue Apr 08, 2008 8:38 pm    Post subject: Reply to: Checking the SPOOL for no of jobs using REXX
Reply with quote

Hi Friends,

Quote:
But now the problem is when I have more than 1 jobs with same jobname but different jobid, it is always picking up first job with same jobname.
It seems like filter or Select for Jobid is not working . Though it works well when i do it manually online.

eg:
MDS9ABTT JOB123454
MDS9ABTT JOB123463
MDS9ABTT JOB123474

When i execute my exec with arguents 'MDS9ABTT JOB123463',
it is putting JESYSMSG of MDS9ABTT JOB123454 into print dataset.

It works well when there is only one job with a jobname.

I tried replacing:
QUEUE "SELECT "JOBNAME JOBID
with

QUEUE "filter JOBNAME eq " JOBNAME " JobID eq " JOBID"

But, still it is picking first job only.

Thanks,
Ajay
Back to top
View user's profile Send private message
kavya123

New User


Joined: 11 Jul 2007
Posts: 35
Location: hyderabad

PostPosted: Wed Apr 09, 2008 4:34 pm    Post subject:
Reply with quote

Hi,

see i have included a delete statement at the end so that after reading the CPU time the PS created was deleted and after you use it second time for other jobname and job id new lines will be printed in the same PS.

Code:
"DELETE "U153134.TEMP""



MAy be you are getting the same value because it is displaying the same value from the PS always when ever you run the macro.

Once check the PS wether changes are reflected if you give a new jobname and jobid.
Back to top
View user's profile Send private message
Ashwin_mudikon

New User


Joined: 03 Apr 2007
Posts: 33
Location: Chennai

PostPosted: Wed Apr 09, 2008 6:05 pm    Post subject:
Reply with quote

Chinna,

Use outtrap funtion with the "STATUS" command. You will get the status of all the jobs in the stem that u ve given in the outtrap. stem.0 will be the no of jobs.
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 121
Location: Bangalore

PostPosted: Wed Apr 09, 2008 7:39 pm    Post subject: Reply to: Checking the SPOOL for no of jobs using REXX
Reply with quote

Hi,

I am not using the macro. I am allocating the temporary print file before running the exec. The exec should write the JESYSMSG to it.

But now the problem is:
When I have more than 1 jobs with same jobname but different jobid, it is always picking up first job with same jobname. It seems like filter or Select for Jobid is not working . Though it works well when i do it manually online.

For eg:
MDS9ABTT JOB123454
MDS9ABTT JOB123463
MDS9ABTT JOB123474

When i execute my exec with arguents 'MDS9ABTT JOB123463',
it is putting JESYSMSG of MDS9ABTT JOB123454 into print dataset.

It works well when there is only one job with a jobname.

I tried replacing:
QUEUE "SELECT "JOBNAME JOBID
with

QUEUE "filter JOBNAME eq " JOBNAME " JobID eq " JOBID"

But, still it is picking first job only.

code:
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 MDS9AB"
QUEUE "ST"
QUEUE "SELECT "JOBNAME JOBID
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


Please suggest.

Thanks,
Ajay
Back to top
View user's profile Send private message
Marso

Senior Member


Joined: 13 Mar 2006
Posts: 303
Location: Israel

PostPosted: Wed Apr 09, 2008 8:16 pm    Post subject:
Reply with quote

Never seen so much hijacking of a single thread...
chinna asked a simple question,
Sathishk answered by "My requirement is..."
then tarunsharma1981 wrote "i also have a similar requirement in CMS..."
and Huzefa added "I just don't want to save..."
and last thilakvs and kavya123 started a subject of their own...

what happened to this thread ?????
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 121
Location: Bangalore

PostPosted: Sat Apr 12, 2008 6:49 pm    Post subject: Reply to: Checking the SPOOL for no of jobs using REXX
Reply with quote

Friends,

I hope i was clear in stating my SDSF problem. Please let me know if my explanation of problem is unclear.

Kavya, I tried your method of making owner and prefix to * at the beginning before issuing ST Command. But still my problem persists. That is, when there are multiple jobs with SAME JOBNAME but with DIFFERENT JOBIDs, it is always picking up the first job with that jobname even though i want to print 2nd or later job with that same jobname. It is always picking up the first job with that jobname.

The only good difference b/w your code and mine is: I am not using "AFD REFRESH" in my code. It is a SDSF server command (something i came to know from SDSF help and I may not be authorized to use it!). I can not use AFD refresh command.

I am just giving:

s jobname jobid.

It works well in the case when there is only one job with a unique JOBNAME. But it fails when there are multiple jobs with SAME JOBNAME but with DIFFERENT JOBIDs. It is always picking up the first job with that jobname.

I hope I am clear in stating my requirement.

Kavya:
Is your code handling above situation with/without using AFD REFRESH ?

Thanks,
Ajay
Back to top
View user's profile Send private message
kavya123

New User


Joined: 11 Jul 2007
Posts: 35
Location: hyderabad

PostPosted: Mon Apr 14, 2008 4:11 pm    Post subject:
Reply with quote

The code is handling this with "AFD REFRESH" .

kavya
Back to top
View user's profile Send private message
Ajay Baghel

Active User


Joined: 25 Apr 2007
Posts: 121
Location: Bangalore

PostPosted: Fri Apr 18, 2008 5:51 am    Post subject:
Reply with quote

Hi Kavya,

Thanks a lot. I was a bit reluctant to use the command "AFD REFRESH". Finally, i used it. Yes, you are right and Now i saw i it myself. Now i am getting the desired result. Though still I don't know what magic does it create when i get my particular job when i use it and not if i don't use it.

I will have dig into this command a bit.

But Thanks once again for your prompt attention.


-Ajay
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 Previous  1, 2, 3  Next
Page 2 of 3