Home > AS/400 Tips > iSeries administrator tips > How to set up an autostart job
iSeries 400 Tips:
EMAIL THIS
 TIPS & NEWSLETTERS TOPICS 

ISERIES ADMINISTRATOR TIPS

How to set up an autostart job


Ron Turull
10.13.2004
Rating: -4.62- (out of 5)


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



[IMAGE]
[IMAGE][IMAGE]
Ron Turull [IMAGE]
[IMAGE]

More than likely you have run into a situation where you wanted a program or command to run automatically when, for example, the system IPL'd. The obvious solution in this instance is to put the necessary code into your start-up program (i.e., the program specified for the QSTRUPPGM system value). But what do you do when, for example, you want a program to run automatically only when a specific subsystem is started? Some reasons you may want to do this:

  • To set up a special environment when the QSNADS or QSERVER subsystem starts.
  • To start the print writers when the QSPL subsystem starts.

The solution: Attach an autostart job entry to the subsystem

An autostart job entry is a job that runs automatically when a subsystem is started. In fact, the system start-up program is called from the autostart job entry QSTRUPJD attached to the QCTL and QBASE subsystems. Note: This is the default configuration; your configuration may vary.

More Information


[IMAGE]

An autostart job entry consists of a job name and a job description. The job description is the key. Every job description has an attribute called the request data. When you create a job description using the CRTJOBD command, one of the paramete...


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



RELATED CONTENT
OS/400
Top 10 backup commands
Take control of your iSeries
How to save time using the CPYTOPCD and CPYFRMPCD commands
Top Q&A's on the OS/400
Top 10 security tips
Use caution when providing access to file shares
How does Sarbanes-Oxley affect you?
Automated disaster recovery revisited
Top 10 Administrator Tips
User profile exit points make administrators' lives easier

iSeries administrator tips
Translating Linux for IBM i admins: Using GUI to make it easy
Translating Linux for IBM i admins: Working with jobs and networking
OpenOffice: What to know before making the transition from Microsoft Office
OpenOffice: An enterprise open source solution
Database performance comparisons on IBM i
Translating Linux for IBM i admins: User profile commands
Modern System i reports using Client Access
Tips for installing Lotus Domino server on a System i partition
The iSeries Blog has a new home on IT Knowledge Exchange
Virtualization for IBM i: Backups

Systems Management
Can you trust all those trigger programs?
Are your backups complete?
Controlling remote command processing
Watch your profiles
Avoid locking issues
Send message to users at a remote site
Security journal receiver management
Top 10 backup commands
Tracking critical file access in real time
Create an iSeries Access image and update it with the latest Service Pack

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


rs is Request data or command (RQSDTA). The system runs the command specified for this parameter whenever a job is started using the job description. When the job description is "attached" to a subsystem description in one of its autostart job entries, the job description's request data command will then become the autostart program (or command).

Three steps to set up an autostart program

Follow these steps to set up and attached an autostart program to a subsystem so that each time the subsystem is started, the autostart program is executed:

  1. Create the autostart program. This program is responsible for doing whatever it is you want to do. For example, say we create program AJEPGM in library QUSRSYS. Note: If you merely want to execute a single system command, such as STRPRTWTR DEV(PRT02), you can skip this step since you can just specify such a command as the request data.
  2. Create a job description. On the request data parameter (RQSDTA), specify a call to the program created in step 1 (or specify the system command if you did not create an autostart program). For example, we can create a job description AJEJOBD in library QUSRSYS with the following command:

    CRTJOBD JOBD(QUSRSYS/AJEJOBD) USER(QPGMR)
    RQSDTA('CALL QUSRSYS/AJEPGM')

    You must specify a user profile name on the USER parameter. The default *RQD is not valid for job descriptions used for autostart jobs. The user profile specified must also have the necessary authority, as the autostart job will run under that profile.

  3. Add an autostart job entry to the subsystem. Use the ADDAJE command to "link" the job description to the subsystem description. The following command links the job description created in step 2 to the subsystem description QBATCH:

    ADDAJE SBSD(QBATCH) JOB(TESTAJE)
    JOBD(QUSRSYS/AJEJOBD)

Four important things to remember when using autostart jobs

  1. Autostart jobs run in batch, so only batch commands are valid.
  2. Autostart jobs run in the subsystem for which they are specified unless specifically submitted to another subsystem.
  3. Autostart job entries can be added and removed while the subsystem is active.
  4. Use the RMVAJE command to remove an Autostart job entry from a subsystem description.
  5. -----------------------------------
    About the author: Ron Turull is editor of Inside Version 5. He has more than 20 years' experience programming for and managing AS/400-iSeries systems.


    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.




    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