I am trying to create a CLANG expression based on hours of the day, in a similar way to days of the week. For example, if you want a statement to be evaluated based on multiple days of the week, you could use something like this:
IF TODAY(MON WED FRID) THEN DO X.
I would like to do this for hours, like this:
IF ESPSHH(07 09 11 13...) THEN DO X
What would be even better is if it were possible to create an expression based on odd number hours or even number hours, like this:
IF ESPAHH <is an even number> THEN DO X
IF ESPAHH <is an odd number> THEN DO Y
I am trying to avoid having to use 24 repetitive lines, like:
IF ESPAHH EQ '01' THAN DO X
IF ESPAHH EQ '02' THEN DO Y
IF ESPAHH EQ '03' THEN DO X
'IF ESPAHH EQ '04' THEN DO Y
etc. etc. etc.
Any help would be much appreciated!
Hope following coding helps:
Note: for even number, after it's divided and then multiplied by, it will be the same; but for odd number, it will be different.
APPL TEST INTEGER CHECK,CHECK1 CHECK = %ESPSHH CHECK1= %CHECK/2 CHECK1= %CHECK1*2 IF %CHECK = %CHECK1 THEN ECHO "EVEN" ELSE ECHO "ODD"
This worked perfectly! I read through the section on ESP Procedures in the User Guide, but I couldn't quite determine how to do this kind of math. This is a very nice example of it! Thank you very much!!!!