Bom dia,
estou com dificuldade de importar um arquivo devido as aspas simples, gostaria de saber se é possível remover antes de importar.
notei que esse caractere acaba confundindo o DSD
Segue modelo da base:
TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10
Experimente com isso:
/* Faça um arquivo de texto de teste. */
filename raw_text "%qsysfunc(pathname(work))/have.txt";
data _null_;
file raw_text;
put "TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO";
put "MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10";
put "MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10";
run;
data want;
infile raw_text dsd dlm=';' firstobs=2;
input @;
/* Remova as aspas simples do registro de entrada antes de analisar. */
_infile_=compress(_infile_,"'") ;
input TIPO_MVTO:$15. NUM_SINI_TRON NUM_SINI NUM_EXP NUM_MVTO_ECO NUM_APOLICE_TRON NUM_APOLICE NUM_ENDOSSO;
run;
May the SAS be with you!
Mark
Experimente com isso:
/* Faça um arquivo de texto de teste. */
filename raw_text "%qsysfunc(pathname(work))/have.txt";
data _null_;
file raw_text;
put "TIPO_MVTO;NUM_SINI_TRON;NUM_SINI;NUM_EXP;NUM_MVTO_ECO;NUM_APOLICE_TRON;NUM_APOLICE;NUM_ENDOSSO";
put "MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10";
put "MVTO TECNICO;'10011722000507;'10011722000507;1;5;';'100000926018;10";
run;
data want;
infile raw_text dsd dlm=';' firstobs=2;
input @;
/* Remova as aspas simples do registro de entrada antes de analisar. */
_infile_=compress(_infile_,"'") ;
input TIPO_MVTO:$15. NUM_SINI_TRON NUM_SINI NUM_EXP NUM_MVTO_ECO NUM_APOLICE_TRON NUM_APOLICE NUM_ENDOSSO;
run;
May the SAS be with you!
Mark
Meu Deus você é demais, obrigado!
De nada, amigão!
Nearly 200 sessions are now available on demand in the Innovate Hub.
Watch Now →