BookmarkSubscribeRSS Feed
AmitKB
Fluorite | Level 6
Hi Everyone,
I am trying to read comma delimited text file. The SAS dataset reads a "square sign" in the last column. How do I get rid of it.

infile '/path/data.txt' delimiter = ',' MISSOVER DSD lrecl=32767 firstobs=2 ;

Thanks,

Amit
3 REPLIES 3
Doc_Duke
Rhodochrosite | Level 12
It's likely the end-of-line character for a record from the PC .csv file that was copied to Unix. Check out this thread:

http://support.sas.com/forums/message.jspa?messageID=20381#20381

If that is not it, tell us more about your platform and the data sources.
data_null__
Jade | Level 19
You could add the INFILE option TERMSTR with no need to fiddle with the input file(s).

[pre]
infile ..... termstr=crlf;
[/pre]
Peter_C
Rhodochrosite | Level 12
add '0A'x as delimiter on infile.[pre]infile '/path/data.txt' delimiter= '2c0d'x MISSOVER DSD lrecl= 32767 firstobs= 2 ;[/pre]Then if any '0D'x disappear, the ''0A'x on its own will still act as a line terminator.

PeterC
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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 3 replies
  • 1362 views
  • 0 likes
  • 4 in conversation