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