BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
kajal_30
Quartz | Level 8

Good Evening Team,

 

I am assigning value to one macro variable but while using that macro variable value I am getting error below. Can you please help.

 

ERROR: Attribute '202206' not found 

%put yearmonth --> &yrmonth;

 yearmonth --> 202206

Regards

Kajal

proc sql;
	select max(yearmonth) into :  yrmonth from source_data;
quit;

proc sql;
	delete * from target_data
		where yearmonth= &yrmonth.;
quit;
1 ACCEPTED SOLUTION

Accepted Solutions
kajal_30
Quartz | Level 8

Thank you for your kind response I was able to resolve the issue.

 

Regards

Kajal

View solution in original post

4 REPLIES 4
kajal_30
Quartz | Level 8

Good Evening Team,

 

I am assigning value to one macro variable but while using that macro variable value I am getting error below. Can you please help.

 

Regards

Kajal

proc sql;
	select max(yearmonth) into :  yrmonth from source_data;
quit;

proc sql;
	delete * from target_data
		where yearmonth= &yrmonth.;
quit;

 ERROR: Attribute '202206' not found 

%put yearmonth --> &yrmonth;

 yearmonth --> 202206

SASKiwi
PROC Star

There's no asterisk in the SQL DELETE statement:

proc sql;
  delete from target_data
  where yearmonth= &yrmonth.;
quit;
kajal_30
Quartz | Level 8

Thank you for your kind response I was able to resolve the issue.

 

Regards

Kajal

Dianahemes
Fluorite | Level 6
To resolve the issue, you can modify your data selection to include data that uses that attribute, or you can remove the data attribute from your template.

Regards,
Will

CFC_SAS_Communities_400x225.jpg

Call for content now open!

It's your turn to help shape SAS Innovate 2027. Share your expertise and inspire the SAS community.

Submit your proposal →

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 4 replies
  • 3485 views
  • 1 like
  • 3 in conversation