Type : CREATION_INTERNE
Die Daten (Namen und E-Mails der Studenten) werden direkt im Skript über einen DATA-Schritt und die CARDS-Anweisung erstellt.
| 1 | %let local=C:\Papers_ALAN\GLOBALSAS\2020; |
| 2 | |
| 3 | goptions reset=all iback="&local\template.PNG" |
| 4 | imagestyle=fit border; |
| 5 | |
| 6 | options noemailfrom emailsys=smtp emailhost=SMTP emailauthprotocol=login emailport=PORT |
| 7 | emailid="e-mail" emailpw="password"; |
| 8 | |
| 9 | DATA database; |
| 10 | INPUT name $1-37 email $38-66; |
| 11 | CARDS; |
| 12 | Alan da Silva djalan @bol.com.br |
| 13 | yyyyyyyyyyyyyyyyyyyyyyy yyy @email.com |
| 14 | zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz zzz @email.com |
| 15 | ; |
| 1 | DATA database;SET database; |
| 2 | call symput('name'||trim(left(_n_)),trim(left(upcase(name)))); |
| 3 | call symput('email'||trim(left(_n_)),trim(left(email))); |
| 4 | RUN; |
| 5 | %put &name1 &email1; |
| 6 | PROC SQL noprint; |
| 7 | select count(*) into:n from database; |
| 8 | QUIT; |
| 9 | %put &n; |
| 1 | %macro certificate(local=); |
| 2 | options nodate nonumber leftmargin=1cm rightmargin=1cm topmargin=1cm |
| 3 | bottommargin=1cm papersize=A4 orientation=landscape; |
| 4 | %DO i=1 %to &n; |
| 5 | ods pdf file="&local\certificate &&name&i...pdf" style=printer; |
| 6 | DATA text; |
| 7 | LENGTH function style $30. color $6. text $150.; |
| 8 | retain line 1 xsys ysys '2' hsys '3' x 8; |
| 9 | /* ... Code de génération des annotations (texte, positions, images) ... */ |
| 10 | text="The Department of Statistics of the University of Brasilia";OUTPUT; |
| 11 | /* ... suite des instructions output ... */ |
| 12 | RUN; |
| 13 | PROC GANNO anno=text;RUN; |
| 14 | ods pdf close; |
| 15 | filename myfile email |
| 16 | to= "&&email&i" |
| 17 | subject= "Certificate of Completion" |
| 18 | attach="&local\certificate &&name&i...pdf"; |
| 19 | DATA _null_; |
| 20 | file myfile; |
| 21 | put "Dear Student, please find attached the certificate of completion of the course of study."; |
| 22 | put " "; |
| 23 | put "Best regards"; |
| 24 | put "Prof. Alan Ricardo da Silva"; |
| 25 | RUN; |
| 26 | %END; |
| 27 | %mend certificate; |
| 28 | %certificate(local=&local); |