AutoSys Workload Automation

 View Only
  • 1.  Start SAS Job via AutoSys

    Posted May 18, 2016 03:18 AM

    I have a SAS program called Email.sas saved on a Unix server, the Unix server has AutoSys installed.

    I have created a AutoSys job called Email_Check, which basically is required to start the SAS job "Email.sas".

     

    I created a JIL with the following command:

     

    update_job: 158774_Email.sas_job         job_type: CMD

    command: /sas/departments/pjy/projects/falcon/Email.sas

    machine: <<server name>>

    owner: sas

    date_conditions: 1

    days_of_week: all

    start_times: "08:00"

    alarm_if_fail: 1

    timezone: GMT

     

    However the job keeps failing with permissions issue.

     

    Can anyone advise on how to run SAS jobs via AutoSys?



  • 2.  Re: Start SAS Job via AutoSys

    Posted May 18, 2016 10:36 PM

    Hi Jay,

    What version of WAAE please?

    When you say, failing with permission issue, is it on SAS side?

    Does the /sas/departments/pjy/projects/falcon/Email.sas script use relational path (for example: echo date > tmp_file instead of echo date > /tmp/tmp_file)?

    By default, the system agent 11.3 works from the it's location as the initial directory. It could be that the script is trying to create a file under the agent path (which is usually owned by root or autosys) and hence fails with permission denied.

    Ensure the Agent's spool directory is world-writable with sticky bit on (drwxrwxrwt.), that is another potential reason job could fail when run as non-root/autosys users.

     

    Thanks,

    Chandru



  • 3.  Re: Start SAS Job via AutoSys

    Posted May 19, 2016 03:45 AM

    Hi Chandru,

     

    Thank you for your suggestions.


    Our version of WAAE is 11.3.

    I’m not sure if the failure is on the SAS end, the user ID has permissions.

    The SAS script “Email.sas” simply has the following command within it:

     

                    FILENAME outmail EMAIL

                    SUBJECT="Testing Remote Email Send"

                    TO=("test@gmail.com");

                    DATA _NULL_;

                    FILE outmail;

                    PUT "Good Morning,";

                    PUT " ";

                    PUT "This is an AutoSys test.";

                    PUT " ";

                    PUT "Script is stored on Unix server:";

                    PUT " ";

                    PUT "Regards";

                    PUT "*JJ";

                    RUN;

     

    You say that “By default, the system agent 11.3 works from the its location as the initial directory”… where would that be? If I move my SAS script to that location I can test to see if it works.

     

    I’m checking the write status with my colleagues.



  • 4.  Re: Start SAS Job via AutoSys
    Best Answer

    Posted May 19, 2016 04:34 AM

    Hi Jay,

     

    One can't call a SAS program directly in any Scheduling Engine. You need to invoke the SAS command line, like so:

    Try this for the AutoSys command:

    <SASROOT>/sas -SYSIN /sas/departments/pjy/projects/falcon/Email.sas

     

    Replace <SASROOT> with the absolute path of the sas command line.

     

    Cheers,

    Chandru