IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem running REXX in production - need CONSOLE access


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
siebertr

New User


Joined: 25 Aug 2010
Posts: 7
Location: Brazil, Sao Paulo, Hortolandia

PostPosted: Thu Sep 02, 2010 6:08 pm
Reply with quote

Hi,

i am trying to run the REXX code below in the mainframe. I have an user ID that has access to the console, so when i run it under my user ID it works perfectly. However, when i try to use a scheduling tool to submit this job, a different user ID is used. In this case, a surrogate user ID is used to submit the job by the scheduling tool.

When submitted by the scheduling tool, the process fails. The code is described below:

Code:
/*REXX*/
/*******************************************************/
/*         START CANCEL COMMAND STEM COUNTER           */
/*******************************************************/
O=0                                                     
/*******************************************************/
/*         ALLOC CONSOLE                               */
/*******************************************************/
ADDRESS TSO   'CONSPROF SOLDISPLAY(NO)'                 
ADDRESS TSO   'CONSOLE  ACTIVATE'                       
/*******************************************************/
/*   ISSUE CONSOLE COMMAND TO GET CONTENTION INFO      */
/*******************************************************/
ADDRESS CONSOLE 'D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB)'   
/*******************************************************/
/*   STORE RESULTS ON STEM LINE.                       */
/*******************************************************/
DO FOREVER                                               
FC = GETMSG('LINE.','SOL',,,10)                         
IF FC = 0 THEN LEAVE                                     
END                                                     
/*******************************************************/
/*         DEALLOC CONSOLE                             */
/*******************************************************/
ADDRESS TSO   'CONSOLE  DEACTIVATE'                     
/*******************************************************/
/*   FORMAT USER ID&SYSID INFORMATION                  */
/*******************************************************/
DO I=1 TO LINE.0                                         
 IF INDEX(LINE.I,"OWN")>60 THEN                         
  DO                                                     
  PARSE VAR LINE.I JNK1 2 SYSID 6 JNK2 12 UID 17 JNK2   
  O=O+1                                                 
  SYSID.O = SYSID                                       
  UID.O  = UID                                           
  END                                                   
 ELSE                                                   
  IF LINE.I = 0 THEN LEAVE                               
  ELSE NOP                                               
END                                                     
/*******************************************************/
/*   FORMAT CANCEL. STEM FOR CANCEL COMMANDS           */
/*******************************************************/
DO I=1 TO O                                             
CANCEL.I = "RO "||SYSID.I||",C U="||UID.I               
END                                                     
/*******************************************************/
/*         ALLOC CONSOLE                               */
/*******************************************************/
ADDRESS TSO   'CONSPROF SOLDISPLAY(NO)'                 
ADDRESS TSO   'CONSOLE  ACTIVATE'                       
/*******************************************************/
/*   ISSUE CONSOLE COMMAND TO CANCEL USERS             */
/*******************************************************/
DO I=1 TO O                                             
ADDRESS CONSOLE CANCEL.I                                 
END                                                     
/*******************************************************/
/*         DEALLOC CONSOLE                             */
/*******************************************************/
ADDRESS TSO   'CONSOLE  DEACTIVATE'                     


I was able to grant CONSOLE to this surrogate user ID. Before this, i was getting the following error message:

IKJ56644I NO VALID TSO USERID, DEFAULT USER ATTRIBUTES USED
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
READY
%PCYCONT2
THE CONSPROF COMMAND HAS TERMINATED.+
USER DOES NOT HAVE CONSOLE COMMAND AUTHORITY.
THE CONSOLE COMMAND HAS TERMINATED.+
USER DOES NOT HAVE CONSOLE COMMAND AUTHORITY.
8 *-* ADDRESS CONSOLE 'D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB)'
+++ RC(-3) +++
GETMSG PROCESSING HAS TERMINATED. A CONSOLE SESSION IS NOT ACTIVE.
...
GETMSG PROCESSING HAS TERMINATED. A CONSOLE SESSION IS NOT ACTIVE.


After setting CONSOLE to this surrogate user ID, the error was different:

IKJ56644I NO VALID TSO USERID, DEFAULT USER ATTRIBUTES USED
ACF0C038 ACF2 LOGONID ATTRIBUTES HAVE REPLACED DEFAULT USER ATTRIBUTES
READY
%PCYCONT2
THE CONSOLE COMMAND HAS TERMINATED.+
AN ERROR OCCURRED DURING CONSOLE INITIALIZATION. THE MCSOPER RETURN CODE WAS X'00000010' AND THE REASON CODE WAS X'00000008'.
16 *-* ADDRESS CONSOLE 'D GRS,RES=(SYSDSN,SYSS.XSP.ISPTLIB)'
+++ RC(-3) +++
GETMSG PROCESSING HAS TERMINATED. A CONSOLE SESSION IS NOT ACTIVE.
...
GETMSG PROCESSING HAS TERMINATED. A CONSOLE SESSION IS NOT ACTIVE.


Can somebody help me on how to make this job run in production by a scheduling tool? Since CONSOLE was granted to the surrogate ID, i am not sure anymore on how to solve this issue. I understand that using the surrogate ID to run this job is not able to issue the console commands, so since the CONSOLE is not activated, the GETMSG function will keep getting the same message forever. Thanks.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Thu Sep 02, 2010 6:14 pm
Reply with quote

Quote:
IKJ56644I NO VALID TSO USERID, DEFAULT USER ATTRIBUTES USED


does the surrogate userid have a TSO segment ???
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Sep 03, 2010 9:16 pm
Reply with quote

Is that your entire rexx program? (%PCYCONT2). I ask because you are getting message ids prior to it, but not during. And I do not see where you turn it off.

It would help some to know the message id for this:
Quote:
AN ERROR OCCURRED DURING CONSOLE INITIALIZATION. THE MCSOPER RETURN CODE WAS X'00000010' AND THE REASON CODE WAS X'00000008'.
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Sat Sep 04, 2010 4:18 am
Reply with quote

Quote:
USER DOES NOT HAVE CONSOLE COMMAND AUTHORITY.

You obviously lack RACF authorisation to issue console (z/OS) commands for your your userid
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Running REXX through JOB CLIST & REXX 13
No new posts Error to read log with rexx CLIST & REXX 11
No new posts isfline didnt work in rexx at z/OS ve... CLIST & REXX 7
No new posts run rexx code with jcl CLIST & REXX 15
Search our Forums:

Back to Top