BookmarkSubscribeRSS Feed
deleted_user
Not applicable
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.
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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
  • 1 reply
  • 1368 views
  • 0 likes
  • 2 in conversation