For MY97/98 turbo EJ20# there where 3 types of cams available in Japan:
EJ20G (WRX Wagon, Forester) and EJ20H (Legacy TwinTurbo AT) part numbers ending with AA230.
EJ20K (non-STI WRX Sedan) and EJ20R (Legacy TwinTurbo MT) part numbers ending with AA240.
EJ20K (WRX STI Sedan Version III/IV) part numbers ending with AA390.
There is some grey area with the AA240 being used also on MY97 STI's but I'm not sure. Valve train (springs, buckets) differs also.