Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

cl program help? anyone?

146 views
Skip to first unread message

JSM

unread,
Nov 13, 2000, 9:36:20 PM11/13/00
to
greetings!

I need assistance!!! Basically, what i need to do, is write a cl program
that i guess would run in batch every 15 minutes or so, that would check to
see if the cfgsts of a controller is *active, if not, call a program i have
written.

also, can i ping an ip address and if there is a good reply, goto the above
section, if not, snd a msg?

Thanks for your help,
Joe


Pascal PERON

unread,
Nov 14, 2000, 3:00:00 AM11/14/00
to
Hello Joe,

1 - to delay your job you can use the dlyjob command in you CL program.
2- to check the status of the controller use the RTVCFGSTS command. The
return code gives you the status.
3 - You can ping the adress you want, after you have to test the message and
check if the connection is ok.
You can start with the following lines.
These lines tests you have more than 0% connection succesfull
PING RMTSYS(&HOST) MSGMODE(*QUIET)
RCVMSG RMV(*NO) MSGDTA(&MSGDTA) MSGID(&MSGID)
IF COND(&MSGID *EQ 'TCP3210') +
THEN(DO)
CHGVAR VAR(&OK ) VALUE(%BIN(&MSGDTA 9 4))
IF COND(&OK *GT 0) +
THEN(DO)
CHGVAR VAR(&STS) VALUE('ACTIVE ')
GOTO ENDPGM
ENDDO

Regards

Pascal

Genghis

unread,
Nov 14, 2000, 3:00:00 AM11/14/00
to
Joe,

You could use the following as a shell:

*************** Beginning of data*************************************
PGM
DCL VAR(&STATUS) TYPE(*DEC) LEN(5 0)
GET_STATUS: RTVCFGSTS CFGD(YOURLINE) CFGTYPE(*LIN) STSCDE(&STATUS)

IF COND(&STATUS ャ= 60) THEN(DO)
CALL PGM(YOURPGM)
ENDDO
DLYJOB DLY(900)
GOTO CMDLBL(GET_STATUS)
RETURN
ENDPGM
****************** End of data ***************************************

Just leave it running in batch.

Regards,

Genghis


On Tue, 14 Nov 2000 02:36:20 GMT, "JSM" <jsmu...@urlmutual.com>
wrote:

Karl Hanson

unread,
Nov 14, 2000, 3:00:00 AM11/14/00
to

For the periodic wake-up, see the DLYJOB (Delay Job) command. DLYJOB
could be inside a loop in the CL program, so the job/program could run
indefinitely. It might be a good idea to include RTVJOBA ENDSTS() in
the loop, and exit the program when a controlled cancel has been
requested.

There may be a CL command to check controller status, but if not see the
Retrieve Configuration Status API:
http://publib.boulder.ibm.com/pubs/html/as400/v4r5/ic2924/info/apis/QDCRCFGS.htm

It appears the PING command sends message TCP3210 as either a completion
(*COMP) or escape (*ESCAPE). You could use MONMSG to monitor for the
escape, and RCVMSG to get the message replacement data (&1 of &2
successful) from the message (DSPMSGD TCP3210 QTCPMSG).

--

Karl Hanson

JSM

unread,
Nov 15, 2000, 3:00:00 AM11/15/00
to
Thank you all for your assistance. I've got 'good stuff' to work with now.
Let's see how I make out!

Take care,
Joe

"Karl Hanson" <kcha...@us.ibm.com> wrote in message
news:3A1143E0...@us.ibm.com...

0 new messages