Sie befinden sich in den Archiven der Kategorie SAS Macros.
| M | D | M | D | F | S | S |
|---|---|---|---|---|---|---|
| « Apr | ||||||
| 1 | 2 | 3 | 4 | 5 | ||
| 6 | 7 | 8 | 9 | 10 | 11 | 12 |
| 13 | 14 | 15 | 16 | 17 | 18 | 19 |
| 20 | 21 | 22 | 23 | 24 | 25 | 26 |
| 27 | 28 | 29 | ||||
- Abstract (1)
- Geomapping (2)
- SAS Code (9)
- SAS Macros (2)
- SAS Procedures (3)
- SQL (1)
- SQL - Oracle (1)
- 26.4.2008: Export SAS data into XML File
- 18.11.2007: Import external data or files into SAS using wildcards
- 8.11.2007: SAS Enterprise Guide 4.x & Autoexec.sas
- 25.2.2007: Sample Size Calculation
- 20.1.2007: SAS: Contour Plot with PROC GCONTOUR
- 15.1.2007: SAS: Using GOTO Statement in Macro Steps
- 12.1.2007: Using email functions with SAS
- 11.1.2007: SAS: Geomapping Process (Maps based on ZIP Code)
- 11.1.2007: SAS: Import and Export Data
- 10.1.2007: Key Functions in Oracle SQL
BI News
SAS Forum
SAS Programming
Archiv der Kategorie SAS Macros
SAS: Using GOTO Statement in Macro Steps
15.1.2007 von Thomas-Degenhardt.
It is not perfect to use the GOTO statement in SAS Code. But if needed you can use the following macro structure:
%macro goto_struct(var);
%IF %QUOTE(&var) NE 16444 %THEN %DO;
%GOTO error; %
%error:
data error;
x=1;
output;
run;
%END;
%IF %QUOTE(&var) EQ 16444 %THEN %DO;
%GOTO ok; %
%ok:
data ok;
x=2;
output;
run;
%END;
%mend goto_struct;
%goto_struct(100);
Geschrieben in SAS Macros, SAS Code | Keine Kommentare »
Using email functions with SAS
12.1.2007 von Thomas-Degenhardt.
SAS provides several possibilities to send out emails. This is a good feature to get statusinformation while a SAS-program is running.
1st - sending emails with SAS/Macro (Author: DeVenezia.com):
%macro quikmail (to,subj,body);
%if (%superq(to) eq ) %then %let to=foobar;
%if (%superq(to) ne and %superq(subj) ne and %superq(body) ne) %then %do;
filename quikmail email “%superq(to)” subject=“%superq(subj)”;
data _null_;
file quikmail;
put “%superq(subj)”;
%let body=%left(%superq(body));
%do %until (%superq(body) eq);
%let p=%index(%superq(body),\n);
%if (&p eq 0) %then %do;
put “%superq(body)”;
%let body=;
%end;
%else %do;
put “%substr(%superq(body),1,%eval(&p-1))”;
%if (%eval(&p+2) gt %length(%superq(body))) %then
%let body = ;
%else
%let body = %substr (%superq(body),%eval(&p+2));
%end;
%end;
run;
%end;
%mend quikmail;
%quikmail(MyEmail@provider.com, Subject , MyText);
2nd - sending emails with Datastep:
data _null_;
filename mail email
to = (MyEmailAdress)
subject = “SAS Mailtest”
/*attach = (”Path and Filename 1,Path and Filename 2″)*/;
file mail;
put “Zeile 1″;
put “Zeile 2″;
run;
Geschrieben in SAS Macros, SAS Code | 2 Kommentare »