View previous topic :: View next topic
|
Author |
Message |
sfeszl
New User
Joined: 03 Apr 2022 Posts: 3 Location: CHINA
|
|
|
|
i have a log in SYSPRT,i want to write a REXX to check if SYSPRT's info is ok or not ok,if not ok,then wait sometime to try.
how can i do this |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
Show samples of Input and desired Output, also what you have tried so far. Remember to use Code Tags (Button works as a toggle) for Code/Data. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
What exactly does this mean?
sfeszl wrote: |
to check if SYSPRT's info is ok or not ok |
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
You can use EXECIO to read the SYSPRT file.
But it sounds like you have a second process, working asynchronously, that is about to use the SYSPRT for output. Your use of the SYSPRT data set may prevent the other process from being able to write to the data set.
If there is a batch job involved, my suggestion is to use the SDSF REXX API to determine if the batch job has terminated and to check the return code. (fyi. you may get chided here about writing a job monitor program.) |
|
Back to top |
|
|
sfeszl
New User
Joined: 03 Apr 2022 Posts: 3 Location: CHINA
|
|
|
|
Joerg.Findeisen wrote: |
Show samples of Input and desired Output, also what you have tried so far. Remember to use Code Tags (Button works as a toggle) for Code/Data. |
job like this:
//IKJEFA EXEC PGM=IKJEFT01
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(xxxx)
-ACCESS DATABASE(TABLE1) SPACENAM(SPACE1) MODE(MODE1)
END
//*
IF ACCESS DATABASE not OK,
SYSTSPRT WILL DISPLAY "DSN9023I +DB2M ACCESS DATABASE ABNORMAL COMPLETION"
IF ACCESS DATABASE OK,WILL DISPLAY
"DSN9022I +DB2M ACCESS DATABASE NORMAL COMPLETION"
how can i get SYSTSPRT msg to check if it's ok, if not ok,i want to wait a minute to retry access,max 5 times. |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2590 Location: Silicon Valley
|
|
|
|
Rather than asking your questions in the rexx forum, I suggest that you ask in the DB2 Forum
Search for DSNREXX for existing examples. |
|
Back to top |
|
|
sergeyken
Senior Member
Joined: 29 Apr 2008 Posts: 2127 Location: USA
|
|
|
|
sfeszl wrote: |
job like this:
|
1. Please, learn how to use the Code button when posting your code or data samples
Many forum members are getting crazy while repeating this plea to newbies for more than 100500 times...
2. When using IKJEFT1A in place of IKJEFT01 you may get "not OK" return code from DB2 as JCL step completion code, to be checked without "reading the SYSPRINT"
Code: |
//ACCESSDB EXEC PGM=IKJEFT1A
//SYSTSPRT DD SYSOUT=*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSTSIN DD *
DSN SYSTEM(xxxx)
-ACCESS DATABASE(TABLE1) SPACENAM(SPACE1) MODE(MODE1)
END
//*
// IF (ACCESSDB.RC EQ 0) THEN everything is good
// . . . . . . process "OK condition"
// ELSE , something was wrong
// . . . . . . process "not OK condition"
// ENDIF ,
|
|
|
Back to top |
|
|
sfeszl
New User
Joined: 03 Apr 2022 Posts: 3 Location: CHINA
|
|
|
|
if step abend, How can I make it execute once per minute, up to 5 times |
|
Back to top |
|
|
Joerg.Findeisen
Senior Member
Joined: 15 Aug 2015 Posts: 1329 Location: Bamberg, Germany
|
|
|
|
sfeszl wrote: |
if step abend, How can I make it execute once per minute, up to 5 times |
Make use of your Job Scheduler, it should allow such things. |
|
Back to top |
|
|
|