DATA Step, Macro, Functions and more

Anydigit Function Error

Reply
Frequent Contributor
Posts: 130

Anydigit Function Error

Hi,

 

I work hard to find out what is wrong before positing here, but here I have an error I don't understand. I am getting an error stating that

"The Data step was not specified on the data statement". When I remove the Anydigit function, that error disappears. Thanks for your help.

libname Learn '/folders/myfolders/Learn' ;

Data Check1 ; 
	Set Learn.Errors ; 
	If anydigit(Subj) then output mixed_data ; 
	else output only_nums ; 
	 
proc print data=mixed_data ; 
run ;
SAS Super FREQ
Posts: 508

Re: Anydigit Function Error

Posted in reply to ManitobaMoose

The name(s) in the DATA statement need to match the name(s) in the OUTPUT statement.

Super User
Posts: 23,998

Re: Anydigit Function Error

Posted in reply to ManitobaMoose

ManitobaMoose wrote:

Hi,

 

I work hard to find out what is wrong before positing here, but here I have an error I don't understand. I am getting an error stating that

"The Data step was not specified on the data statement". When I remove the Anydigit function, that error disappears. Thanks for your help.

libname Learn '/folders/myfolders/Learn' ;

Data Check1 ; 
	Set Learn.Errors ; 
	If anydigit(Subj) then output mixed_data ; 
	else output only_nums ; 
	 
proc print data=mixed_data ; 
run ;

POST YOUR LOG along with your code in future questions. 

Why? Because it's too easy to make a mistake otherwise, for example your typed error message above is wrong. It should say Data SET, not Data STEP. 

 

ERROR 455-185: Data set was not specified on the DATA statement.

 

As indicated, the option after the OUTPUT statement is the data set name.

 

From the docs:

https://support.sas.com/documentation/cdl/en/lestmtsref/69738/HTML/default/viewer.htm#n1lltvbis7ye1a...

 

OUTPUT <data-set-name(s)>;

Respected Advisor
Posts: 4,791

Re: Anydigit Function Error

Posted in reply to ManitobaMoose

@ManitobaMoose

You must define the tables in the DATA statement which you explicitly address in the OUTPUT statements.

libname Learn '/folders/myfolders/Learn' ;

Data mixed_data only_nums; 
	Set Learn.Errors ; 
	If anydigit(Subj) then output mixed_data ; 
	else output only_nums ; 
	 
proc print data=mixed_data ; 
run ;
Ask a Question
Discussion stats
  • 3 replies
  • 178 views
  • 0 likes
  • 4 in conversation