BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
VVDR
Obsidian | Level 7

Hi All,

Good day !!!

When I am extracting the data directly from AWS S3 to SAS, I am getting a special character only to few observations and that is not expected and not present in the source. 

Ex: For Column ID=100, In the Description variable value I am getting like this below.

" This is has to be state level \n  information to get the business \n details \n "

Something like this.

Please advise what could be the reason. Column Description has 2000 character Length defined in the Dataset attributes level. 

 

Please advise. 

Thanks  

1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

@VVDR wrote:

Hi All,

Good day !!!

When I am extracting the data directly from AWS S3 to SAS, I am getting a special character only to few observations and that is not expected and not present in the source. 

Ex: For Column ID=100, In the Description variable value I am getting like this below.

" This is has to be state level \n  information to get the business \n details \n "

Something like this.

Please advise what could be the reason. Column Description has 2000 character Length defined in the Dataset attributes level. 

 

Please advise. 

Thanks  


How are you looking at the data that leads you to believe "not present in the source"? If it is a viewer application from the source does that row display text in that variable/field/column on 3 lines in the data? If so those may be instructions for that viewer to display the following text on a "new line". The characters are there just not displayed in some application.

 

You can remove them in a data step with code like:

data example;
   x=" This is has to be state level \n  information to get the business \n details \n ";
   x=compbl(tranwrd(x,'\n','') );
run;

View solution in original post

2 REPLIES 2
ballardw
Super User

@VVDR wrote:

Hi All,

Good day !!!

When I am extracting the data directly from AWS S3 to SAS, I am getting a special character only to few observations and that is not expected and not present in the source. 

Ex: For Column ID=100, In the Description variable value I am getting like this below.

" This is has to be state level \n  information to get the business \n details \n "

Something like this.

Please advise what could be the reason. Column Description has 2000 character Length defined in the Dataset attributes level. 

 

Please advise. 

Thanks  


How are you looking at the data that leads you to believe "not present in the source"? If it is a viewer application from the source does that row display text in that variable/field/column on 3 lines in the data? If so those may be instructions for that viewer to display the following text on a "new line". The characters are there just not displayed in some application.

 

You can remove them in a data step with code like:

data example;
   x=" This is has to be state level \n  information to get the business \n details \n ";
   x=compbl(tranwrd(x,'\n','') );
run;
VVDR
Obsidian | Level 7
Hi ballardw,
Thanks for your quick reply. And what you have advised is absolutely correct. In the upstream it is divided the observation value into 3 lines and sas is separating it with \n.
Thanks again for sharing the knowledge.

Regards

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 649 views
  • 1 like
  • 2 in conversation