DMSRVJOBSTATUS Function

Returns the status of a job that was submitted to a DataFlux Data Management Server.
Valid in: DATA step, PROC SQL, and SCL

Syntax

DMSRVJOBSTATUS (job-ID, host, port, time-out, interval )

Required Arguments

job-ID
identifies the job that was submitted to a DataFlux Data Management Server. The identifier is previously set by a function such as DMSRVBATCHJOB.
host
identifies the host of the DataFlux Data Management Server.
Interaction:If a zero-length string is entered for the host argument, then the value localhost will be used.
Example:
        /* Incorrect use of function arguments */
           dmsrvJobStatus('jobid');

        /* Localhost is used for the host */
           dmsrvJobStatus('jobid', '', 21036, 20, 5);

        /* Correct */
           dmsrvJobStatus('jobid', dmsrvhostname, 21036, 20, 5);   
port
identifies the port through which the host communicates with the DataFlux Data Management Server.
Interaction:If the value specified is less than or equal to 0, then port number 21036 is used with SOAP, or port number 21037 is used when using Wireline.
Example:
        /* Incorrect use of function arguments */
           dmsrvJobStatus('jobid');

        /* Port 21036 or 21037 is used */
           dmsrvJobStatus('jobid', dmsrvhostname, 0, 20, 5);

        /* Correct */
           dmsrvJobStatus('jobid', dmsrvhostname, 21036, 20, 5);   
time-out
a time in seconds that determines when status information is returned from the host. Valid values are defined as follows:
-1 returns status information about when the job is finished. Return values are 0 (job completed successfully) or 1 (job failed). This value invalidates the interval argument.
0 returns status information immediately. Return values are 0 (job completed successfully), 1 (job failed), or 2 (job running). This value invalidates the interval argument.
greater-than-zero specifies a time limit for the interval argument. If the job is still running after the time-out value, another value is returned only when the job is finished.
interval
the repeat period for the return of status information, within the limit that is imposed by the time-out argument.

Details

Use the DMSRVJOBSTATUS function to return job status information instantly, periodically, or at the completion of the job. With an interval of 20 and a time-out of 60, DMSRVJOBSTATUS returns status information up to four times. After 60 seconds, the last return value is provided at the completion of the job.
Return values are 0 (job completed successfully), 1 (job failed), or 2 (job running).

Example: DMSRVJOBSTATUS Function

The following example returns a status number for a job that ran or is running on a DataFlux Data Management Server. The job identifier was returned by the function that ran the job. Status information is returned in 20 seconds or less, depending on the termination of the job. Job status is checked every 5 seconds.
status= dmsrvJobStatus(jobid,'dmServer1', 5001, 20, 5);