MPE/iX Commands Reference Manual (32650-90877)
Chapter 12 481
Command List X
Commands SAVE thru SHUTQ
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
.
In the following example the CONTINUE command prevents an abort in case of errors; the
RUN CHEKPROG edits, verifies, and counts valid transactions; the IF command specifies that
if no fatal errors occur, schedule shipments; the RUN command schedules the shipments;
the ELSE command produces the error report and resets the JCW to 0; and the RUN
command produces a final report:
!SETJCW CHEKPROGSTAT=OK
!CONTINUE
!RUN CHEKPROG
! IF CHEKPROGSTAT<FATAL THEN
! RUN SHIPPROG
! ELSE
! SHOWJCW CHEKPROGSTAT
! RUN ERRORRPT
!ENDIF
!RUN FINALRPT