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

Tom,

I tried your code. No success.

I suppose that your code adds '0D'x (CR) to the end of text lines.

It does not replaces embedded '0D'x (CR) with '|'.

Oleg.

Tom
Super User Tom
Super User

The example works find on Unix.  If you are running on Windows then it might not work without adding TERMSTR=LF to the INFILE statement.

Oleg_L
Obsidian | Level 7

Tom,

thanks a lot for your help.

It works fine with TERMSTR=LF on Windows.

Oleg.

sasbeginner_us
Calcite | Level 5

I have similar scenario - we get a csv file where some records are wrapped and spanned over couple of lines, instead of single line.

Also, some of this wrapped lines do not have CRLF, so TERMSTR option is not working. I dont think we can change anything on the source side. Please see some sample recs below, record starts with 50001 is first record, Next record is 60001. I added CRLF just to show how it looks.  Is there anyway we can process/ read the file ?

 

50001,"1233243411","LN","2015-06-05-11.29.14.339000","Please consider this as the text on page 1. CRLF
Please provide copy of the page, with date and location, for testing purporse

hardship.",,"X","845783457FSDF","453454HJGHGHGJ",,CRLF

60001,"1234567897","LC","2015-03-05-11.29.14.339000","We receive some xt",,'T', ","845783457FSDF","453454HJGHGHGJ",CRLF

 
it is a comma delimited file -

infile "filename06.csv" delimiter = "," MISSOVER DSD lrecl=32767

end=last ;

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
  • 10933 views
  • 2 likes
  • 6 in conversation