ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Rtvjoba

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

  • Rtvjoba

    Hi all,

    Which attribute should I use to get the status of a job that was submitted with the command RTVJOBA? I just want to know if a job is active before I resubmit it again!

    Marvin.

  • #2
    Re: Rtvjoba

    marvin not sure that its gonna be that easy.......

    Im working on something like that right now...it lists *ALL jobs on system
    if running , in jobq , or if completed and in outq.....

    its using a couple of API's and I think that you could read thru the userspace
    created by the program and look for that job...

    let me know
    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: Rtvjoba

      that's too bad, is there any other way to check if a job is active in CLLE?

      Comment


      • #4
        Re: Rtvjoba

        you could do this

        PHP Code:
        WRKACTJOB OUTPUT(*PRINT) 

        copy that spooled file to a physical file
        then use rcvf to loop thru the mess lookin
        for the job.. now you wouldnt see it if
        it was in a jobq...only if it were running.

        I would let some "guy" finish his code and
        ask if I could borrow it
        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


        • #5
          Re: Rtvjoba

          Well there is an ingeniousness thing that consists in the CL to lock *exclusive an object (e.g. a data area specially created for that purpose) and unlock *exclusive this same object when the batch job is ending. From a command line you may then do wrkobjlck to check whether the dtaara is locked or not. If it's locked, the batch job is running (active).
          The downside of this method is when the batch job falls over, the dtaara remains locked.
          Last edited by Mercury; October 29, 2007, 09:43 AM.
          Philippe

          Comment


          • #6
            Re: Rtvjoba

            this is RPG ..... but it will work for you with some mild tweaks



            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


            • #7
              Re: Rtvjoba

              Thanks Jamie, I solved the program by creating a data area and in there when I submit the job I change what's inside from '0' to '1' and when I'm done with the job I change it back to '0'. So only when it's '0' the job can resubmit itself.

              Comment


              • #8
                Re: Rtvjoba

                Originally posted by mlcoolj View Post
                Thanks Jamie, I solved the program by creating a data area and in there when I submit the job I change what's inside from '0' to '1' and when I'm done with the job I change it back to '0'. So only when it's '0' the job can resubmit itself.
                That will work, but if the job fails for some reason, the data area will be stuck with a value of '1'

                Comment


                • #9
                  Re: Rtvjoba

                  Took care of that too, I just 'reset' the data area if the job fails...

                  Comment

                  Working...
                  X