When attempting to execute the autobcpMSQ.pl script, users may encounter an 'Invalid filename' error reported by sqlcmd. This issue typically occurs during the execution of a SQL command that attempts to access a specific file, as indicated by the following specific error message:
sqlcmd -C -U autosys -P <password> -S "<server>" -dAEDB -i delete_data.sqlSqlcmd: 'delete_data.sql': Invalid filename
This error suggests that sqlcmd is unable to locate or access the specified delete_data.sql file, often due to insufficient permissions or an incorrect working directory when the script is executed.
Follow these steps to diagnose and resolve the 'Invalid filename' error:
Open an elevated AutoSys Command Prompt:
Right-click the AutoSys command prompt shortcut and select "Run as administrator." This ensures the command prompt has the necessary permissions.
Verify write permissions in critical directories:
From this elevated command prompt, test if files can be created in the temporary directory (%TEMP%) and the AutoSys MSQ directory (%AUTOSYS%\dbobj\MSQ).
perl autobcpMSQ.pl:autobcpMSQ.pl script from the same elevated command prompt: perl autobcpmsq.pl Respond interactively to any prompts during the script's execution. autobcpMSQ.pl script to specify a dumpfile path, do not specify a custom path. Accept the default path. This default behavior ensures that the necessary files are correctly placed in the %AUTOSYS%\dbobj\MSQ directory, which is crucial for the script's successful operation.