You have not told this step that you want to use the data entered:
Instead of
data e1;
put r;
e=modz(p,3);
;run;
I think that you want
data e1;
set p1;
put r;
e=modz(p,3);
run;
The SET statement is one of the statements to bring other data into the current data step code.
You have a similar problem here with no data source:
data send;
if(
e=0 then
put "send";
else
put "do not send"
;run;
Big problem: the numeric value 22101 you are using does not correspond to the date of 1 Oct 2022. It is actually 05JUL2020 when used with date functions. So your result would not be correct.
When you want to specify a date value then you use a date literal such as r ='01OCT2022'd; The form of the text must be in one of the formats the DATE format uses. Strongly recommend using a 4-digit year so there is never any question. The quotes, can be single or double, and the letter D immediately following tell SAS to use the value as an internal date. Also this way it is easy for a human to know the actual date intended. Five-digit dates like 22101 are most likely interpreted as Julian dates (year followed by day sequence in year) and 22101 would be mid-April. Even if you had included the leading zero for day, such as 221001, that essentially random string of digits could be 22 Oct 2001 (or 1901 depending on system settings).
So use the date literal construct.
There are similar constructs for time and datetime values.