In some cases, model tools are unable to create intermediate data. When a model is meant to create intermediate data but is unable to do so, the model will fail and display error messages. These error messages may contain statements like "Unexpected error" when the model cannot create its intermediate data, typically because the output folder or geodatabase does not exist.
One technique that ensures that models can create and delete intermediate data is to manage all intermediate data variables with the model. When data elements are managed by the model, they are stored by default in the scratch workspace (if this environment is set) or other system paths.
- In ModelBuilder, right-click all intermediate data variables one at a time and choose Managed. A check mark appears next to Managed.
- Click Model > Model Properties.
- Click the Environments tab.
- Expand the Workspace category and check Scratch Workspace.
- On the Environment Settings dialog box, navigate to the workspace file geodatabase that you want to use for writing the scratch data.
- Click OK.
- Execute your model.