Desktop productivity for business analysts and programmers

How to eliminate "SAS went to a new line" message

Accepted Solution Solved
Reply
Regular Contributor
Posts: 170
Accepted Solution

How to eliminate "SAS went to a new line" message

[ Edited ]

Hello,

 

I would like to know how to eliminate the above mentioned error message after running the following code:

 

data test;

input name $ age @@;

datalines;

John 13 Monica 12 Sue 15 Stephen 10

Marc 22 Lily 17

;

run;

 

Regards,

Alain


Accepted Solutions
Solution
‎10-19-2017 07:59 AM
Super User
Posts: 6,935

Re: Hello I would like to know how can I eliminated the above mentionned error message

It might not be worth the trouble, but here's something you can try. 

 

data want;

infile cards truncover;

input @1  @ ;

nrecs = countw(_infile_) / 2;

do _n_=1 to nrecs;

   input name $ age @ ;

   output;

end;

drop nrecs;

datalines;

John 13 Monica 12 Sue 15 Stephen 10

Marc 22 Lily 17

;

 

View solution in original post


All Replies
Community Manager
Posts: 3,463

Re: Hello I would like to know how can I eliminated the above mentionned error message

What message?  The only message I see is informational:

 

NOTE: SAS went to a new line when INPUT statement reached past the end of a line.
NOTE: The data set WORK.TEST has 6 observations and 2 variables.
Regular Contributor
Posts: 170

Re: Hello I would like to know how can I eliminated the above mentionned error message

Posted in reply to ChrisHemedinger

Yes you are right.  Then what can i do to eliminate this note:

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

 

Super User
Posts: 10,592

Re: Hello I would like to know how can I eliminated the above mentionned error message

If your input looks that way, then the message is unavoidable and perfectly natural.

Unless you know beforehand the exact number of items in each line.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
How to convert datasets to data steps
How to post code
Super User
Posts: 24,025

Re: Hello I would like to know how can I eliminated the above mentionned error message

You can consider the NONOTES option, but it seems like overkill because it suppresses all notes.

The list of options related to the LOG are in the link below.

 

http://documentation.sas.com/?docsetId=lrcon&docsetTarget=n03qoiyzzrrl4in1pfvbqgj7jan8.htm&docsetVer...

Super User
Posts: 24,025

Re: Hello I would like to know how can I eliminated the above mentionned error message

Post your code and log, including the ERROR

Solution
‎10-19-2017 07:59 AM
Super User
Posts: 6,935

Re: Hello I would like to know how can I eliminated the above mentionned error message

It might not be worth the trouble, but here's something you can try. 

 

data want;

infile cards truncover;

input @1  @ ;

nrecs = countw(_infile_) / 2;

do _n_=1 to nrecs;

   input name $ age @ ;

   output;

end;

drop nrecs;

datalines;

John 13 Monica 12 Sue 15 Stephen 10

Marc 22 Lily 17

;

 

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 6 replies
  • 347 views
  • 2 likes
  • 5 in conversation