Appendix A. Business logic examples 149
Although it is permissible to do a string comparison using the internal date format with the
slashes removed as in this comparison, you must use the REXX Date() function with Base
dates in order to do any real mathematical processing:
days = date('b',date2,'s') - date('b',date1,'s')
The time values must also be converted for processing to minutes:
minutes1 = hhmm2min(S0C6A) /* Convert time occurred to mins */
minutes2 = hhmm2min(S0C71) /* Convert time completed to mins */
total_minutes = minutes2 - minutes1
It is possible for time 2 to be less than time 1 even though the date and time pair 2 actually
occurred after the date and time pair 1. In that case, total_minutes will be negative and a day