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

when I merely used macro:

 

%extracTable();

 

there is no error..

 

however when I am using :

data _null_;

if 1=1

then %extracTable();

else put @@@do not insert@@@;

run;

 

it return :

error:unquote array:Execute

error:388-105

error 76-322

error:180-322

 

why and how to fix it...I am weak at sas Marco grammar..thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

My preference is to just let it stand as is.  I say that because the question has changed somewhat.  One of my pet peeves is questions that morph as they are solved, and I would much rather avoid that.  

 

"OK, that worked but what I really need is to ..."

 

"OK, that worked.  The next step is to ..."

 

Let this part stand as a separate question, and chips fall where they may.

View solution in original post

8 REPLIES 8
ChrisNZ
Tourmaline | Level 20

Try:

if 1=1 then call execute('%extracTable();');

Geo-
Quartz | Level 8
thanks..I get the result right,but still an error :
ERROR 180-322:statement is not valid.
why and how to do..
Astounding
PROC Star

I'm not sure I should reply.  You seem unwilling or perhaps unable to take my advice on other questions.  So last attempt:

 

data _null_;

if 1=1

then call execute('%nrstr(%extracTable())');

else put '@@@do not insert@@@';

run;

 

It's not clear why you need an ELSE condition when 1=1 must always be true, but perhaps this is a simplification of a more complex problem.

ChrisNZ
Tourmaline | Level 20

@Astounding I didn't see this thread was the continuation of another thread.

Maybe should it be marked as spam to remove duplicates?

Astounding
PROC Star

My preference is to just let it stand as is.  I say that because the question has changed somewhat.  One of my pet peeves is questions that morph as they are solved, and I would much rather avoid that.  

 

"OK, that worked but what I really need is to ..."

 

"OK, that worked.  The next step is to ..."

 

Let this part stand as a separate question, and chips fall where they may.

Geo-
Quartz | Level 8
thanks in advance..I get the result right,but still an error :
ERROR 180-322:statement is not valid.
why and how to do..
Astounding
PROC Star

For someone to diagnose the error, you will need to post the log. 

ballardw
Super User

@Astounding wrote:

For someone to diagnose the error, you will need to post the log. 


And perhaps the actual macro code that is called.

 

And run the code with: Options mprint symbolgen mlogic;

 

Then post the log with the code and error messages into a code box opened using the forum {I} menu icon. Error messages often have indicators of position where SAS identified the error but the main message windows of this forum will reformat text resulting in moved indicators. The code box will preserve text as copied from the log so the diagnostics are in the correct position.

 

Note that errors caused by macro code do not display in the most helpful manner unless the MPRINT option is set. 

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 8 replies
  • 889 views
  • 0 likes
  • 4 in conversation