BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
saskaan
Calcite | Level 5

Hi there!
I'm trying to read in text file with "End of Media" special character in the middle of the file and SAS read all the data before that character only - is there any possibility to read in the whole file?

data TEST;
  infile "test.txt" truncover;
  length REC $400;
  input REC 1-400;
  LINE=_N_;
run;

File contain more than 40k records and in dataset I get only first 3000 records, the last one is the string with EM character in the middle of the string, so I see this first part of the string in the last record...
Are the any options to read text file line by line including special characters like "End of Media" or maybe to tell SAS to not use EM as EoF marker?

Here is what Notepad++ shows when I'm looking into the file - please see 3rd line - there are some special characters in the line and one of them is EM which makes SAS to stop reading the data:

saskaan_0-1701094528063.png

And what I get in dataset:

saskaan_0-1701094812442.png

 

Thanks,
Anton.


1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

Use the IGNOREDOSEOF option on the INFILE statement.  Or when defining the fileref using a FILENAME statement.

View solution in original post

2 REPLIES 2
Tom
Super User Tom
Super User

Use the IGNOREDOSEOF option on the INFILE statement.  Or when defining the fileref using a FILENAME statement.

saskaan
Calcite | Level 5
Yep, it works! Thanks a lot!

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 2 replies
  • 305 views
  • 0 likes
  • 2 in conversation