To Get the RC of JCL using REXX



IBM's Command List programming language & Restructured Extended Executor

To Get the RC of JCL using REXX

Postby sugavanesh » Sun Feb 26, 2012 6:18 pm

I am executing a JCL thru REXX, and If the JCL doesnt completes successfully with 'RC=0' it shuld display the message as 'error found' .

Can someone help me out in this please ?
sugavanesh
 
Posts: 9
Joined: Sat Nov 05, 2011 9:03 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To Get the RC of JCL using REXX

Postby steve-myers » Sun Feb 26, 2012 7:54 pm

It cannot be done as you seem to think it can be done. First, a Rexx EXEC running in TSO cannot intercept the notify message the system may send to your terminal. Rexx output "trapping" just intercepts messages originated by your TSO session using a very limited mechanism used by properly written TSO functions, not messages sent to your terminal by some foreign process. Second, Rexx is not designed to spin around waiting for a batch process to terminate, possibly minutes, if not hours or days after you have submitted the job.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: To Get the RC of JCL using REXX

Postby NicC » Mon Feb 27, 2012 1:16 am

Why do you need this rather than use the NOTIFY jobcard parameter?
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: To Get the RC of JCL using REXX

Postby steve-myers » Mon Feb 27, 2012 9:23 am

NicC wrote:Why do you need this rather than use the NOTIFY jobcard parameter?
That's actually a pretty good question. In the last few months we've seen a number of similar posts, which makes me think someone thinks it's possible to write a job scheduling system using Rexx who has no idea about what Rexx can't do.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times

Re: To Get the RC of JCL using REXX

Postby MrSpock » Mon Feb 27, 2012 7:04 pm

The other question I have all the time is, what has the poster already tried? Also, when is it going to sink in that REXX has nothing to do with any of this. Using the standard TSO commands for job processing: SUBMIT, STATUS, and OUTPUT, has met my needs on occasion for many, many years. When they're not sufficient, then I've turned to using batch and/or programming interfaces to whatever spool/output management tool I had to work with: IOF, Sysview, or more recently, SDSF.

It's what, about 20 or so lines of code:

/* REXX */                                                       
Queue "//JOBNAME# JOB (...),'...',"                               
Queue ...                                                         
Queue "$$"                                                       
Call Outtrap(j.)                                                 
"SUBMIT * END($$)"                                               
Call Outtrap(Off)                                                 
/* IKJ56250I JOB JOBNAME#(JOB#####) SUBMITTED */                 
Parse Var j.2 . "JOB " joblist " SUBMITTED" .                     
Do Forever                                                       
  Call Outtrap(j.)                                               
  "STATUS "joblist                                               
  Call Outtrap(Off)                                               
  /* IKJ56197I JOB JOBNAME#(JOB#####) WAITING FOR EXECUTION */   
  /* IKJ56211I JOB JOBNAME#(JOB#####) EXECUTING             */   
  /* IKJ56192I JOB JOBNAME#(JOB#####) ON OUTPUT QUEUE       */   
  Parse Var j.1 . "JOB " joblist status                           
  If status = "ON OUTPUT QUEUE" Then Leave                       
End                                                               
Parse Var joblist jobname "(" jobid ")" .       
outdsn = "OUTPUT."jobname".#'jobid               
"OUTPUT "joblist" PRINT("outdsn")"               
Exit 0                                           
User avatar
MrSpock
Global moderator
 
Posts: 809
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 4 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post