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

I'm trying create a large sas log into a sas dataset via infile statement.  When I read in the file, it ends at 826 records, when the log contains many more records.  The code I am using is as follows:  

 

data file;
infile "[program location].log" dsd dlm='09'x truncover ;
input line $200.;
run;

 

Why would this get cut off?  Is there anything I can change to the code to make it read in all records from the log? My only thought is that there seems to be an arrow in the log where there was a " > " in the program.  Could this make the infile end prematurely? And is there a way to ignore strange characters like this, that were printed to the log? 

 

Thanks, 

Amanda


Capture.PNG
1 ACCEPTED SOLUTION

Accepted Solutions
Tom
Super User Tom
Super User

What do the notes from the data step you ran say?  Does it indicate that some lines were truncated?

What operating system are you running SAS on?  Windows used to interpret a specific character as an end of file marker.  You could try adding the IGNOREDOSEOF option to the INFILE statement.

 

IGNOREDOSEOF

is used in the context of I/O operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.

View solution in original post

3 REPLIES 3
kannand
Lapis Lazuli | Level 10

Would you be able to attach the log file?

Kannan Deivasigamani
Tom
Super User Tom
Super User

What do the notes from the data step you ran say?  Does it indicate that some lines were truncated?

What operating system are you running SAS on?  Windows used to interpret a specific character as an end of file marker.  You could try adding the IGNOREDOSEOF option to the INFILE statement.

 

IGNOREDOSEOF

is used in the context of I/O operations on variable record format files. When this option is specified, any occurrence of ^Z is interpreted as character data and not as an end-of-file marker.

aplaisted
Calcite | Level 5

This fixed the issue!  Thank you!

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
  • 3 replies
  • 1603 views
  • 2 likes
  • 3 in conversation