× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



DUDE!  <applause>


On 8/30/2023 11:54 AM, Larry "DrFranken" Bolhuis wrote:
The first program below will hold all jobs NOT currently on hold and record them in a file. Run this before the upgrade.

The second program reads that file and releases them again. The file is then deleted.  Run this program after the upgrade.

/* =\           ++ /-\          */
/* =====#######/  \   +      F r a n k e n i . c o m     +  \ ####*/
/* =====#######    \-/  Copyright 2020, All rights reserved  \ /####*/
/* =/ \+/     */
/*                                                                    */
/*     Program to hold all scheduled jobs. Only 'SCHEDULED' status are*/
/* Held                                                           */
/*                                                                    */
/* DrF    Nov/2020 - Created                                          */
/*                                                                    */
/* =====####### ####*/
Pgm

    Dclf  JobScdHeld OpnID(A) DclBinFld(*INT) AlwGraphic(*Yes) AlwVarLen(*Yes)

    Dcl   &ScdJobNamV *Char 12  /* Sched Job Name Variable */
    Dcl   &ScdJobName *Char 10  /* Name only part of Variable Length Field */
          Stg(*Defined) DefVar(&ScdJobNamV 3)
    Dcl   &Loop    *Lgl    /* Loop Control         */
    Dcl   &EntryT  *Char 6 /* Entry number as Text */

    ChkObj Qgpl/JobScdHeld *File
    MonMsg CPF9801 Exec(Do) /* Only proceed if file doesn't already exist */

    /* Generate file of job scheduler jobs that are in SCHEDULED status */
      RunSql SQL('CREATE  TABLE qgpl.JobScdHeld As
        (select ScdJobName, EntryNo from Qsys2.Scheduled_Job_Info Where
        status in ''SCHEDULED'') With Data')
        Commit(*None) Naming(*SQL)

      ChgVar &Loop '1'
      Rcvf OpnID(A)           /* Read file of SCHEDULED jobs. */
      MonMsg CPF0864 Exec(Do)

        ChgVar &Loop '0'
      EndDo
      DoWhile  &Loop

        ChgVar &EntryT      &A_EntryNo
        ChgVar &ScdJobNamV  &A_ScdJobName
        HldJobScde Job(&ScdJobName) EntryNbr(&EntryT) /* Hold the job *

        Rcvf OpnID(A)              /* Read next SCHEDULED job. */
        MonMsg CPF0864 Exec(Do)    /* EOF                      */
          ChgVar &Loop '0'         /* Set Exit flag */
        EndDo
      EndDo                        /* End jobs to hold loop.   */
      SndPgmMsg  Msg('All Scheduled jobs now on hold.')
      Return                       /* Jobs held. We're done.   */
    EndDo
    SndPgmMsg  Msg('Jobs are already on hold. No action taken.')
    Return

EndPgm



/* =====####### #####
/* =\           ++ /-\          */
/* =====#######/  \   +      F r a n k e n i . c o m     +  \ ####*/
/* =====#######    \-/  Copyright 2020, All rights reserved  \ /####*/
/* =/ \+/     */
/*                                                                    */
/*     Program to release scheduled jobs previously held              */
/*                                                                    */
/*                                                                    */
/* DrF    Nov/2020 - Created                                          */
/*                                                                    */
/* =====####### ####*/

Pgm

    Dclf  JobScdHeld OpnID(A) DclBinFld(*INT) AlwGraphic(*Yes) AlwVarLen(*Yes)

    Dcl   &ScdJobNamV *Char 12  /* Sched Job Name Variable */
    Dcl   &ScdJobName *Char 10  /* Name only part of Variable Length Field */
          Stg(*Defined) DefVar(&ScdJobNamV 3)
    Dcl   &Loop    *Lgl    /* Loop Control         */
    Dcl   &EntryT  *Char 6 /* Entry number as Text */

    ChkObj JobScdHeld *File
    MonMsg CPF9801 Exec(Do)        /* File won't exists if jobs not held */
      SndPgmMsg  Msg('No jobs currently held, no action taken.')
      Return
    EndDo

      ChgVar &Loop '1'
      Rcvf OpnID(A)              /* Read list of previously held jobs.*/
      MonMsg CPF0864 Exec(Do)    /* In case there are none!   */
        ChgVar &Loop '0'
      EndDo
      DoWhile  &Loop             /* For each held job... */

        ChgVar &EntryT      &A_EntryNo
        ChgVar &ScdJobNamV  &A_ScdJobName
        RlsJobScde Job(&ScdJobName) EntryNbr(&EntryT) /* Release it. */

        Rcvf OpnID(A)
        MonMsg CPF0864 Exec(Do)
          ChgVar &Loop '0'
        EndDo
      EndDo                      /* End of read file loop. */

    Dltf JobScdHeld        /* Delete the file indicating all released */
    SndPgmMsg  Msg('Previously Held jobs now released.')

    Return
EndPgm



On 8/30/2023 8:05 AM, Howie, Bill wrote:
Hello all,

We are preparing to do a major upgrade to our ERP package over the long Labor Day weekend.  I'm formulating our checklist of things to go through, and I have a question about the job schedulers on the IBM i.  Here are my questions:


   *   For the Advanced Job Scheduler, I know that I can just issue the ENDJS command to effectively stop it.  How does it work, though, with jobs that would have been submitted during our downtime?  Does the system still know those are there and accumulate them and submit them once I do the STRJS command?
   *   With the "old", "basic" job scheduler (WRKJOBSCDE), is there a way to end that?  I don't recall ever seeing a command that does that.  If there is a way to end it, does the system know those jobs are there and accumulate them as well?
   *   OR, should I just hold all the job queues in the system and leave them held for the duration of the upgrade?

I'd appreciate any and all thoughts on this.  Thanks!

      Bill Howie[Related image]<https://www.hc-companies.com/>
       Senior ERP Programmer/Analyst
       Office: 330.486.5818 | Cell: 330.486.5818 | Toll Free: 800.225.7712
       2450 Edison Blvd., Suite 3, Twinsburg, OH 44087
       hc-companies.com<https://www.hc-companies.com/>
       Leader in Horticultural Containers
       [cid:c8a2ceee-9aaa-4f45-95c3-dcebbfcced1f] <https://www.linkedin.com/company/the-hc-companies> [cid:ede5db42-a5b7-46a3-be2e-8f9265b5c010] <https://www.facebook.com/HCCompanies/> [cid:4289df4f-6ed9-49c9-a02d-1da4ead0e711] <https://www.instagram.com/hccompanies/> [cid:87cc765b-1579-447e-8b1c-93c1533d5318] <https://twitter.com/hc_companies>

Disclaimer

The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.

This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.



As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.