ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

How do you end batch jobs?

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

  • How do you end batch jobs?

    I'm working on a program to shut the system down in the event of a power failure.

    Is there a way to end batch jobs?

  • #2
    Re: How do you end batch jobs?

    Hi PMSLIC:

    Try This:

    Code:
     *
     *  When the SHTDN operation is run, a test is made to determine
     *  whether the system operator has requested shutdown.  If so,
     *  indicator 27 is set on.
    C
    C                   SHTDN                                        27
    C   27              EXSR      Term_appl
    C                   :
    C                   :
    C     Term_appl     BEGSR
    C                   CLOSE     *ALL
    C                   :
    C                   ENDSR
    or this

    Code:
     /FREE
       // If the operator has requested shutdown, quit the
       // program.
     
       IF %SHTDN;
          QuitProgram();
       ENDIF;
     /END-FREE
    Good Luck

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

    Comment


    • #3
      Re: How do you end batch jobs?

      I'm using CL

      Comment


      • #4
        Re: How do you end batch jobs?

        How are you ending the interactive jobs? The same code will work on the batch jobs. Although you may want to hold the jobqs first

        HLDJOBQ JOBQ(LIBNAME/JOBQNAME)

        Best of luck

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

        Comment


        • #5
          Re: How do you end batch jobs?

          You could always use commitment control in batch programs then if they end the commit will not be issued and the updates will all rollback....as if they didnt happen at all.


          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


          • #6
            Re: How do you end batch jobs?

            very good ! i have tesed !

            Comment

            Working...
            X