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

in REXX,how to get sysprt info


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

New User


Joined: 03 Apr 2022
Posts: 3
Location: CHINA

PostPosted: Sun Apr 03, 2022 7:35 pm
Reply with quote

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
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Mon Apr 04, 2022 12:37 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon Apr 04, 2022 1:11 am
Reply with quote

What exactly does this mean?

sfeszl wrote:
to check if SYSPRT's info is ok or not ok
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 04, 2022 6:56 am
Reply with quote

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
View user's profile Send private message
sfeszl

New User


Joined: 03 Apr 2022
Posts: 3
Location: CHINA

PostPosted: Mon Apr 04, 2022 7:27 am
Reply with quote

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
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 04, 2022 8:04 am
Reply with quote

Instead of calling DB2 yourself, call a rexx program that uses DSNREXX to issue your DB2 commands.

See REXX applications that issue SQL statements
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Apr 04, 2022 8:16 am
Reply with quote

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
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2127
Location: USA

PostPosted: Mon Apr 04, 2022 6:49 pm
Reply with quote

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... icon_evil.gif

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
View user's profile Send private message
sfeszl

New User


Joined: 03 Apr 2022
Posts: 3
Location: CHINA

PostPosted: Thu Apr 21, 2022 7:36 pm
Reply with quote

if step abend, How can I make it execute once per minute, up to 5 times
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Thu Apr 21, 2022 7:55 pm
Reply with quote

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
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 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
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Get RECORD LENGTH, allocated space of... CLIST & REXX 7
Search our Forums:

Back to Top