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 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
|
DM LOG 'clear';
dm log "color warning green reverse" continue;
dm log "color error orange reverse" continue;
options noxwait noxsync;
X explorer C:\Documents and Settings\BEARE\Bureau\Shoes.xls;
DATA _NULL_;
x=sleep(5);
RUN;
filename cmd dde 'excel|system';
%MACRO DDE(table1=,onglet=);
X "&fic_xl";
proc contents DATA=&table1. out=name noprint;
run;
proc sort DATA=name;
BY varnum;
run;
DATA name;
SET name;
separ=compress("'09'"!!" "!! "X");
var=compress(quote(name))!!" "!!separ;
var2=compress(name)!!" "!!separ;
run;
proc sql noprint;
SELECT var INTO: l separated BY " " FROM name;
SELECT var2 INTO: l2 separated BY " " FROM name;
quit;
%put l=&l.;
filename test2 dde "Excel|&onglet!l2C1:l999C99" notab lrecl=64000;
filename test2n dde "Excel|&onglet!l1C1:l999C99" ;
DATA _null_;
file test2n;
PUT &l. ;
RUN;
DATA _null_;
SET &table1.;
file test2 ;
PUT &l2.;
RUN;
%MEND;
%DDE(table1=Sashelp.Shoes,onglet=Shoes);
DATA _NULL_ ;
file cmd ;
put "[SAVE()]";
put "[CLOSE()]";
put "[QUIT()]";
run ; |
Partager