IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

RC of a JOB in temporary dataset


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
isnehil
Warnings : 1

New User


Joined: 10 Oct 2007
Posts: 23
Location: mumbai

PostPosted: Thu May 22, 2008 12:37 pm
Reply with quote

Hi all,

I want the Return code of a particular jobname & jobid pulled through the REXX program to be written into the dataset TEMPPRT.

Here is my code which is working fine, if I want to extract information job info such as SASLOG, JESMSG, etc.

How do I modify it so that I can extract the Return code inforamtion when a JOBNAME & JOBID is supplied. I am trying, but not yet able to figure out.

Please help..

Thanks in advance,

~ Snehil

Here is the code:
Code:

/* REXX */                                                              00010000
SAY PLEASE ENTER JOBNAME JOBID                                          00020000
PULL JOBNAME JOBID                                                      00030000
/*SAY PLEASE ENTER XDC DSN                                              00040001
PULL XDCDS                                                              00050002
SAY PLEASE ENTER STRING                                                 00051000
PULL STRNG */                                                           00052002
D="'"                                                                   00060000
XDCNAME=D||XDCDS||D                                                     00070000
                                                                        00080000
/*SAY YOU ENTERED JOBNAME JOBID */                                      00090003
JOBIDD="JOBID"                                                          00100000
ADDRESS TSO                                                             00110000
"DELETE 'PWSX.KAMSHEW.TP.SDSF'"                                         00120000
"DELETE 'PWSX.KAMSHEW.SPMON'"                                           00121004
"ALLOC F(ISFIN) TRACKS SPACE(1) REU"            /* USED BY SDSF     */  00130000
                                                                        00140000
"ALLOC F(ISFOUT) DA('PWSX.KAMSHEW.TP.SDSF') NEW DELETE REU ",           00150000
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"               00160000
                                                                        00170004
"ALLOC F(TEMPPRT) DA('PWSX.KAMSHEW.SPMON') NEW DELETE REU ",            00180004
"TRACKS SPACE(100,100) LRECL(133) RECFM(F,B,A) DSORG(PS)"               00190004
                                                                        00200004
                                                                        00201003
QUEUE "SET CONFIRM OFF"                                                 00210000
QUEUE "OWNER *"                                                         00220000
QUEUE "PREFIX *"                                                        00230000
QUEUE "DA"                                                              00240000
QUEUE "ST"                                                              00250000
QUEUE "SELECT "JOBNAME JOBID                                            00260002
QUEUE "AFD REFRESH"                                                     00270004
QUEUE "FIND "JOBNAME                                                    00280000
QUEUE "++?"                                                             00290004
QUEUE "FIND SASLOG"                                                     00300004
QUEUE "++S"                               /* BROWSE MSGUSR DATASET */   00310004
QUEUE "L MAX-RC"                                                        00311004
QUEUE "PRINT FILE TEMPPRT "            /* PRINT TO TEMP DATASET */      00320004
QUEUE "PRINT 1 999999"                                                  00330000
QUEUE "PRINT CLOSE"                                                     00340000
QUEUE "END"                                                             00350000
QUEUE "EXIT"                                                            00360000
                                                                        00370000
"EXECIO" QUEUED()" DISKW ISFIN (FINIS"     /* INPUT TO SDSF BATCH   */  00380000
                                                                        00390000
ADDRESS ISPEXEC "SELECT PGM(ISFAFD) PARM('++32,255')" /* INVOKE SDSF */ 00400000
EXIT                                                                    00410000
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu May 22, 2008 1:30 pm
Reply with quote

Too cumbersome. I would travel though TCB --> JSCB --> JCT --> SCT control blocks to get the RC. Your desired field is SCTSEXEC.

O.
Back to top
View user's profile Send private message
isnehil
Warnings : 1

New User


Joined: 10 Oct 2007
Posts: 23
Location: mumbai

PostPosted: Thu May 22, 2008 1:40 pm
Reply with quote

Hi... thanx for your reply....

Though I am not familiar with the system control blocks yet I have found a thread...
www.ibmmainframes.com/about3904.html

Thanx a ton for showing me the right way...
I shall try to execute using the TCB --> JSCB --> JCT --> SCT control blocks to get the RC.
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu May 22, 2008 10:02 pm
Reply with quote

Quote:

Too cumbersome. I would travel though TCB --> JSCB --> JCT --> SCT control blocks to get the RC. Your desired field is SCTSEXEC.


Searching through control blocks only tells you stuff about your own address space.

I understood the question to be about finding the return codes from a completed batch job.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu May 22, 2008 11:43 pm
Reply with quote

Hello,

Quote:
How do I modify it so that I can extract the Return code inforamtion when a JOBNAME & JOBID is supplied.


In the JESYSMSG sysout dataset, there will be a line similar to this for each step:
Code:
IEF142I ZQZDSGNR GENR - STEP WAS EXECUTED - COND CODE 0000
I believe this is what you want.
Back to top
View user's profile Send private message
isnehil
Warnings : 1

New User


Joined: 10 Oct 2007
Posts: 23
Location: mumbai

PostPosted: Tue Jun 10, 2008 3:06 pm
Reply with quote

Thanks Dick & Pedro...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jun 10, 2008 8:16 pm
Reply with quote

You're welcome icon_smile.gif

Is your process now working?

d
Back to top
View user's profile Send private message
isnehil
Warnings : 1

New User


Joined: 10 Oct 2007
Posts: 23
Location: mumbai

PostPosted: Mon Jun 16, 2008 1:58 pm
Reply with quote

Yes,I have worked out the solution for my requirement ..... thanks for all your support... have a nice time...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Jun 16, 2008 7:22 pm
Reply with quote

Good to hear it is working icon_smile.gif

If you post your solution, it may help someone with a similar question later.

d
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts Reading dataset in Python - New Line ... All Other Mainframe Topics 22
Search our Forums:

Back to Top