You may also try :
$ProductCatalogVersion=catalogVersion(catalog(id[default='$catalogID']),version[default='$catalogVersionID_STAGED'])[unique=true,default='$catalogID:$catalogVersionID_STAGED']
$CategoryCatalogVersion=catalogVersion(catalog(id[default='$catalogID']),version[default='$catalogVersionID_STAGED'])[unique=true,default='$catalogID:$catalogVersionID_STAGED']
$superCategories=supercategories(code,$CategoryCatalogVersion)
INSERT_UPDATE Product;$ProductCatalogVersion;code[unique=true];$superCategories[mode = remove]
;;xyz;cat1,cat2,cat3
Hope this helps