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.

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