Difference between revisions of "Job Not Active"

From MidrangeWiki
Jump to: navigation, search
(Created page with "Category:Sample Code Category:Service Procedures __FORCETOC__ == Summary == The following are the RPG/LE fully free-form definitions and instructions needed for using...")
 
(Summary)
 
(One intermediate revision by the same user not shown)
Line 3: Line 3:
 
__FORCETOC__
 
__FORCETOC__
 
== Summary ==
 
== Summary ==
The following are the RPG/LE fully free-form definitions and instructions needed for using the {{AN}} service procedure.  This service procedure simply allows the caller to make sure that a particular job is '''not''' active on the system.
+
The following are the RPG/LE fully free-form definitions and instructions needed for using the {{AN}} service procedure.  This service procedure simply allows the caller to make sure that a particular job is '''''not''''' active on the system.
 +
 
 +
By [[User:DaveLClarkI|Dave Clark]]
  
 
== Service Prototype ==
 
== Service Prototype ==

Latest revision as of 16:05, 17 December 2018


Summary

The following are the RPG/LE fully free-form definitions and instructions needed for using the Job Not Active service procedure. This service procedure simply allows the caller to make sure that a particular job is not active on the system.

By Dave Clark

Service Prototype

Place the following in a separate copybook for inclusion in both the caller and the service program source members.

**free

//******************************************************************************
// Simply reverses the result of the 'Job Is Active' service procedure.
//******************************************************************************
dcl-pr GenUtl_JobNotActive   ind;
  JobName                    char(10)  const;
  ListPtr                    pointer            options(*nopass:*omit);
  JobDesc                    likeds(QUSL010002) options(*nopass);
end-pr;

Service Procedure

Place the following in a service program source member.

**free
ctl-opt NoMain AlwNull(*UsrCtl) Debug Option(*SrcStmt:*NoDebugIo)
        DatFmt(*ISO) TimFmt(*ISO);

//******************************************************************************
// Simply reverses the result of the 'Job Is Active' service procedure.
//******************************************************************************
dcl-proc GenUtl_JobNotActive export;
  dcl-pi *n                  ind;
    JobName                  char(10)  const;
    ListPtr                  pointer            options(*nopass:*omit);
    JobDesc                  likeds(QUSL010002) options(*nopass);
  end-pi;

  select;                              // determine how called
    when %parms() < %parmnum(ListPtr)
    or   %parms() = %parmnum(ListPtr)
    and  %addr(ListPtr) = *null;
      return (not GenUtl_JobIsActive(JobName));
    when %parms() < %parmnum(JobDesc);
      return (not GenUtl_JobIsActive(JobName: ListPtr));
    when %addr(ListPtr) = *null;
      return (not GenUtl_JobIsActive(JobName: *omit: JobDesc));
  endsl;

  return (not GenUtl_JobIsActive(JobName: ListPtr: JobDesc));
end-proc;

References