%let DiretorioTodos=&prompt_1; filename _dir_ "%bquote(&DiretorioTodos.)"; data test;run; data lil;run; %Macro Rodar(); data filenames(keep=memname filenames); handle=dopen( '_dir_' ); if handle > 0 then do; count=dnum(handle); do i=1 to count; memname=dread(handle,i); output filenames; call symput("NumArq",compress(i)); end; end; rc=dclose(handle); run; %put ===========passo 1 ================== &NumArq ==================; %DO i=1 %to &NumArq; data _NULL_; set filenames; if index(memname,".")=0; if _N_=&i; call symput("NomePasta",compress(memname)); run; %let DiretorioIsol=&prompt_1\&NomePasta.; filename2 _dir2_ "%bquote(&DiretorioIsol.)"; data filenames2(keep=memname filenames2) ; handle=dopen( '_dir2_' ); if handle > 0 then do; count=dnum(handle); do i=1 to count; memname=dread(handle,i); output filenames2; call symput("NumArq2",i); end; end; rc=dclose(handle); run; %put ================================= &NumArq ====================; %put ================================= &NumArq2 ====================; %do j=1 %to 1; /*&NumArq2;*/ data teste;set filenames2; if index(memname,".")>0; if _N_=&j; call symput("NomeArquivo",memname); run; data testemp; . . . /*here dont have time for export date*/ PROC EXPORT DATA= outfile="&prompt_1\&NomePasta\IBGE_&NomePasta..csv" DBMS=csv REPLACE; RUN;
... View more