spss_recode
Recode variable values in SPSS .sav files by defining old-to-new mapping rules, creating new variables to preserve originals, and saving to a specified output path.
Instructions
Recode variable values in a .sav file. rules: list of {'old': value | [lo,hi] | [v1,v2,...] | 'ELSE', 'new': value | 'COPY' | 'SYSMIS'}. into_variables: optional list of new target variables (preserves originals). output_path: optional path to save the transformed file. Requires IBM SPSS Statistics.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"file_path": "<file_path>",
"variables": "<variables>",
"rules": "<rules>"
},
"name": "spss_recode"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| rules | Yes | ||
| file_path | Yes | ||
| variables | Yes | ||
| output_path | No | ||
| into_variables | No |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |