× 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.


  • Subject: Re: ending selective sessions in batch
  • From: kjennings@xxxxxxxxx
  • Date: Thu, 22 Jun 2000 14:30:41 -0400



Hi!  We had a super guy here that wrote 2 CL programs and an RPG program for us
to do exactly what you are saying.  At night, at a certain time, we kick off
this CL.  The CL will write to a file every active job within the QINTER
subsystem.  The file contains the job attributes  Then, an RPG program will read
the file and, based on user critereia, will end the job unless the user is one
that is designated not to end.  The RPG program uses a CL to end the jobs that
are active.  Here is the CL code for the first program:

0001.00              PGM

0002.00              DCL        VAR(&JOBNAME) TYPE(*CHAR) LEN(10)

0003.00              DCL        VAR(&USER) TYPE(*CHAR) LEN(10)

0004.00              DCL        VAR(&JOBNUMBER) TYPE(*CHAR) LEN(6)

0005.00              WRKSBSJOB  SBS(QINTER) USER(*ALL)

0006.00              RTVJOBA    JOB(&JOBNAME) USER(&USER) NBR(&JOBNUMBER)

0007.00              CPYSPLF    FILE(QPDSPSBJ) TOFILE(QGPL/QINTERJOBS) +

0008.00                           JOB(&JOBNUMBER/&USER/&JOBNAME) SPLNBR(*LAST)

0009.00              CALL       PGM(QGPL/ENDJOBS)

0010.00              DLTSPLF    FILE(QPDSPSBJ) JOB(&JOBNUMBER/&USER/&JOBNAME)

0011.00              ENDPGM



Here is the RPG source:

0001.00 FQinterjobsIF   F  256        Disk
0002.00  *
0003.00 IQinterjobsNS  01
0004.00 I                                  4   13  Job
0005.00 I                                 17   26  User
0006.00 I                                 30   35  Number
0007.00 I                                 39   43  Type
0008.00 I                                 49   54  Status
0009.00 I                                 68   73  Function
0010.00  *
0011.00 C                   Read      Qinterjobs
0012.00 C                   DoW       Not %EOF
0013.00 C                   If        (User <> 'AnyUser  ' And
0014.00 C                             User <> 'SomeUser  ' And
0031.00 C                             (Function <> 'PGM-PK' And

0032.00 C                             Function <> 'PGM-MN') And

0033.00 C                             Status = 'ACTIVE' And

0034.00 C                             Type = 'INTER'

0035.00 C                   Call      'EJQINTER02'

0036.00 C                   Parm                    Job

0037.00 C                   Parm                    User

0038.00 C                   Parm                    Number

0039.00 C                   EndIf

0040.00 C                   Read      Qinterjobs

0041.00 C                   EndDo

0042.00 C                   Eval      *InLR = *On


Here is the CL source for the program to end the selected jobs:

0001.00              PGM        PARM(&JOB &USER &NUMBER)
0002.00              DCL        VAR(&JOB) TYPE(*CHAR) LEN(10)
0003.00              DCL        VAR(&USER) TYPE(*CHAR) LEN(10)
0004.00              DCL        VAR(&NUMBER) TYPE(*CHAR) LEN(6)
0005.00              MONMSG     CPF0001
0006.00              ENDJOB     JOB(&NUMBER/&USER/&JOB) OPTION(*IMMED) +
0007.00                           ADLINTJOBS(*ALL)
0008.00              ENDPGM

I hope this helps you!

Kevin Jennings


+---
| This is the Midrange System Mailing List!
| To submit a new message, send your mail to MIDRANGE-L@midrange.com.
| To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com.
| To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.