When a script is executed via the AutoSys agent on Japanese Windows servers, garbled characters are generated in the job logs. However, when the same script is triggered manually on the server, the output does not contain any garbled characters.
Operating System: Windows (specifically Japan localized servers)
Component: AutoSys Workload Automation Agent
The difference in output is often caused by a mismatch in the Active Code Page (chcp) between the interactive user session and the session created by the AutoSys agent. To troubleshoot and resolve this:
Identify the working Code Page: Run the script manually from the command line (as the job owner) where it works correctly. Add the following line to the script to capture the code page: chcp > c:\checkchcp_manual.out
Identify the AutoSys Code Page: Run the job through AutoSys and capture the code page: chcp > c:\checkchcp_autosys.out
Compare and Align: Compare the results. If they differ, you must ensure the AutoSys environment uses the correct code page.
Permanent Fix: * Explicitly set the code page at the beginning of your script using the chcp command (e.g., chcp 932 for Japanese Shift-JIS).