mox512
New User
Joined: 04 Feb 2024 Posts: 24 Location: united arab emirates
|
|
|
|
"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 *
|
|
|