BookmarkSubscribeRSS Feed
Liangck
Calcite | Level 5

Hi there,

     I have a csv file and its generated by others people. the delimiter used is comma. it had a header inside the file and so call a "end of file" statment indicate the EOF.

     Is there any way to check sas will read until EOF only? and how its does if the file not reached read until EOF ?

     Please help

Thank you

2 REPLIES 2
Ksharp
Super User

It would be helpful if you can post the content of this csv file.

Here is an example:

data want(keep=last_obs);
 infile 'c:\test.csv' length=len end=last;
 length _obs $ 200;
 retain _obs;
 last_obs=_obs;
 input _obs $varying200. len;
 if last then do;output;stop;end;
run;

Ksharp

Liangck
Calcite | Level 5

Thanks Ksharp:

i did it in more tedios and bad way to detect there is a End of file statment.

Thanks for your reply.

Liangck

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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