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

I have a raw data file charity.dat which I have attached with this question. This file contains data about donations made. It contains a charity ID and amount. Following is the code which i have wrote to read the data.

data donate07;

     length ID $4.;
     infile 'E:\SAS data\Data\base data set\lwprg2\charity.dat';
     input ID $ Amount @@;
     run;

In the raw data file you can see that the amount 875 is at the starting of the third line. My question here is when during execution line pointer reaches the end of the second data line it wont be able to find amount for that corresponding charity id, therefore in output data set the value of amount there should be  a period,since according to my understanding @@ will block the input buffer until the line pointer reaches end of the dataline currently being read. but in output I can see that the data was read correctly and in logs i can see 

NOTE: SAS went to a new line when INPUT statement reached past the end of a line.

Can anybody please help me in understanding this concept.

 

 

 

 

 

 

 

 

 


charity.jpg
1 ACCEPTED SOLUTION

Accepted Solutions
ballardw
Super User

There is a default option for infile, FLOWOVER. If the current input statement is trying to read more variables than are currently available then it continues on the next line which generates the warning. The note is basically to let you know something may be going on in your data you possibly didn't expect.

So with two variables on the input coupled with trailing @@ the input reads the first two values, then the nex two etc. When it gets to the end of the second line there is only one value to read so it is read and then the advance to the next line. And continues to the end of the data.

 

 

View solution in original post

2 REPLIES 2
ballardw
Super User

There is a default option for infile, FLOWOVER. If the current input statement is trying to read more variables than are currently available then it continues on the next line which generates the warning. The note is basically to let you know something may be going on in your data you possibly didn't expect.

So with two variables on the input coupled with trailing @@ the input reads the first two values, then the nex two etc. When it gets to the end of the second line there is only one value to read so it is read and then the advance to the next line. And continues to the end of the data.

 

 

Cynthia_sas
SAS Super FREQ

Hi, this isn't a warning. It is a NOTE. It is describing exactly what happened. So, for example, see this screen shot:

 

read_charity.png

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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