BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
ropjunior
Fluorite | Level 6

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


1 ACCEPTED SOLUTION

Accepted Solutions
SASJedi
Ammonite | Level 13

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

Check out my Jedi SAS Tricks for SAS Users

View solution in original post

3 REPLIES 3
SASJedi
Ammonite | Level 13

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

Check out my Jedi SAS Tricks for SAS Users
ropjunior
Fluorite | Level 6

Meu Deus você é demais, obrigado!

SASJedi
Ammonite | Level 13

De nada, amigão! 

Check out my Jedi SAS Tricks for SAS Users

Catch up on SAS Innovate 2026

Nearly 200 sessions are now available on demand in the Innovate Hub.

Watch Now →
Discussion stats
  • 3 replies
  • 2737 views
  • 2 likes
  • 2 in conversation