Tip

Automatically reactivate ELAN cable

If someone accidentally pulls your iSeries ELAN cable, normally you have to go to the console to enter a reply to reactivate it. But if you're not in the office this could cause you a problem. So why not develop a small CL program that does the reset for you? Here it is:
 

   2100      PGM
   2200      DCL VAR(&STATUS) TYPE(*DEC) LEN(5 0)
   2300      DCL VAR(&STATUS1) TYPE(*DEC) LEN(5 0)
   2400 START: +
   2500      RTVCFGSTS CFGD(ETHLINE) CFGTYPE(*LIN) STSCDE(&STATUS)
   2600      MONMSG MSGID(CPF0000)
   2700      DLYJOB DLY(180)
   2800      IF COND(&STATUS *EQ 60) THEN(GOTO CMDLBL(START))
   2900      DLYJOB DLY(5)
   3000      IF COND(&STATUS *NE 60) THEN(GOTO CMDLBL(AB))
   3001
/********************************************************************/

   3002      /* IN THIS SECTION THE STATUS OF ETHLINE IS MONITORED AND PUT
TO    */                                     
   3003      /* VAR &STATUS. IF THE RETURNED VALUE IS 60 WHICH MEANS ACTIV
*/                                     
   3004      /* NOTHING IS DONE AND AFTER THE DELAY OF 180 SEC'S PROG STARTS
*/                                     
   3005      /* AGAIN WITH RTVCFGSTS. IF &STATUS IS NOT EQUAL 60 THE PROG
GOES   */                                     
   3006      /* TO SECTION AB WHERE THE ETHLINE IS FORCED TO AN OFF STATE.
*/                                     
   3007      /* WHEN THE ETHERLINE CONECTION BREAKES &STATUS GOES TO 80
WHICH    */                                     
   3008      /* MEANS RCYPND OR 90 WHICH MEANS RCYCNL. THE FORCE IS
MANDATORY    */                                     
   3009      /* TO AVOID ANSWER TO CPA2610.
*/                                     
   3010      /*
*/                                     
   3011      /*
*/                                     
   3012      /*
*/                                     
   3013      /*
*/                                     
   3015
/********************************************************************/

   3100 AB: +
   3200      VRYCFG CFGOBJ(ETHLINE) CFGTYPE(*LIN) STATUS(*OFF)
FRCVRYOFF(*YES)
   3300      DLYJOB DLY(5)
   3400      GOTO CMDLBL(AN)
   3401
/********************************************************************/

   3402      /* VARY OFF OF ETHLINE WITH FRCVRYOFF (SEE NOT ABOVE)
*/                                     
   3403      /* AFTER THE LINE IS DOWN THER IS A DELAY OF 5 SECONDS AND PROG
*/                                     
   3404      /* SWITCHES TO SECTION AN.
*/                                     
   3411      /*
*/                                     
   3412
/********************************************************************/

   3500 AN: +
   3600      VRYCFG CFGOBJ(ETHLINE) CFGTYPE(*LIN) STATUS(*ON)
   3700      DLYJOB DLY(5)
   3800      RTVCFGSTS CFGD(ETHLITCP) CFGTYPE(*DEV) STSCDE(&STATUS1)
   3900      IF COND(&STATUS1 *NE 60) THEN(GOTO CMDLBL(STRIFC))
   3901
/********************************************************************/

   3902      /* HERE THE LINE IS AGAIN VARIED ON AND AFTER THE DELAY OF 5
SEC.   */                                     
   3903      /* THE STATUS OF ETHLITTCP IS MONITORED AND PUT IN VAR &STATUS1
*/                                     
   3904      /* ETHLINE IS NOW ACTIVE, ALSO CONTROLLER ETHLINET BUT THE
DEVICE   */                                     
   3905      /* ETHLITCP IS ONLY VARIED ON (STATUS 20) AND TCP INTERFACES
MUST   */                                     
   3906      /* BE STARTED NOW. THIS IS DONE IN THE FOLLOWING SECTION
STRIFC.    */                                     
   3907      /*
*/                                    
   3913      /*
*/                                     
   3914
/********************************************************************/

   4000 STRIFC: +
   4100      STRTCPIFC INTNETADR('192.168.X.Y')
   4200      DLYJOB DLY(5)
   4300      STRTCPIFC INTNETADR('192.168.X.YY')
   4400      DLYJOB DLY(5)
   4500      STRTCPIFC INTNETADR('192.168.Z.YYY')
   4600      DLYJOB DLY(5)
   4700      GOTO CMDLBL(START)
   4701
/********************************************************************/

   4702      /* HERE ALL THE TCP INTERFACES ATTACHED TO ETHLINE ARE STARTED
*/                                     
   4703      /* AFTER THE DELAYS THE PROG GOES AGAIN TO SECTION START AND
*/                                     
   4704      /* THE MONITORING STARTS AGAIN IN THE SAME MANOR.
*/                                     
   4712      /*
*/                                     
   4713      /*
*/                                     
   4714
/********************************************************************/

   4800 ENDPGM

                                 

==================================
MORE INFORMATION ON THIS TOPIC
==================================

The Best Web Links: Tips, tutorials and more.

Ask your systems management questions--or help out your peers by answering them--in our live discussion forums.

Read this Search400.com Featured Topic: Managing your iSeries.

Ask the Experts yourself: Our systems management gurus are waiting to answer your technical questions.

This was first published in February 2004

There are Comments. Add yours.

 
TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to:

Disclaimer: Our Tips Exchange is a forum for you to share technical advice and expertise with your peers and to learn from other enterprise IT professionals. TechTarget provides the infrastructure to facilitate this sharing of information. However, we cannot guarantee the accuracy or validity of the material submitted. You agree that your use of the Ask The Expert services and your reliance on any questions, answers, information or other materials received through this Web site is at your own risk.