/* rexx */ /*-------------------------------------------------------------------*/ /* */ /* REXX Exec : DATESUFF */ /* */ /* Description : Return the suffix of the day number passed. */ /* */ /* Created on : 1 Jun 2021 */ /* Created by : Wendy Miller */ /* : Userid MIT002 */ /* : Using ABBYDALE.DEVL.REXX(DATESUFF) */ /* */ /* Called by : PROGINO */ /* */ /* Calls : Nothing */ /* */ /* Panels Used : None */ /* */ /* Change Activity : */ /* */ /* ©Copyright of Abbydale Systems LLC. */ /* */ /*-------------------------------------------------------------------*/ Parse Arg myday /* Check for Help */ signal on novalue /* un-initialized vars*/ signal on halt /* attention key */ myday = STRIP(myday,,',') if myday > '0' then do if myday <= '31' then do Select When myday = '1' then do suff = 'st' end When myday = '2' then do suff = 'nd' end When myday = '3' then do suff = 'rd' end When myday = '21' then do suff = 'st' end When myday = '22' then do suff = 'nd' end When myday = '23' then do suff = 'rd' end When myday = '31' then do suff = 'st' end Otherwise suff = 'th' end end end else do say 'Invalid numeric' exit 8 end return suff /*-------------------------------------------------------------------*/ /* Trap NOVALUE Condition */ /*-------------------------------------------------------------------*/ novalue: say "NOVALUE entered from line" sigl say condition("D") say "The instruction is suppressed" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* Trap HALT Condition */ /*-------------------------------------------------------------------*/ halt: say "HALT acknowledged in line" sigl say "Cleanup processing in progress" address "TSO" "delstack" exit(16) /*-------------------------------------------------------------------*/ /* End of DATESUFF */ /*-------------------------------------------------------------------*/