Home > AS/400 Tips > WebSphere Strategies for iSeries professionals > WebSphere 3.5 application start/stop utility
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

WEBSPHERE STRATEGIES FOR ISERIES PROFESSIONALS

WebSphere 3.5 application start/stop utility


Christopher Schletty
06.21.2002
Rating: --- (out of 5)


Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   


This CL program may be used to start or stop a Websphere 3.5 application server from a green-screen command line, via a submitted job. It comes in handy when there is a desire to automate stopping and starting of individual WebSphere app servers.

The WSCP interface is used and it works fine on WebSphere 3.5.4 (Std and Adv) and above. Although not tested on WAS 4.0, it should work after changing the path on the "CD" command to the appropriate 4.0 path (e.g. WebASAdv4).



Code

  /*********************************************************************/ 
/* Function:   Start/Stop Websphere Application Server               */ 
/* Date:       17Jun02                                               */ 
/* By:         C.Schletty                                            */ 
/*                                                                   */ 
/* This program starts or stops the specified Websphere App Server   */ 
/* It uses the WSCP command line interface which is invoked via      */ 
/* Qshell.  The two-line script is passed as a parameter to Qshell.  */ 
/*                                                                   */ 
/* Parameters: Application Server Name (25 char)                     */ 
/*             Action (stop | start)                                 */ 
/*                                                                   */ 
/*                                                                   */ 
/* Example Qshell command script:                                    */ 
/*                                                                   */ 
/*   cd /QIBM/ProdData/WebASAdv/bin                                  */ 
/*                                                                   */ 
/*   wscp -c ApplicationServer start                                 */ 
/*           /Node:myas400/ApplicationServer:myapp/                  */ 
/*                                                                   */ 
/*********************************************************************/ 
                                                                        
             PGM        PARM(&SERVER &ACTION)                           
                                                                        
/*********************************************************************/ 
/* Variables */                                                         
/*********************************************************************/ 
                                                                        
             DCL        VAR(&NODE) TYPE(*CHAR) LEN(25) +                
                          VALUE('myas400') /* This is +    
                          the name of the NODE as know by Websphere */  
             DCL        VAR(&SERVER) TYPE(*CHAR) LEN(25)                
             DCL        VAR(&ACTION) TYPE(*CHAR) LEN(5)                 
             DCL        VAR(&CMD) TYPE(*CHAR) LEN(200)                  
                                                                        
/*********************************************************************/ 
/* Default error handling */                                            
/*********************************************************************/ 
                                                                        
             MONMSG     MSGID(CPF0000)  /**/                            
                                                                        
/*********************************************************************/ 
/* Validate action.                                                  */ 
/*********************************************************************/ 
                                                                        
/* Insure action is lower case. */                                      
                                                                        
              IF         COND(&ACTION = 'START') THEN(CHGVAR +           
                           VAR(&ACTION) VALUE('start'))                  
              IF         COND(&ACTION = 'STOP') THEN(CHGVAR +            
                           VAR(&ACTION) VALUE('stop'))                   
                                                                         
 /* Only 'start' or 'stop' is valid. */                                  
                                                                         
              IF         COND((&ACTION *NE 'start') *AND (&ACTION *NE +  
                           'stop')) THEN(SNDPGMMSG MSGID(CPF9898) +      
                           MSGF(QCPFMSG) MSGDTA('Invalid Action.  +      
                           Should be ''stop'' or ''start''') +           
                           MSGTYPE(*ESCAPE))                             
                                                                         
 /*********************************************************************/ 
 /* Start Server.                                                     */ 
 /*********************************************************************/ 
                                                                         
 /* Build start command */                                               
                                                                         
              CHGVAR     VAR(&CMD) VALUE('cd +                           
                           /QIBM/ProdData/WebASAdv/bin;wscp -c +         
                           "ApplicationServer' *BCAT &ACTION *BCAT ' +   
                           /Node:' *TCAT &NODE *TCAT +                   
                           '/ApplicationServer:' *TCAT &SERVER *TCAT +   
                          '/"')         
                                        
/* Start/Stop server */                 
                                        
             QSH        CMD(&CMD)       
                                        
             ENDPGM       

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

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

The Best Web Links: tips, tutorials and more.

Check out this live Q&A with Dave Slater and Jim Mason, How to best get started with WebSphere Development Tools.


Rate this Tip
To rate tips, you must be a member of Search400.com.
Register now to start rating these tips. Log in if you are already a member.




Digg This!    StumbleUpon Toolbar StumbleUpon    Bookmark with Delicious Del.icio.us   



RELATED CONTENT
Web Tools
Putting data from IBM i on Amazon S3 using i2S3
TAATOOL: Useful tools for programmers on IBM i
Programming for the Web on the IBM i, what is possible
Zend Web software teams up with IBM System i
Using geocoding on AS/400 to enhance your Web presence
The iSeries Blog has a new home on IT Knowledge Exchange
The best technologies and tools for System i programmers in 2009
Search400.com Products of the Year 2008
Application modernization strategies for System i
Natively supported Web applications for Power running i

Web Servers
System i no longer the stepchild of IBM's world
Connecting WebSphere to AS/400 for image retrieval
Weaving in WebSphere
SOA enhancements drive IBM WebSphere feature packs
SOA means money for IT workers
Enable J2EE app on WAS to access DB2
Securing Apache: Keeping patches current
IBM runs USOpen.org on Power boxes
MoMA's IT makeover a mix of old and new
How does RPG talk to a browser?

WebSphere Strategies for iSeries professionals
Application modernization strategies for System i
Application modernization in the i world
Natively supported Web applications for Power running i
Enterprise open source basics
Basic security considerations for a Domino/WebSphere system
Simplifying data access using Java Standard Tag Library
Integrating Microsoft ActiveX components with WebSphere
Choices for running Web workloads on iSeries
Virtual hosting for iSeries Web applications
Automate WebSphere configuration backups on the iSeries (i5)

RELATED GLOSSARY TERMS
Terms from Whatis.com − the technology online dictionary
WebSphere Development Studio Client (WDSC)  (Search400.com)

RELATED RESOURCES
2020software.com, trial software downloads for accounting software, ERP software, CRM software and business software systems
Search Bitpipe.com for the latest white papers and business webcasts
Whatis.com, the online computer dictionary

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.



iSeries Security - Security Tools, Physical Security and System Security
HomeNewsTopicsITKnowledge ExchangeTipsBlogsAsk the ExpertsMultimediaWhite PapersProducts
About Us  |  Contact Us  |  For Advertisers  |  For Business Partners  |  Site Index  |  RSS
SEARCH 
TechTarget provides technology professionals with the information they need to perform their jobs - from developing strategy, to making cost-effective purchase decisions and managing their organizations' technology projects - with its network of technology-specific websites, events and online magazines.

TechTarget Corporate Web Site  |  Media Kits  |  Site Map




All Rights Reserved, Copyright 1999 - 2009, TechTarget | Read our Privacy Policy
  TechTarget - The IT Media ROI Experts