View previous topic :: View next topic |
Author |
Message |
chmscrbbr Beginner
Joined: 07 Sep 2017 Posts: 3 Topics: 2
|
Posted: Sun Sep 17, 2017 10:04 pm Post subject: Address SDSF error! RC=12 |
|
|
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 |
|
|
Magesh_J Intermediate
Joined: 21 Jun 2014 Posts: 259 Topics: 54
|
Posted: Sun Sep 17, 2017 10:37 pm Post subject: |
|
|
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 |
|
|
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon Sep 18, 2017 8:15 am Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
Posted: Mon Sep 18, 2017 12:30 pm Post subject: |
|
|
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 |
|
|
chmscrbbr Beginner
Joined: 07 Sep 2017 Posts: 3 Topics: 2
|
Posted: Tue Sep 19, 2017 7:24 pm Post subject: |
|
|
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 |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12370 Topics: 75 Location: San Jose
|
|
Back to top |
|
|
|
|