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
|
%macro expxlsxdate(lien , fichier , annee , mois , jour , mon_extension , mon_format , ma_table , nom_feuille );
/* macro export de fichier avec horodatage */
%put &fichier , &annee , &mois , &jour , &mon_extension , &mon_format , &ma_table , &nom_feuille ;
proc export data=work.&ma_table outfile="&lien&annee&mois&jour&fichier&mon_extension" dbms=&mon_format replace;
sheet=&nom_feuille;
run;
%mend;
data _null_;
mois = month(input("&sysdate9",date9.));
annee = year(input("&sysdate9",date9.));
jour = day(input("&sysdate9",date9.));
call symput('mois',compress(put(mois,Z2.)));
call symput('annee',compress(put(annee,best.)));
call symput('jour',compress(put(jour,Z2.)));
call symputx('lien','\\serveur\sousdossier\dossier trv1\');
call symputx ('fichier','_lotXXX');
run;
%put &annee &mois &jour &lien &fichier &mon_extension ;
/* export au format xlsx */
%expxlsxdate( &lien , &fichier , &annee , &mois , &jour , .xlsx , XLSX , refec9, mafeuille ); |
Partager