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

Run rexx with JCL Job


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

New User


Joined: 04 Feb 2024
Posts: 24
Location: united arab emirates

PostPosted: Mon Dec 09, 2024 9:26 pm
Reply with quote

"I have written a REXX job on z/OS version 2.1 that read log in SDSF panel. When I execute the job directly using the EX command, it works correctly. However, when I run the same job through a batch JCL, it fails to work. How can I resolve this issue?"
REXX code:
Code:

/*REXX*/                                                               
DO FOREVER
/**********************************************************************/
/*                    READ LOG AND INSERT IN TABLE                    */
/**********************************************************************/
S_RC = RXSUBCOM('ADD','DSNREXX','DSNREXX')                             
ADDRESS DSNREXX                                                         
'CONNECT' 'DBTEST'                                                       
RC = ISFCALLS('ON')                                                     
IF RC = 0 THEN                                                         
   SAY 'SDSF INITIALLIZED SUCSSECFULLY'                                 
ELSE                                                                   
   SAY 'SDSF INITIALLIZED FAIELD: ' RC                                 
ADDRESS SDSF "ISFLOG READ TYPE(SYSLOG)"                                 
    DO I = 1 TO ISFLINE.0                                               
        IF POS('IEF125I',ISFLINE.I) \= 0 THEN DO                       
           PARSED_DATA = SUBSTR(ISFLINE.I,POS('IEF125I',ISFLINE.I)+8,40)
     SAY PARSED_DATA                                                   
            /* INSERT INTO DB ONLY IF NOT EXISTS */                     
          EXECSQL,                                                     
            "MERGE INTO USER.LOG_USER T",                               
            "USING (VALUES('"PARSED_DATA"')) AS S (INSERT_DATA)",       
            "ON T.INSERT_DATA = S.INSERT_DATA",                         
            "WHEN NOT MATCHED THEN",                                   
            "INSERT (INSERT_DATA) VALUES(S.INSERT_DATA)"               
        END                                                             
     END                                                               
     END 

JCL JOB:
Code:

//LOGUSR1  JOB  CLASS=A,NOTIFY=&SYSUID                   
//EREPMTN  EXEC PGM=IKJEFT01,REGION=0K,PARM='LOGREAD'   
//SYSEXEC  DD DSN=USER.GOALREXX,DISP=SHR               
//SYSTSPRT DD SYSOUT=*                                   
//SYSTSIN  DD DUMMY,BLKSIZE=80                           
//INDD     DD *     
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1335
Location: Bamberg, Germany

PostPosted: Mon Dec 09, 2024 9:45 pm
Reply with quote

You should assign return codes and messages, and also print them (if nonzero). SDSF has short and long messages.
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 Run rexx in batch job CLIST & REXX 7
No new posts Does anyone know rexx for VSE CLIST & REXX 3
No new posts TSO ALLOC In REXX Needs Improvement JCL & VSAM 3
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Help needed in automation cics transa... CLIST & REXX 1
Search our Forums:

Back to Top