Hello Experts,
I'm working on SAS Guide 8.3. I have the error because the data remains open (in yellow) after the code execution. There are some options please to close the data, please ? Thank you !
%macro cleartemplib(libtofree);
%if %sysfunc(libname(&libtofree)) ne 0 %then
%put NOTE: Libref &libtofree could not be unassigned;
%else %put NOTE: Libref &libtofree has been unassigned;
%mend;
%macro Affectation (libref= , metaLibName= );
%cleartemplib(&libref);
libname &libref meta library="&metaLibName";
%mend Affectation;
%Affectation(libref= PSAEU11, metaLibName= PEGASE - PSAEU11);
%let Rep_Travail = \\lamondiale.com\LMPAPROD\USINE_PRIIPS\;
%let EntreesManuelles = &Rep_Travail.2. DONNES INPUT\2.1 DONNEES MANUELLES;
%let EntreesManuellesBis = &Rep_Travail.\5. RETRAITEMENTS MANUELS\Chaine Produits;
%let EntreesPDFemtn = &Rep_Travail.2. DONNES INPUT\2.2 PDF EMTN;
%let Sorties = &Rep_Travail.4. DONNEES OUTPUT;
%let Publications = &Rep_Travail.6. PUBLICATIONS\6.1 DICTIONNAIRES DE DONNEES;
%let ArchivesPublications = &Rep_Travail.6. PUBLICATIONS\6.1 ARCHIVES PUBLICATIONS;
%let SortiesPDFemtn = &Rep_Travail.6. PUBLICATIONS\6.2 PDF EMTN;
%let SortiesFicemtn = &Rep_Travail.6. PUBLICATIONS\6.4 FICHIERS_EMTN;
Data _null_;
DateInitiale='01JAN2018:00:00:00'dt;
Call symputx('DateInitiale',DateInitiale);
DatePublication=today();
Call symputx('DatePublication',DatePublication);
run;
Data _null_;
YYYY=year(&DatePublication);
if month(&DatePublication) < 10 then
MM=compress(("0"!!month(&DatePublication)));
else MM=month(&DatePublication);
if day(&DatePublication) < 10 then
DD=compress(("0"!!day(&DatePublication)));
else DD=day(&DatePublication);
DatePubli=compress(YYYY!!MM!!DD);
Call symputx('DatePubli',DatePubli);
run;
%put &DatePubli;
proc import
datafile= "&EntreesManuellesBis\xxxxxx"
out=PRODUITS_PRIIPS
replace dbms=xlsx;
getnames=yes;
range="SAS_IMPORT";
run;
proc import
datafile= "&EntreesManuelles\xxxx"
out=EMTN_EXCLUS
replace dbms=xlsx;
getnames=yes;
run;
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.