Because SAS is an interpretive 4GL language, it assumes the length of the largest return value is the present one. I would bet the day value of 01 is trimmed and reduced to 1, which throws it off. You could send it a day greater than 09 and it would most likely work. AND, you have indeed found the solution: the LENGTH statement will 'type' the storage requirement of the variable. you might investigate the INPUT function and see if converting the incoming ORACLE date to a SAS date on the SELECT statement.
... View more