Regarding Mapping syntax

Hi,
Could anyone help me check if the following mapping syntax is correct.

VIAM(i,j,r) =SUM((MCC,AA,KK)
(MAPIMP(i,MCC) (MAPACT(j,AA)
$MAPREG(r,KK))),
SAMG(MCC,AA,KK));

I just copy the syntex as below. However, the parameter VIPM(i,r) only needs mapping of 2 elements MCC, KK, while VIAM(i,j,r) needs mapping of 3 elements MCC, AA, KK. I am not sure if the second mapping syntax should be (MAPACT(j,AA). I mean I have to put a symbol "(" behind ?

VIPM(i,r) =sum((MCC,KK)
$(MAPIMP(i,MCC)
$MAPREG(r,KK)),
SAMG(MCC,“HHOUS”,KK));

I do appreciate for kind help in advance.