BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
BruceBrad
Lapis Lazuli | Level 10

I'm trying to run the following code (from the SAS system documentation). But I'm getting the error below. The only change I've made from the documentation is to put in the reference to "c:\temp" (which is a valid folder on my system).

ERROR: Macro function %INDEX has too many arguments.
ERROR: The macro ETSMACRO will stop executing.

options validvarname=any;

data keylist0;
   length key0 $8;
   key0='EA17'; output; /* country is euro area; 17 countries */
run;

data keylist1;
   length key1 $8;
   key1='B1_GA'; output; /* transaction is GDP; output approach */
run;

data keylist2;
   length key2 $2;
   key2='C'; output;     /* measure is current prices */
run;

title 'Request GDP for EA_17 in Current Prices';
LIBNAME myLib saseoecd "c:\temp"
   setid=SNA_TABLE1_SNA93
   inset0=keylist0
   inset1=keylist1
   inset2=keylist2
   out=gstart
   ;

 

1 ACCEPTED SOLUTION

Accepted Solutions
BruceBrad
Lapis Lazuli | Level 10

I've confirmed with SAS support that there is a problem with the treatment of autocall libraries. The workaround is to remove the library reference before running the SASEOECD libname statement with

options sasautos=sasautos;

View solution in original post

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Hello,

 

Your program comes from here :

SAS/ETS® 15.2 User's Guide
The SASEOECD Interface Engine
Example 52.1 Retrieving OECD Gross Domestic Product Data for One Region

https://go.documentation.sas.com/doc/en/etsug/15.2/etsug_saseoecd_examples01.htm

 

That page nor the program you published contains an ETSMACRO with %INDEX, so I have the impression the problem lies elsewhere.

 

Thanks,

Koen

BruceBrad
Lapis Lazuli | Level 10

The ETSMACRO appears to be a macro in the SAS/ETS autocall library which is being called by Proc SASEOECD. It has a few %index statements. I can't work out which one is not working. Looks like a call to support is needed.

Kurt_Bremser
Super User

From the documentation of the SASEOECD LIBNAME statement:

The required physical-name argument specifies the location of the folder where your OECD JSON data reside. It should end with a backslash if you are in a Windows environment or a forward slash if you are in a UNIX environment.

Your path does not contain the trailing backslash:

LIBNAME myLib saseoecd "c:\temp"
   setid=SNA_TABLE1_SNA93
   inset0=keylist0
   inset1=keylist1
   inset2=keylist2
   out=gstart
   ;
Kurt_Bremser
Super User

And if you run this code in a client/server environment either through SAS Studio or Enterprise Guide, the path must be on the server, to which you must first upload the files.

BruceBrad
Lapis Lazuli | Level 10

Thanks for the suggestions. I did miss the trailing slash requirement. However, I've fixed that and still have the same error. As I read the documentation, the libname statement does the downloading, I don't need to do it first. But it is a bit confusing.

 

However, when I run the program with macro debugging I see that it is calling the autocall library search path just before the error. If I run the program without my autoexec.sas which sets up my autocall library, it runs without error. (Haven't checked for sensible output yet). So I think there is something wrong with either my autoexec.sas, or there is a bug in the code where it doesn't handle an autocall library properly (not handling the comma in the augmented search path properly). The relevant code in my autoexec.sas is similar to that below.

 

options sasautos=("%sysget(userprofile)\Data\SASMACRO",sasautos);
BruceBrad
Lapis Lazuli | Level 10

I've confirmed with SAS support that there is a problem with the treatment of autocall libraries. The workaround is to remove the library reference before running the SASEOECD libname statement with

options sasautos=sasautos;

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

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
  • 6 replies
  • 461 views
  • 2 likes
  • 3 in conversation