Skip to main content
Version: OpCon 23.0 (On-Prem)

Check Schedule and Job Status

The Check Schedule and Job Status utility (SMAChkStat.exe) checks schedule and job statuses in OpCon. This utility provides various logical operators to compare job statuses.

Rules

The SMAChkStat.exe utility allows the comparison of the status description of a job or schedule to a specific value(s).

  • Based on whether the job or schedule's status code matches the comparison expression, the utility either fails or succeeds. If it fails, the utility returns an exit code of 33001; otherwise, it returns a zero (0). As a consequence, this utility enables branching to different jobs or to different OpCon events based on the job or schedule's current status.
  • The ChkStat command line must support a 40-character schedule name.
  • The ChkStat command line must support a 128-character job name.

Syntax

Insert the SMA Check Status executable in a job's command line using the following syntax:

smachkstat.exe ScheduleDate ScheduleName "ComparisonExpression" [JobName]

Parameters

The following describes the command-line parameters:

  • SMAChkStat.exe: This file is the program executable. The utility is installed in the <Target Directory>\OpConxps\Utilities\ directory.
  • ScheduleDate: This parameter is the date on which the schedule was built. The parameter accepts any valid date format matching the syntax recognized by the regional settings of the user running the utility.
    • If the Schedule Date contains space, enclose the parameter in double quotes (e.g., "[[$SCHEDULE DATE]]").
  • ScheduleName: This parameter is the schedule's name defined in the database. Make sure the schedule name exists for the specified date and a job exists in the schedule.
    • If the database has a binary sort order, the schedule name is case-sensitive.
    • If the Schedule Name contains space, enclose the parameter in double quotes (e.g., "Schedule Name".
  • ComparisonExpression: This parameter is the job/schedule status logical expression to be evaluated against the OpCon job/schedule status.
  • JobName (Optional): This parameter is the name of the job in the Daily schedule that is checked for a particular status.
    • If the job name is given, then the utility checks for a job status using the Job Status Keywords.
    • If the job name is not given, then the utility checks for schedule status, using the Schedule Status Keywords.
    • If the database has a binary sort order, the job name is case-sensitive. Do not include the square brackets in the syntax ([]).
    • If the Job Name contains spaces, enclose the parameter in double quotes (e.g., "Job Name").

Relational Operators

Order of OperationsOperatorDescription
1( )Groups expressions
2!Logical NOT
3&Logical AND
4

Job Status Keywords

KeywordJob Status
ON_HOLDOn Hold
RELEASEDQualifying
WAITINGWaiting for Dependency or Resource
RUNNINGRunning
CANCELEDCancelled
FINNED_OKFinished OK or Marked Finished OK
FAILEDFailed or Marked Failed
MISSEDMissed Start Time

Schedule Status Keywords

KeywordSchedule Status
ON_HOLDOn Hold
RELEASEDWaiting for Start Time
RUNNINGIn Process
FINISHEDCompleted

Sample Expressions

ExpressionMeaning
"ON_HOLDMISSED"
"!(RUNNING)"NOT RUNNING
"!(RUNNING) & ! (CANCELED)"NOT RUNNING AND NOT CANCELLED
"!(WAITING)CANCELED"

Logging

note

The Output Directory was configured during installation. For more information, refer to File Locations in the Concepts online help.

  • The SMACheckStat.log file provides detailed information of errors generated during the utility's execution. The log file resides in the <Output Directory>\SAM\Log\ directory. The syntax for the log file name is SMACheckStat_<date-time stamp>.log.
  • All archived log files reside in the <Output Directory>\SAM\Log\Archive\ folder. If an archive folder for the day does not already exist, the utility creates one. The folder names use the following naming convention: yyyy_mm_dd (Weekday). The logging mechanism generates the weekday name according to the Regional Settings of the user running the utility.
    • If the Regional Settings are set to English, an archive folder would have the following name: 2008_01_11 (Friday).
    • If the Regional Settings are set to French, an archive folder would have the following name: 2008_01_11 (Vendredi).

Once per day the SAM deletes old archive folders. The SAM retains 10 days of archived logs by default. If desired, change the Logging settings in the Global Options. Refer to Maximum number of days archived SAM logs should be kept setting.

note

The SAM does not purge any Archive folders if any files other than archived files are present.

Exit Codes

The SMAChkStat.exe program uses the following exit codes:

Exit CodeExit Description
0Criterion is true.
33001No matching records found. The criterion is false. Review the command line for schedule name, job name, and job status and make sure all of the parameters are valid.
33002Command-line syntax error in the parameters. Parsing error.
33003Database connection information, Usercode, and Password information is incorrect or SMAODBCConfiguration.dat file is missing.
33004Unknown.