View previous topic :: View next topic
|
Author |
Message |
Raj1103
New User
Joined: 03 Jun 2024 Posts: 4 Location: India
|
|
|
|
Hi All,
Need help in Mainframe automation AF/Oper. Post IPL we want to bring CICS regions with automation but when the operation team is issuing the command they get an error message as [Command failed] there is some error in the Rexx code. Could you please help in correcting the REXX code? |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
1) Do not use attachments; use the Code button instead.
2) Did you try to DEBUG and/or to TRACE your code, in any manner? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Your program issues many operator commands. Please confirm, with a simple 'hello' exec, that you (and operation team) are set up to issue operator commands through rexx.
As Sergey mentioned, you need a trace to debug. And also a trace of the @APLOPER function. |
|
Back to top |
|
|
Raj1103
New User
Joined: 03 Jun 2024 Posts: 4 Location: India
|
|
|
|
Yes I debugged the code but there are many issues and error with code - >>> "SH02TR 113 Routine not found"
160 +++ call @aplmsgs 'A007',,execfn line cause
IRX0043I Error running SH02TR, line 160: Routine not found [/code] |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
1) Again, and again, and again, and again: use the Code button
Raj1103 wrote: |
Yes I debugged the code but there are many issues and error with code -
Code: |
>>> "SH02TR 113 Routine not found"
160 +++ call @aplmsgs 'A007',,execfn line cause
IRX0043I Error running SH02TR, line 160: Routine not found |
|
Routine not found definitely means that @aplmsgs program is not available anywhere...
2) It is not clear: what these messages are related to? There is no source code presented...
3) as Pedro suggested, have you tried with a simple 'hello' exec, that you (and operation team) are set up to issue operator commands through rexx. ? |
|
Back to top |
|
|
Raj1103
New User
Joined: 03 Jun 2024 Posts: 4 Location: India
|
|
|
|
Code: |
/* REXX Script to automate starting TEC232 task after IPL */
taskname = 'TEC232'
/* Issue the command to check the task status */
Address MVS "D A,L" taskname
/* Read the response from the command */
response = ''
do while queued() > 0
parse pull line
response = response || line
end
/* Parse the response to check if the task is active */
if pos('ACTIVE', response) > 0 then do
say "Task" taskname "is already active."
end
else do
say "Task" taskname "is not active. Starting task."
/* Issue the command to start the task */
Address MVS "RCF Start" taskname
/* Read the response from the start command */
start_response = ''
do while queued() > 0
parse pull line
start_response = start_response || line
end
/* Check if the start command was successful */
if pos('SUCCESS', start_response) > 0 then
say "Task" taskname "started successfully."
else
say "Failed to start task" taskname
end
exit |
I have writen the above code but while debuging getting the error -
I have tried with MVS, OPER, Submit but its keep saying ++RC(-3)++ error.
Code: |
4 *-* Address MVS "D A,L" taskname
+++ RC(-3) +++
Task TEC232 is not active. Starting task.
***
19 *-* Address MVS "RCF Start" taskname
+++ RC(-3) +++
Failed to start task TEC232
*** |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Okay, the response to your START commands does not contain the word 'SUCCESS'. Can you please show what the response actually is?
And are there any messages in the syslog related to the start command? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Can you start TEC232 successfully from the operator's console? |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Code: |
Address MVS "D A,L" taskname |
I do not think Address MVS does what you think it does. As coded, it will try to call a program called 'D' and pass parameters in batch program parameter style.
You should use Address CONSOLE to issue MVS operator commands. Or possibly, use the rexx API for SDSF. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10884 Location: italy
|
|
|
|
we are all wasting time here ....
the script developed by the TS is a cut and paste from different sources
for example ( apart the target of the ADDRESS )
Code: |
Address MVS "RCF Start" taskname |
is not a zOS command
it is something provided by the automation software ...
from the script that was attached
Code: |
Mcommand = "RCF START "Taskm
endmsg = 'displayed'
rc = @APLOPER(Mcommand,retopts,cons,time1,time2,maxlines,endmsg)
|
|
|
Back to top |
|
|
Raj1103
New User
Joined: 03 Jun 2024 Posts: 4 Location: India
|
|
|
|
Yes pedro, In syslog we got that
Code: |
0291 IEF450I TEC232 IEFPROC $TSOFLLP - ABEND=S622 U0000 REASON=00000000 226
0291 TIME=04.05.59
0291 $HASP395 TEC232 ENDED - ABEND=S622
0290 RACF STOP
0090 IRRB069I ((RACF)) RACF SUBSYSTEM STARTING SHUTDOWN PROCESSING. 229
0090 AOF749I SHUTDOWN COMPLETE FOR SMC (RESTART=NO,TYPE=NORM)
0291 $HASP250 TEC232 PURGED -- (JOB KEY WAS DEC10A56)
0090 AOF570I 04:05:59 : ISSUED "MVS RACF STOP" FOR SUBSYSTEM RACF - 232
0090 PHASE IS SHUTNORM
|
And I also tried with Address CONSOLE but it also throws same error as
Code: |
4 *-* Address CONSOLE 'D A,L' taskname
+++ RC(-3) +++
Task TEC232 is not active. Starting task.
***
19 *-* Address CONSOLE 'RCF START' taskname
+++ RC(-3) +++
Failed to start task TEC232
***
|
And for starting of the command operation team gives /RCF start taskname - to start any task.
and also I have used TEC232 as a test task that is not available in the Lpar but I also tried with some omegon task like OMIIO2 then also its throwing same error. |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Nothing is thrown on a z/OS ever. There are msgs indicating what to look at. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
re: "we are all wasting time here ...."
Ain't that the truth! |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
re: "IEF450I TEC232 IEFPROC $TSOFLLP - ABEND=S622 U0000 REASON=00000000"
You did not answer my earlier question... can you issue the START TEC232 command from the operator's console and have it start correctly? It seems like it is not written correctly as a started task.
----
re: "Address CONSOLE 'RCF START' taskname"
RCF is not an MVS operator command, so I doubt it will work.
----
re: "Address CONSOLE 'D A,L' taskname"
CONSOLE is not a simple api. You should study the examples in the REXX Reference manual. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
You are trying to automate a complex task. You should make sure each individual part works correctly before you try to get the aggregate to work.
Pieces that you need to consider:
1. started tasks are actually able to be started manually before trying to automate.
2. You need to know how to use CONSOLE and how to retrieve the command response using GETMSG function
3. Study also CONSPROF command from Rexx Reference.
4. You probably need authorization to be able to use CONSOLE and CONSPROF
5. Your 'operations team' also needs said authorization. Maybe your automation tool needs separate authorization.
6. I do not know what "AF/Oper Tool" is, but likely you are showing us your code that is not related. Maybe you do not need CONSOLE, CONSPROF, and GETMSG at all. |
|
Back to top |
|
|
|