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 ;
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;
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
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.
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
;
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.
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);
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;
Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.
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.
Ready to level-up your skills? Choose your own adventure.