
Chapter 7 561
Command Definitions S-SO
SETJCW
The following example shows the use of the CIERROR JCW:
LISTF
^
UNKNOWN COMMAND NAME. (CIERR 975)
SHOWJCW CIERROR
CIERROR = 975
RUN
^
NO PROGRAM FILE SPECIFIED. (CIERR 600)
SHOWJCW CIERROR
CIERROR = 600
:
System-Reserved JCWs
The system-reserved JCWs are HPMINUTE, HPHOUR, HPDAY, HPDATE, HPMONTH, and
HPYEAR. They contain system-assigned minute, hour, day, date, month, and year
information. If the user attempts to assign values, an error message is displayed. You can
retrieve the values in these JCWs with the FINDJCW intrinsic. The values can also be
tested if the JCW is used with an IF, WHILE, SETJCW, SETVAR, or CALC command. The
names of the system-reserved JCWs are reserved.
The following describes system-reserved JCWs and possible values:
HPDAY Day of the week. The possible integers are 1 through 7. Sunday is
indicated by 1. Saturday is indicated by 7.
HPDATE Day of the month. The possible integers are 1 through 31.
HPMONTH Month of the year. The possible integers are 1 through 12. January is
indicated by 1.
HPYEAR Year of the century. The possible integers are 00 through 99.
HPHOUR Hour of the day. The possible integers are 0 through 23.
HPMINUTE Minute of the hour. The possible integers are 0 through 59.
Conditional Execution Using JCWs
JCWs are typically used to control the flow of batch jobs, based on events that take place
within the job. You can use the MPE/iX IF/THEN (ELSE/ELSEIF), ENDIF, and
WHILE/ENDWHILE statements to test JCW values.
The following example illustrates a conditional execution function. The sample job runs a
program that edits, verifies, and counts valid transactions (CHEKPROG). If no fatal errors
occur, the job runs the program SHIPPROG, which schedules shipments. The job then runs
FINALRPT, which produces a final report. If fatal errors do occur, the CHEKPROG sets the
value of the JCW CHEKPROGSTAT to FATAL, and SHIPPROG is not run. Instead, ERRORRPT
is run, which produces an error report. A final report is also produced by FINALRPT.
You can use the SHOWVAR command to display the value of any specified variable or any
group of variables, including JCW type variables. You can display the contents of a
system-defined JCW with the SHOWJCW command only if you specify the jcwname.