Is DDI_d in Data_1? Where statements apply to values that already exist in the source data set(s). Your code does not show that variable on the Where statement shown so sort have to guess. Since you show DDI on your where statement I would expect the error to be more like:
5 data example;
6 set data_1;
7 where '1JUL2019'd<=DDI<='30JUN2020'd;
ERROR: WHERE clause operator requires compatible variables.
8 run;
because date literals are numeric and your DDI variable is stated to be character.
Best practice on this forum is when you have a question about an error, warning or note to copy from the LOG the entire data step or procedure that generates the message along with all error, notes and warning messages and then paste the whole thing into a text box opened on the forum using the </> icon at the top of the message box. The text box preserves the formatting of any of the diagnostic characters SAS often supplies with errors.
If you want to filter on what may be the newly created variable DDI_d then use:
IF '1JUL2019'd<=DDI_d<='30JUN2020'd;