RPG liefert das leider so nicht, aber SQL:

d MyDate s d
d MyDay s 3 0

/exec sql set :MyDay = DAYOFWEEK(:MyDate)
/end-exec

1=Sonntag, 2=Montag....