DATA Step, Macro, Functions and more

Specifying an end of record delimiter

Not applicable
Posts: 0

Specifying an end of record delimiter

I have an ASCII text file where the data is delimited by one character and the records are delimited by another. When I try to read the file, I just get one very long record. How can I tell SAS that the "~" is the end of the record, and to start reading a new record with the next character? Records are variable length.
Super Contributor
Super Contributor
Posts: 3,176

Re: Specifying an end of record delimiter

Posted in reply to deleted_user
None that I'm aware of - so you will need to consider byte/character level INPUT parsing your input to load a DATALINE variable (of sufficient length) while looking for your artificial using @ pointer technique, logical record-segment delimiter. Then you have a couple of choices, such as re-write the file to a temporary location, and then use another set of INPUT statement logic to read the file, otherwise you can use the INPUT function to work your way through the logical data sub-fields.

Scott Barry
SBBWorks, Inc.
Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation