BookmarkSubscribeRSS Feed
vraj1
Quartz | Level 8

I am creating the below macro parameter and i get the following error.

%local armn;
%let armn=;

arm has trt1 and trt2

data test;
     set test1;
     output;
          &arm="total";
          &armn=999;
     output;
run;




output; &arm.="total"; &armn.=9999; output;
-
180
ERROR 180-322: Statement is not valid or it is used out of proper order.

 =9999;

 

The error is coming from armn and not sure why. Can anyone help me

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

Well what you post is invalid.  

arm has trt1 and trt2

I not valid SAS code.  And

 

%let armn=;

Will also create invalid code.  If that is not it, then check all the code up to the error, it may be happening well before this block.  Its hard to tell from small snippets of either code or logs. 

Astounding
PROC Star

You need to educate yourself using this program as a learning tool.

 

First, picture what you want the DATA step to look like (with no macro language at all).

 

Second, add this statement and then re-run:

 

options mprint;

 

You will be able to see what the DATA step actually looks like, and compare it to your picture of what you wanted it to look like.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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