BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Tom
Super User Tom
Super User

This method would work only if the embedded linefeeds are enclosed in quotes. Also if your delimiter is | then you would want it to put and extra '|' to replace the embedded linefeed. You could have it put a space or just nothing to remove the linefeed.

 

If you data has extra linefeed, but they are not quoted then a method that counts the number of | would be better.  But for that you would need to know the number of | that you expect in each line.

pp2014
Fluorite | Level 6

Hi Tom,

 

I have the following headers :

 

Survey Name|Contact Name|Follow-up History|Last Follow-up Date|Last Follow-Up Comment

 

Altogether 4 pipes in between.

 

How to read the file with pipe delimited having carriage control..

 

Thanks

Anotherdream
Quartz | Level 8

Tom, I ran this code and on 90% of the files I have run into it works, however on a few files the process only seems to remove carriage returns and line feeds for the first X rows (say 1000) and then after that the process simply stops removing all values.

Is there an inherent limitation to what type of files this process will work on?  The rows in which the data stops are only 10,000 characters of values, so I do not believe it is bumping up against the lrecl limit.

Thanks

Brandon

Tom
Super User Tom
Super User

That code was written using LRECL=10000. If your actually file has lines as long as 10,000 characters then it will probably truncate the data.  If you have lines longer than 32K then you will need to use a method that reads the file byte by byte instead.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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
  • 18 replies
  • 38080 views
  • 7 likes
  • 3 in conversation