Address SDSF error! RC=12
Select messages from
# through # FAQ
[/[Print]\]

MVSFORUMS.com -> TSO and ISPF

#1: Address SDSF error! RC=12 Author: chmscrbbr PostPosted: Sun Sep 17, 2017 10:04 pm
    —
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

#2:  Author: Magesh_J PostPosted: Sun Sep 17, 2017 10:37 pm
    —
I am not sure where you got the program, its completely unstructured.

Below link may help you.

Reading Spool thru REXX


Thanks
Magesh

#3:  Author: Terry_HeinzeLocation: Richfield, MN, USA PostPosted: Mon Sep 18, 2017 8:15 am
    —
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.

#4:  Author: kolusuLocation: San Jose PostPosted: Mon Sep 18, 2017 12:30 pm
    —
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.

#5:  Author: chmscrbbr PostPosted: Tue Sep 19, 2017 7:24 pm
    —
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..

#6:  Author: kolusuLocation: San Jose PostPosted: Wed Sep 20, 2017 11:01 am
    —
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



MVSFORUMS.com -> TSO and ISPF


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Page 1 of 1

Powered by phpBB © 2001, 2005 phpBB Group