Amadeus cookies policy - you'll see this message only once.

Amadeus use cookies on this website. They help us to know a little bit about you and how you use our website, which improves the browsing experience and marketing - both for you and for others. They are stored locally on your computer or mobile device. To accept cookies, continue browsing as normal. Or, go to the privacy policy for more information.

Execute SQL Server Agent Jobs Using SAS

There may be occasions where it is necessary to execute a SQL server agent job from SAS. Before this can be achieved, the following prerequisites need to be met:

• Either the osql or sqlcmd utility must be available on the machine from where the SAS program will be executed

• The ability to utilise X command via SAS must be enabled

The above utilities provide the ability to perform SQL Server operations through the operating system command line, including the execution of SQL Server Agent jobs. The utilities use ODBC to communicate with the SQL server specified.

Once the selected utility has been installed, it can now be invoked via SAS X command. For this example, we are using the osql utility:

Execute SQL Server Agent Jobs Using SAS Image 3

Running through the arguments called:

Execute SQL Server Agent Jobs Using SAS Image 4