First thing, when asking about Errors or anything that appears in the log such as warning or other diagnostic message include the Code submitted along with the error message. Sometimes what people actually submit is not what they show in their editor.
In this case your code should include everything from the %let Path =.
Second, copy the text from the log and then on the forum open a text box using the </> icon that appears above the message window. Paste all the copied text. The log sometimes includes diagnostic characters but the main main message window on this forum will reformat pasted text so that the diagnostics may not appear in the correct position making them less useful. Also the text box separates the code/log under discussion from the actual discussion.
When I ran your code code for example my log looks like:
540 %let path=O:\Test\SAS Exam\base-guide-practice-data\cert;
541 /********************************************************************
542 Do not modify the code below this line
543 ********************************************************************/
544 %macro setdelim;
545 %global delim;
546 %if %index(&path,%str(/)) %then %let delim=%str(/);
547 %else %let delim=%str(\);
548 %mend;
NOTE: The macro SETDELIM completed compilation without errors.
18 instructions 316 bytes.
549
550 %setdelim
So can't duplicate your error.
The type of thing that is most likely to cause a "too many parameters" is the presence of a comma somewhere.
For instance if there is a comma in the Path variable I can replicate the error:
551 %let path=O:\Test\SAS Exam\base-guide,practice-data\cert;
552 /********************************************************************
553 Do not modify the code below this line
554 ********************************************************************/
555 %macro setdelim;
556 %global delim;
557 %if %index(&path,%str(/)) %then %let delim=%str(/);
558 %else %let delim=%str(\);
559 %mend;
NOTE: The macro SETDELIM completed compilation without errors.
18 instructions 316 bytes.
560
561 %setdelim
ERROR: Macro function %INDEX has too many arguments.
ERROR: %EVAL function has no expression to evaluate, or %IF statement has no condition.
ERROR: The macro SETDELIM will stop executing.
See the comma between "guide" and "practice"?
Which is why I suggested including the Log with the %let path= part.
If you copy text from something you may want to try retyping it as some sources will have either non-printable characters that cause problems or will have "fancy" versions of the same character such as "curly" or "smart" quote symbols that are treated differently in programs than the basic ' or " from the keyboard.
BTW, while not always a problem causer the more special characters you include in file paths, such as that dash, the more likely you are to get some odd errors. Working with macros % and & especially will cause problems. A dash in some place may well be interpreted as an instruction to subtract.
Personally I would be tempted to recreate the folder with underscore characters as underscores are less likely to cause problems in general.