Type : CREATION_INTERNE
Die in diesem Skript manipulierten Daten (Datum, Uhrzeiten, E-Mail-Nachrichten) werden dynamisch generiert oder sind Literale. Es erfolgt keine externe Datenlesung oder Verwendung persistenter SAS-Datasets.
| 1 | dm 'output;clear'; |
| 2 | dm 'log;clear'; |
| 1 | %macro startT; |
| 2 | DATA _null_; |
| 3 | tempdate=put(date(),weekdate32.); |
| 4 | temptime=put(time(),hhmm5.); |
| 5 | call symput("startdate",tempdate); |
| 6 | call symput("starttime",temptime); |
| 7 | RUN; |
| 8 | %mend; |
| 1 | %macro endT; |
| 2 | DATA _null_; |
| 3 | tempdate=put(date(),weekdate32.); |
| 4 | temptime=put(time(),hhmm5.); |
| 5 | call symput("enddate",tempdate); |
| 6 | call symput("endtime",temptime); |
| 7 | RUN; |
| 8 | %mend; |
| 1 | %macro email(dt); |
| 2 | /* Set up the options for the email. */ |
| 3 | OPTIONS EMAILSYS=smtp EMAILID="kfong @cornerstone.com" |
| 4 | EMAILHOST=CRDCEXCH10.cornerstone.com; |
| 5 | FILENAME mymail |
| 6 | |
| 7 | TO = ("kfong @cornerstone.com") |
| 8 | SUBJECT="&dt. finished" |
| 9 | ; |
| 10 | /* Send the email and define the message to send. */ |
| 11 | DATA _NULL_; |
| 12 | FILE mymail; |
| 13 | PUT "Hello,"; |
| 14 | PUT " "; |
| 15 | PUT "The code for &dt. has finished running."; |
| 16 | PUT "Start: &StartTime. &StartDate. "; |
| 17 | PUT "End: &EndTime. &EndDate. "; |
| 18 | RUN; |
| 19 | %mend; |
| 1 | %StartT; |
| 2 | %EndT; |
| 1 | DATA _null_; |
| 2 | put "Hello world!"; |
| 3 | RUN; |
| 1 | %Email(test); |