BookmarkSubscribeRSS Feed
sam15
Calcite | Level 5

I am trying to Read data from txt file where delimiter is © (copyright symbol).
The data fields in txt file have varied lengths. Any help with this would be highly appreciated.

Thankshelp_Sas.PNG

2 REPLIES 2
Tom
Super User Tom
Super User

The photo you posted does not look like a text file. What type of file are you reading?

data want ;
  infile 'myfile.txt' dsd dlm='©' truncover ;
  length var1 8 varr $20 ;
  input var1 var2 ;
run;

 

Kurt_Bremser
Super User

You can use any single-byte character as delimiter in an infile statement. So if it's the character 'a9'x from the ISO 8859-1 set, you can use it. If it's the UTF-8 character, you can't, and you will have to "manually" dissect the _infile_.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 344 views
  • 0 likes
  • 3 in conversation