MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Address SDSF error! RC=12

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
chmscrbbr
Beginner


Joined: 07 Sep 2017
Posts: 3
Topics: 2

PostPosted: Sun Sep 17, 2017 10:04 pm    Post subject: Address SDSF error! RC=12 Reply with quote

I am new to REXX programming with zero knowledge and experience but I need to code a tool that would analyze the spool and report generated by a batch job in SDSF and tried to follow the example codes in "Implementing REXX Support in SDSF" manual.. here is my code, I haven't coded the whole thing yet as I wanted to try out a chunk first apparently, it is not working

Code:

/* rexx */                                                             
/*address TSO*/                                                         
parm_jobname = 'XXXXXXXX'                                               
activate_SDSF_REXX_support:                                             
 rc_isf = isfcalls("ON")                                               
 select                                                                 
  when rc_isf = 00 then call set_SDSF_special_variables                 
  when rc_isf = 01 then msg_isf = "Query failed, environment not added"
  when rc_isf = 02 then msg_isf = "Add failed"                         
  when rc_isf = 03 then msg_isf = "Delete failed"                       
  otherwise do                                                         
   msg_isf = "Unrecognized Return Code from isfCALLS(ON): "rc_isf       
  end                                                                   
 end                                                                   
 if rc_isf <> 00 then do                                               
  retcode = rc_isf * 10                                                 
  signal finish                                                         
 end                                                                   
 return                                                               
set_SDSF_special_variables:                                           
 isfprefix = parm_jobname                                             
 isfowner = "*"                                                       
 isfcols = "JNAME TOKEN JOBID QUEUE ESYSID"                           
 command = "ST"                                                       
 call search_job                                                       
 return                                                               
search_job:                                                           
 if debug > 0 then                                                     
  opts_sdsf = "(VERBOSE ALTERNATE DELAYED)"                           
 else                                                                 
  opts_sdsf = "(ALTERNATE DELAYED)"                                   
 TRACE 'E'                                                             
 call exec_sdsf "0 ISFEXEC ST" opts_sdsf                               
 do ij = 1 to JNAME.0                                                 
  if JNAME.ij = parm_jobname then do                                   
    if submit_time <> "" then do                                       
      if later_time(parm_date,parm_time,DATER.ij,TIMER.ij) = 1 then   
       job_found = "YES"                                               
      end                                                             
    end                                                               
    if job_found = "YES" then do                                       
      currtoken = TOKEN.ij                                             
      job_found = "YES"                                               
      leave ij                                                         
    end                                                               
  end                                                                 
 end                                                                   
exec_sdsf:                                                             
 parse arg max_SDSF_rc exec_SDSF_command                               
 if symbol("ISFMSG") = "VAR" then                                     
  drop isfmsg                                                         
 sdsf = "OK"                                                           
 address SDSF exec_SDSF_command "(VERBOSE ALTERNATE DELAYED)"         
 if (max_SDSF_rc = "*") then                                           
   return rc                                                           
 if (rc > max_SDSF_rc | rc < 0) then do                                 
   sdsf = "KO"                                                         
 end                                                                   
 return 0                                                               


TRACE output:
Code:

    53 *-*     address SDSF exec_SDSF_command "(VERBOSE ALTERNATE DELAYED)"   
       +++ RC(12) +++                                                         
    34 +++     do ij = 1 to JNAME.0                                           
    25 +++   call search_job                                                   
     7 +++  call set_SDSF_special_variables                                   
Error running SAMPLE2, line 34: Bad arithmetic conversion                     
***                                                                           

The bad arithmetic conversion in "do ij = 1 to JNAME.0" statement is probably due to the error "address SDSF exec_SDSF_command "(VERBOSE ALTERNATE DELAYED)" " which encountered RC=12, how do I start debugging from there or any idea what I may have missed out or done incorrectly?

Thanks
Back to top
View user's profile Send private message
Magesh_J
Intermediate


Joined: 21 Jun 2014
Posts: 259
Topics: 54

PostPosted: Sun Sep 17, 2017 10:37 pm    Post subject: Reply with quote

I am not sure where you got the program, its completely unstructured.

Below link may help you.

Reading Spool thru REXX


Thanks
Magesh
Back to top
View user's profile Send private message
Terry_Heinze
Supermod


Joined: 31 May 2004
Posts: 391
Topics: 4
Location: Richfield, MN, USA

PostPosted: Mon Sep 18, 2017 8:15 am    Post subject: Reply with quote

Code:
/* rexx */
 /*address TSO*/
 parm_jobname = 'XXXXXXXX'
 activate_SDSF_REXX_support:
 rc_isf = isfcalls("ON")
 select
 when rc_isf = 00 then call set_SDSF_special_variables
 when rc_isf = 01 then msg_isf = "Query failed, environment not added"
 when rc_isf = 02 then msg_isf = "Add failed"
 when rc_isf = 03 then msg_isf = "Delete failed"
 otherwise do
 msg_isf = "Unrecognized Return Code from isfCALLS(ON): "rc_isf
 end
 end
 if rc_isf <> 00 then do
 retcode = rc_isf * 10
 signal finish
 end
 return
 set_SDSF_special_variables:
 isfprefix = parm_jobname
 isfowner = "*"
 isfcols = "JNAME TOKEN JOBID QUEUE ESYSID"
 command = "ST"
 call search_job
 return
 search_job:
 if debug > 0 then
 opts_sdsf = "(VERBOSE ALTERNATE DELAYED)"
 else
 opts_sdsf = "(ALTERNATE DELAYED)"
 TRACE 'E'
 call exec_sdsf "0 ISFEXEC ST" opts_sdsf
 do ij = 1 to JNAME.0
 if JNAME.ij = parm_jobname then do
 if submit_time <> "" then do
 if later_time(parm_date,parm_time,DATER.ij,TIMER.ij) = 1 then
 job_found = "YES"
 end
 end
 if job_found = "YES" then do
 currtoken = TOKEN.ij
 job_found = "YES"
 leave ij
 end
 end
 end
 exec_sdsf:
 parse arg max_SDSF_rc exec_SDSF_command
 if symbol("ISFMSG") = "VAR" then
 drop isfmsg
 sdsf = "OK"
 address SDSF exec_SDSF_command "(VERBOSE ALTERNATE DELAYED)"
 if (max_SDSF_rc = "*") then
 return rc
 if (rc > max_SDSF_rc | rc < 0) then do
 sdsf = "KO"
 end
 return 0

Coded for you.
_________________
....Terry
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Mon Sep 18, 2017 12:30 pm    Post subject: Reply with quote

chmscrbbr,

You already set up the options, Why are you setting it again?

Code:

if debug > 0 then
 opts_sdsf = "(VERBOSE ALTERNATE DELAYED)"
 else
 opts_sdsf = "(ALTERNATE DELAYED)"


and when you are invoking you again have

Code:

address SDSF exec_SDSF_command "(VERBOSE ALTERNATE DELAYED)"


It should just be

Code:

address SDSF exec_SDSF_command   


Either way I don't understand why you need it to make so complicated. Follow the link that Magesh_J pointed and you should get your results.
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chmscrbbr
Beginner


Joined: 07 Sep 2017
Posts: 3
Topics: 2

PostPosted: Tue Sep 19, 2017 7:24 pm    Post subject: Reply with quote

Thanks everyone, I apologize for my code but I have just sewed everything I saw on the manual, yeah Thanks Magesh_J, seems like I can invoke SDSF through JCL..
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12357
Topics: 75
Location: San Jose

PostPosted: Wed Sep 20, 2017 11:01 am    Post subject: Reply with quote

chmscrbbr wrote:
Thanks everyone, I apologize for my code but I have just sewed everything I saw on the manual, yeah Thanks Magesh_J, seems like I can invoke SDSF through JCL..


If you want invoke SDSF in batch, check these topics

http://www.mvsforums.com/helpboards/viewtopic.php?&t=332

http://www.mvsforums.com/helpboards/viewtopic.php?&t=10793

http://www.mvsforums.com/helpboards/viewtopic.php?t=6098&highlight=pgm+sdsf
_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group