Architecting, installing and maintaining your SAS environment

Stored and/or Scheduled Processes - a resource?

Accepted Solution Solved
Reply
Contributor
Posts: 31
Accepted Solution

Stored and/or Scheduled Processes - a resource?

Hi again all,

I have spent hours reading SUGI papers, SAS Documentation and these Forums trying to figure this out... but I can't seem to find an answer that works.  I must be doing something wrong, so I need to go back to the drawing board.  I doubt anyone has the time to answer all the below question, so I am hoping that someone has a resource that they could point me too that would help me go through these steps one by one to find the problem.

We are using EG 6.1 with Windows 7 and SAS sits on a remote server using Windows 7. 

I am trying to create a series of Stored Processes for my users.  At the very least, I need for them to be able to run, but ideally a lot of them would be scheduled.  I have tried 3 different approaches thus far, and so far have gotten 3 different errors.

1) I created a fairly simple program and simply scheduled the process to run every morning in Enterprise Guide.  The process starts up fine in the background, but then gets a "Task Run Failure".  I get the same error whether I am running it with SAS open or closed, logged in or logged on, computer off or on, etc.  If I just run the program manually, it works fine and the data updates.

2) I tried creating a stored process that any of my uses can see and run as needed.  The process needs 2 libname paths to access and save the data it needs.  If I run the original process on my machine.. it works fine.  However, when I access the Stored Process through the folder explorer in EG, it runs the first half fine, but then says that the user doesn't have access to the other tables it needs.  This happens for any user... including me

3)Finally, I have tried scheduling processes in Management Console.  It seems that all the correct servers and batch info is set up correctly (we did it with the SAS professionals during install), but I am not able to make a new "Flow" because it doesn't recognize that there are any programs to be run.

Basically, I can't get this to work.  Is there some Schedule for Dummies type resource somewhere?  perhaps a video? I can post more specific info if requested, but I don't want to waste peoples time with silly questions if I can avoid it. 

Thanks everyone!

Signed,

Tired Programmer Turned Newbie Administrator Learning as I Go


Accepted Solutions
Solution
‎01-03-2014 10:07 AM
Frequent Contributor
Posts: 134

Re: Stored and/or Scheduled Processes - a resource?

Posted in reply to stuart_snap

Lets start by a definition :

  • a stored process is an interactive sas program stored remotely (in metadata or in a server's folder)  and which can be executed (remotely) by several users

  • a sas batch program is a script scheduled to run automatically at a given time&date ; the scheduler can be either local (Windows Scheduler for Enterprise Guide) or remote on a server.

In order to schedule a SAS program, you'll be required to create a scheduled task. SAS EG comes with a wizard which creates one on you behalf on your Windows Scheduler.

By default, you are not given Administrator privilege on you Windows session - but that may vary widely according to your IT environment (this is not the recommended practice).

Usually, you need to be given some kind of administrative permissions in order to execute Windows Scheduler. Check with SAS EG documentation.

=> try scheduling a simple task (a DOS batch script doing a DIR > Result.txt, for instance) and you'll be able to assess whether you can access your local scheduler or not.

Now let's come to the schedulers :

- SAS EG can create a scheduled sas program using a whole project or  any Process Flow at lower level.

the corresponding scheduled tasks (a windows script usually named *.vbs)  will be run by Windows Scheduler on your PC

Take care that the user connection credentials to metadata must be provided to SAS EG. You to set up the corresponding parameters in an *.xml file :

See 30917 - Scheduling projects in SAS® Enterprise Guide®

- SAS BI Server can also create a scheduled sas job using the SMC Scheduled Manager if you have access to the SMC. A specific resource, namely a "SAS Scheduling Server" (See Server Manager Plug-in inside the SMC)

will create the scheduled task to be run remotely. Some permissions are also required on the server to enable scheduling for the SAS system account (sassrv usually).

SAS Scheduling Manager uses a two-level structure :

-- first, you create a deployed job - for instance, usingf SAS DATA Step Batch Server - with your code (stored remotely on the SAS Server, for instance a *.sas script generated with SAS EG)

-- then you create a Flow and you insert your deployed job into this flow; afterwards, you'll be able to schedule your flow

Scheduling in SAS(R) 9.4

In theory, you can launch a stored process with a scheduler using the STP procedure inside a sas  batch program, but this is quite far-fetched imho (too many layers) :

SAS(R) 9.4 Stored Processes: Developer's Guide

View solution in original post


All Replies
Solution
‎01-03-2014 10:07 AM
Frequent Contributor
Posts: 134

Re: Stored and/or Scheduled Processes - a resource?

Posted in reply to stuart_snap

Lets start by a definition :

  • a stored process is an interactive sas program stored remotely (in metadata or in a server's folder)  and which can be executed (remotely) by several users

  • a sas batch program is a script scheduled to run automatically at a given time&date ; the scheduler can be either local (Windows Scheduler for Enterprise Guide) or remote on a server.

In order to schedule a SAS program, you'll be required to create a scheduled task. SAS EG comes with a wizard which creates one on you behalf on your Windows Scheduler.

By default, you are not given Administrator privilege on you Windows session - but that may vary widely according to your IT environment (this is not the recommended practice).

Usually, you need to be given some kind of administrative permissions in order to execute Windows Scheduler. Check with SAS EG documentation.

=> try scheduling a simple task (a DOS batch script doing a DIR > Result.txt, for instance) and you'll be able to assess whether you can access your local scheduler or not.

Now let's come to the schedulers :

- SAS EG can create a scheduled sas program using a whole project or  any Process Flow at lower level.

the corresponding scheduled tasks (a windows script usually named *.vbs)  will be run by Windows Scheduler on your PC

Take care that the user connection credentials to metadata must be provided to SAS EG. You to set up the corresponding parameters in an *.xml file :

See 30917 - Scheduling projects in SAS® Enterprise Guide®

- SAS BI Server can also create a scheduled sas job using the SMC Scheduled Manager if you have access to the SMC. A specific resource, namely a "SAS Scheduling Server" (See Server Manager Plug-in inside the SMC)

will create the scheduled task to be run remotely. Some permissions are also required on the server to enable scheduling for the SAS system account (sassrv usually).

SAS Scheduling Manager uses a two-level structure :

-- first, you create a deployed job - for instance, usingf SAS DATA Step Batch Server - with your code (stored remotely on the SAS Server, for instance a *.sas script generated with SAS EG)

-- then you create a Flow and you insert your deployed job into this flow; afterwards, you'll be able to schedule your flow

Scheduling in SAS(R) 9.4

In theory, you can launch a stored process with a scheduler using the STP procedure inside a sas  batch program, but this is quite far-fetched imho (too many layers) :

SAS(R) 9.4 Stored Processes: Developer's Guide

Contributor
Posts: 31

Re: Stored and/or Scheduled Processes - a resource?

This is extremely helpful, thank you!!!

May I ask a follow up question.  Let's forget stored processes for now.  I am just going to focus on getting some processes scheduled.

Regarding this...

"SAS Scheduling Manager uses a two-level structure :

-- first, you create a deployed job - for instance, usingf SAS DATA Step Batch Server - with your code (stored remotely on the SAS Server, for instance a *.sas script generated with SAS EG)

-- then you create a Flow and you insert your deployed job into this flow; afterwards, you'll be able to schedule your flow"

Where do I save the code I want to run?  I am using Java Batch Server and have a Distributed In-Process Scheduling Server.  I have a .SAS file.  Where do I need to store it so I can deploy and get the scheduleing manager to see the job?

Thanks a million!!!

Frequent Contributor
Posts: 134

Re: Stored and/or Scheduled Processes - a resource?

Posted in reply to stuart_snap

Always glad to be helpful. Smiley Happy

The SAS code should be stored on the server if you intend to schedule with a server scheduler (that sounds obvious).

I suspect your SAS configuration is lacking some components because, as far as I know, Java Batch Server and In-Process Scheduling Server can only be used with SAS web applications like SAS Web Report Studio.

You'll need a Data Step Batch Server to create a deployed job with a sas script *.sas and at least some kind of Operating System Services to schedule your task.

Contributor
Posts: 31

Re: Stored and/or Scheduled Processes - a resource?

Thanks again!

You were correct... I needed a SAS DATA step batch server.  Now scheduling on the server is working fine!

I am now working with SAS Support to get local scheduling working.  That still gets a "Launch Failure" error.

Thanks for your help!

Frequent Contributor
Posts: 134

Re: Stored and/or Scheduled Processes - a resource?

Posted in reply to stuart_snap

You're welcome.

Another way of scheduling "locally" a remote SAS code is to use SAS Enterprise Guide COM/.NET API with a Powershell launcher (+ a scheduled task created on the PC) :

see Chris Hemedinger's paper (page 6, example 3) :http://support.sas.com/resources/papers/proceedings12/298-2012.pdf

🔒 This topic is solved and locked.

Need further help from the community? Please ask a new question.

Discussion stats
  • 5 replies
  • 2303 views
  • 4 likes
  • 2 in conversation