ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

QSTRUP Program

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • QSTRUP Program

    Hi,

    I am pretty new to this iSeries stuff so bear with me

    My machine runs V5R4 and I have a few things that I need it to do whenever it IPL's. I need it to start a couple of subsystems, a program and Keyes fax communication. I am doing the programming in IBM Rational Developer. One thing I want a few opinions on is whether to create a new program and then set it as the startup program and write it like so
    PGM
    QSYS/CALL PGM(QSYS/QSTRUP)
    MONMSG MSGID(CPF0000)

    QSYS/STRSBS SBSD(DSTACX)
    MONMSG MSGID(CPF0000)
    QSYS/STRSBS SBSD(WEBJOBS)
    MONMSG MSGID(CPF0000)

    QSYS/CALL PGM(DSTDATA/STRTURBOWD)
    MONMSG MSGID(CPF0000)


    ENDPGM

    So that the original IBM Supplied startup program doesn't get touched at all. Or it is better to just retrieve the source for the originally supplied program and edit that then when I compile it compile to a different library such as QGPL and the make that the startup program or just edit that original program and compile to the QSYS library. I have a few other questions but they depend on the answer of the original question. Hopefully some of you guru's can give me your opinions on this.

    Thanks,

    Kelly Peterson

  • #2
    Re: QSTRUP Program

    I myself would create a second copy of the original program and compile
    to another system library. (using RTVCLSRC) Store the original source somewhere
    just because.

    Then change the system value QSTRUPPGM to point to the new program.

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

    Comment


    • #3
      Re: QSTRUP Program

      Originally posted by jamief View Post
      I myself would create a second copy of the original program and compile
      to another system library. (using RTVCLSRC) Store the original source somewhere
      just because.

      Then change the system value QSTRUPPGM to point to the new program.

      jamie
      Ok so if I do this do I have to qualify the libraries of all of the stuff that was in there originally from IBM since I am saving it to a different library? For Example

      QSYS/STRSBS SBSD(QSERVER)
      MONMSG MSGID(CPF0000)
      QSYS/STRSBS SBSD(QUSRWRK)
      MONMSG MSGID(CPF0000)
      QSYS/RLSJOBQ JOBQ(QGPL/QS36MRT)
      MONMSG MSGID(CPF0000)
      QSYS/RLSJOBQ JOBQ(QGPL/QS36EVOKE)
      MONMSG MSGID(CPF0000)

      That is part up the original startup program from IBM why did they qualify the libraray for the RLSJOB but not to start Subsystems?

      Comment


      • #4
        Re: QSTRUP Program

        Originally posted by Kellyp View Post
        Ok so if I do this do I have to qualify the libraries of all of the stuff that was in there originally from IBM since I am saving it to a different library? For Example

        QSYS/STRSBS SBSD(QSERVER)
        MONMSG MSGID(CPF0000)
        QSYS/STRSBS SBSD(QUSRWRK)
        MONMSG MSGID(CPF0000)
        QSYS/RLSJOBQ JOBQ(QGPL/QS36MRT)
        MONMSG MSGID(CPF0000)
        QSYS/RLSJOBQ JOBQ(QGPL/QS36EVOKE)
        MONMSG MSGID(CPF0000)

        That is part up the original startup program from IBM why did they qualify the libraray for the RLSJOB but not to start Subsystems?

        The Subsystems QSERVER and QUSRWRK are in QSYS library. If the library is not qualified, then the subsystem in QSYS will be started.

        The jobq's are located in QGPL. Because the startup job may not have QGPL in its library list, those need to be qualified. Also, any system supplied subsystem that you modify should be copied and placed in QGPL, and then qualified to be started in the startup job. This causes the startup job to start the correct modified subsystem instead of the default. (You dont want to modify the subsystem directly in QSYS because OS upgrades will overwrite them. )

        Go ahead and qualify your subsystems in the startup program.

        Check the current copy o the startup program by performing dspsysval qstruppgm

        If the program is anything other than QSTRUP in QSYS, then there is already a custom startup program i nplace, and you need to modify that program.

        If system is currently using QSTRUP in QSYS, then RTVCLSRC for the QSTRUP program into a CL source member in another lbrary such as QGPL. Then add in the new subsystems you want to start. (Qualifying those with the library name.) Then compile the CL program. You willl then need to change the QSTRUPPGM system value to the startup program name and new library (QGPL).
        Michael Catalani
        IS Director, eCommerce & Web Development
        Acceptance Insurance Corporation
        www.AcceptanceInsurance.com
        www.ProvatoSys.com

        Comment


        • #5
          Re: QSTRUP Program

          Originally posted by MichaelCatalani View Post
          The Subsystems QSERVER and QUSRWRK are in QSYS library. If the library is not qualified, then the subsystem in QSYS will be started.

          The jobq's are located in QGPL. Because the startup job may not have QGPL in its library list, those need to be qualified. Also, any system supplied subsystem that you modify should be copied and placed in QGPL, and then qualified to be started in the startup job. This causes the startup job to start the correct modified subsystem instead of the default. (You dont want to modify the subsystem directly in QSYS because OS upgrades will overwrite them. )

          Go ahead and qualify your subsystems in the startup program.

          Check the current copy o the startup program by performing dspsysval qstruppgm

          If the program is anything other than QSTRUP in QSYS, then there is already a custom startup program i nplace, and you need to modify that program.

          If system is currently using QSTRUP in QSYS, then RTVCLSRC for the QSTRUP program into a CL source member in another lbrary such as QGPL. Then add in the new subsystems you want to start. (Qualifying those with the library name.) Then compile the CL program. You willl then need to change the QSTRUPPGM system value to the startup program name and new library (QGPL).

          Thank you very much that makes perfect sense. Does the MONMSG MSGID(CPF0000) line tell it to ignore any errors and continue processing so that if I mess up it will still boot to a usable state and just not start the subsystems I specified? Also is there anyway to test the program other than just make the changes and IPL the system?

          Comment


          • #6
            Re: QSTRUP Program

            If you notice all that IBM's startup pgm is doing is starting sub-systems and printers.

            There should be no harm in just calling your startup program interactively as starting an already started sub-system will only tell you "subsystem xxxx is already started"

            Calling your programs more than once may be a different issue

            Best of Luck
            GLS

            < edit >
            I put my startup program in qgpl.....and run it from qgpl. (via system value)
            Modification below:
            Code:
            /* BEGIN CUSTOM CODE              */                          
            /*                                    */                          
                 QSYS/STRSBS SBSD(QSNADS)                                     
                 MONMSG MSGID(CPF0000)                                        
                 QSYS/STRSBS SBSD(QSYS/QPGMR)                                 
                 MONMSG MSGID(CPF0000)                                        
                 QSYS/STRSBS SBSD(QGPL/GVBATCH)                               
                 MONMSG MSGID(CPF0000)                                        
                 QSYS/STRSBS SBSD(QGPL/CABATCH)                               
                 MONMSG MSGID(CPF0000)                                        
                         QSYS/STRSBS SBSD(ESEND/EFWD)                         
                 MONMSG MSGID(CPF0000)                                        
                         QSYS/STRSBS SBSD(FARMTAS/QINTERTAS)                  
                  MONMSG MSGID(CPF0000)                                       
            /* CELL PHONE CALL IF MSGW CONDITION EXISTS */                    
                         SBMJOB     CMD(CALL PGM(MYLIB/MSGWC)) JOB(MSGW) +  
                                      JOBD(QGPL/SCHEDULE6) USER(LEUSER)

            < / edit >
            Last edited by GLS400; August 9, 2011, 02:06 PM.
            The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

            Comment


            • #7
              Re: QSTRUP Program

              Originally posted by GLS400 View Post
              If you notice all that IBM's startup pgm is doing is starting sub-systems and printers.

              There should be no harm in just calling your startup program interactively as starting an already started sub-system will only tell you "subsystem xxxx is already started"

              Calling your programs more than once may be a different issue

              Best of Luck
              GLS

              Ok I will give that a try. I am going to be starting a program with QSYS/CALL PGM(DSTCUST/STRTURBOWD) is that the proper way to do it or should I submit it as a job? Is IBM Rational Developer a popular development platform? Or is there something better I should try out?

              Comment


              • #8
                Re: QSTRUP Program

                Hi Kelly:

                Just the call not the submit.

                Best of Luck
                GLS
                The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                Comment


                • #9
                  Re: QSTRUP Program

                  Im sorry I didn't understand that. In order to start a program should I do it like this QSYS/CALL PGM(DSTCUST/STRTURBOWD) or should I do it like this? SBMJOB CMD(CALL PGM(DSTCUST/STRTURBOWD)) JOB(WEB_XML) +
                  USER(SUPPORT)

                  Comment


                  • #10
                    Re: QSTRUP Program

                    Hi Kelly:

                    Just the call:

                    QSYS/CALL PGM(DSTCUST/STRTURBOWD)

                    If you are doing this from a green screen command line you don't need the qsys/
                    CALL PGM(DSTCUST/STRTURBOWD)

                    If dstcust is in your library list and you are calling from a command line
                    CALL STRTURBOWD

                    Best of Luck
                    GLS
                    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                    Comment


                    • #11
                      Re: QSTRUP Program

                      Ok I am going to compile this and give it a shot. If there is anything wrong with the lines I added to the startup program it will still run all of the other commands in the program and just the incorrect lines will error out correct?

                      Comment


                      • #12
                        Re: QSTRUP Program

                        One more question does the startup program always run as QPGMR?

                        Comment


                        • #13
                          Re: QSTRUP Program

                          If there is anything wrong and you dont monitor for the errors then the system will hang on reboot...

                          jamie
                          All my answers were extracted from the "Big Dummy's Guide to the As400"
                          and I take no responsibility for any of them.

                          www.code400.com

                          Comment


                          • #14
                            Re: QSTRUP Program

                            Hi Kelly:
                            Nice article here on modifing qstrup:
                            http://www.itjungle.com/fhg/fhg091207-story03.html


                            One more question does the startup program always run as QPGMR?

                            When I create cl programs that are not security sensitive I use this:
                            Code:
                             CRTBNDCL PGM(MYLIB/MYPGM) SRCFILE(MYLIB/MYFILE) USRPRF(*OWNER) AUT(*ALL) DBGVIEW(*LIST)
                            Using this method anyone can run it using the owner's profile....So it doesn't matter who runs it.



                            Best of Luck
                            GLS
                            The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

                            Comment


                            • #15
                              Re: QSTRUP Program

                              Originally posted by jamief View Post
                              If there is anything wrong and you dont monitor for the errors then the system will hang on reboot...

                              jamie

                              This is probably a really dumb question but doesn't having the line MONMSG MSGID(CPF0000) after each command make it so it won't hang if there is a problem?

                              Comment

                              Working...
                              X