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)
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.
  
 
== Service Prototype ==
 
== Service Prototype ==

Revision as of 21:46, 14 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.

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