SDSF Rexx - Error in xdc'ing executing job.



IBM's Command List programming language & Restructured Extended Executor

SDSF Rexx - Error in xdc'ing executing job.

Postby Viswanathchandru » Wed Oct 23, 2013 6:22 am

Dear all,

I'm trying to capture an executing job for eg., my TSO id. But I'm ending up with error. The same script is working for queue=print, but not for queue=execution. Any suggestion would be really helpful. Below is the code that i used.


/* REXX */                                             
"ALLOC F (FINAL) DA ('SYS833K.PRODCHKT.TRACK') SHR REU"
"EXECIO * DISKR FINAL (STEM STC. FINIS"                 
DO I=1 TO STC.0                                         
ISFOWNER= '*'                                           
JOBNAME='SYS833K'                                       
HLQ=SYS833K                                             
RC=ISFCALLS('ON')                                       
MAIN:                                                   
IF I>STC.0 THEN                                         
EXIT                                                   
 PARSE VAR STC.I S1 "." S2 "." S3                       
 JOBNAM=STRIP(S1)                                       
 STATUS=STRIP(S2)                                       
 LOOKMSG=STRIP(S3)                                     
 JNAME=SUBSTR(JOBNAM,1,6)                               
 ISFPREFIX=JOBNAM                       
 IF STATUS=STC THEN                     
    STATUS=EXECUTION                   
  ELSE                                 
    STATUS=PRINT                       
ISFSORT='JOBID'                         
IF RC <> 0 THEN DO                     
   SAY 'ISFCALLS RC='RC                 
   RETURN RC                           
END                                     
ADDRESS SDSF 'ISFEXEC ST'               
IF RC <> 0 THEN DO                     
   SAY 'ISFEXEC RC='RC                 
   RETURN RC                           
END                                     
DO IX=1 TO JNAME.0                     
TRACE ?R                                                             
   IF QUEUE.IX=STATUS                                               
   THEN                                                             
   DO                                                               
   "ALLOC F (SPLV) DA ('"USERID()".LICFIN.PDS("JNAME.IX")') SHR REU"
        CC=RC                                                       
     END                     



Thanks,
Viswa..
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby dick scherrer » Wed Oct 23, 2013 9:17 pm

Hello,

Have you run a trace? Suggest you post the info from the trace.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby enrico-sorichetti » Thu Oct 24, 2013 1:01 am

apart the misleading title of the topic ( where is the XDC ??? )
unfortunately the code snippet posted does not make any sense

why in heaven ????

DO I = 1 TO STC.0

and after a while
MAIN:                                                   
    IF I>STC.0 THEN                                         
        EXIT                                                   
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort

These users thanked the author enrico-sorichetti for the post:
Viswanathchandru (Thu Oct 24, 2013 11:13 pm)
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Pedro » Thu Oct 24, 2013 2:18 am

But I'm ending up with error.

What are the symptoms of the error?
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Pedro » Thu Oct 24, 2013 4:37 am

You are missing some END statements.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Pedro » Thu Oct 24, 2013 5:11 am

You set RC by using ISFCALLS then much later, you check the RC value. You should check it right away.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Pedro » Thu Oct 24, 2013 5:12 am

This worked for me:
/* REXX */                         
ISF_RC=ISFCALLS('ON')               
If ISF_RC <> 0 Then Do             
   Say 'ISFCALLS RC='ISF_RC         
   Return ISF_RC                   
End                                 
                                   
STC.1 = 'PEDRO.EXECUTION'           
STC.2 = 'JCADDH21.PRINT'           
STC.0 = 2                           
                                   
Do I = 1 To STC.0                   
  ISFOWNER= '*'                     
  Parse VAR STC.I S1 "." S2 "." S3 
  JOBNAM   = STRIP(S1)             
  STATUS   = STRIP(S2)             
  ISFPREFIX= JOBNAM                 
  ISFSORT  = 'JOBID'               
                                   
  Address SDSF 'ISFEXEC ST'         
  If RC <> 0 Then Do               
    Say 'ISFEXEC RC='RC             
    Return RC                       
  End                               
                                   
  Say 'number of rows' isfrows     
  Do IX=1 To JNAME.0               
    If (queue.ix = status) Then     
      Say 'JNAME('jname.ix') ' ,   
          'JOBID('jobid.ix') ' ,   
          'queue('queue.ix')'       
  End                               
End                                 
Pedro Vera

These users thanked the author Pedro for the post:
Viswanathchandru (Thu Oct 24, 2013 11:03 pm)
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Pedro » Thu Oct 24, 2013 5:29 am

BTW, after struggling to get job information using the SDSF batch interface from rexx, I asked the SDSF developers for an interface better suited for rexx. They came up with the rexx api for SDSF.
Pedro Vera
User avatar
Pedro
 
Posts: 684
Joined: Thu Jul 31, 2008 9:59 pm
Location: Silicon Valley
Has thanked: 0 time
Been thanked: 53 times

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Viswanathchandru » Thu Oct 24, 2013 11:02 pm

Oh!!! I will work on the suggestions. Thank you so much experts... for your valuable time and suggestions...


Thanks,
Viswa..
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time

Re: SDSF Rexx - Error in xdc'ing executing job.

Postby Viswanathchandru » Thu Oct 24, 2013 11:15 pm

Hi Pedro and enrico,

I'm extremely sorry for not posting the complete code. I had copied the entire content here, not sure why its not reflecting the entire code. I can just see only a part of it. Not sure why.. My apologies for that.

Here is the complete code.

/* REXX */                                                   
"ALLOC DA('SYS833K.LICENSE.TRACK') F(LICTRK) SHR REU"         
"EXECIO * DISKR LICTRK(STEM LICTR. FINIS"                     
  DO I=1 TO LICTR.0                                           
PARSE VAR LICTR.I S1 " " S2 "." S3                           
JOBNAM=STRIP(S1)                                             
LICMSG=STRIP(S2)                                             
LICCON=STRIP(S3)                                             
ISFOWNER='SYS833K'                                           
ISFPREFIX=JOBNAM                                             
HLQ=SYS833K                                                   
RC=ISFCALLS('ON')                                             
ISFSORT='JOBID'                                               
IF RC <> 0 THEN DO                                           
   SAY 'ISFCALLS RC='RC                                       
   RETURN RC                                                 
END                                                           
ADDRESS SDSF 'ISFEXEC ST'                                             
IF RC <> 0 THEN DO                                                   
   SAY 'ISFEXEC RC='RC                                               
   RETURN RC                                                         
END                                                                   
DO IX=1 TO JNAME.0                                                   
   IF QUEUE.IX <> 'PRINT' & ,                                         
      QUEUE.IX <> 'OUTPUT'  ,                                         
     THEN ITERATE                                                     
   JNAME=SUBSTR(JNAME.IX,1,6)                                         
   JNAMEF=JNAME||I                                                   
   SAY JNAMEF                                                         
   DO                                                                 
     "ALLOC F (SPLV) DA ('"USERID()".LICFIN.PDS("JNAMEF")') SHR REU" 
        CC=RC                                                         
     END                                                             
     IF CC <> 0 THEN DO                                               
        SAY "FAILED TO ALLOCATE "JNAME.IX"."JOBID.IX             
        ITERATE                                                 
     END                                                         
     ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.IX"') PARM(NP SA)"   
     DO JX=1 TO ISFDDNAME.0                                     
        DO FOREVER                                               
        "EXECIO 10000 DISKR "ISFDDNAME.JX"(STEM LINE. "         
                 LINES = LINE.0                                 
               LINES = LINE.0                                   
               IF RC=2 THEN RC=0                                 
               IF RC <> 0 THEN DO                               
                  SAY "LINES READ="LINES" RC="RC                 
                  EXIT 12;                                       
               END                                               
               "EXECIO * DISKW SPLV (STEM LINE."                 
               DROP LINE.                                       
               IF LINES<10000 THEN LEAVE                         
          END                                         
          "EXECIO 0 DISKR "ISFDDNAME.JX"(FINIS"       
       END                                             
       DROP ISFDDNAME.                                 
     "EXECIO 0 DISKW SPLV(FINIS"                       
     "FREE FI(SPLV)"                                   
  END                                                 
  END       


And I'm getting the RC 8 here..

     ADDRESS SDSF "ISFACT ST TOKEN('"TOKEN.IX"') PARM(NP SA)"   


Any suggestions will be helpful..

Many thanks,
Viswa...
Viswanathchandru
 
Posts: 271
Joined: Mon Oct 25, 2010 2:24 pm
Has thanked: 25 times
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post