Maintaining Global Metadata |
To have SAS/Warehouse Administrator schedule a Job, you must open the properties window for the Job and enter information on the Date/Time tab and the Server tab. The Server tab requires a scheduling server definition, as shown in the next display:
A scheduling server definition is a metadata record that specifies
a scheduling server application, such as CRON under UNIX System V, or the AT command under Microsoft Windows or Windows NT
a host definition for the computer where the scheduling server runs
directories where the scheduling server application can send temporary files
the commands used to start SAS on the scheduling server host (to execute the Job)
the default job-tracking option for Jobs using this scheduling server definition.
Scheduling server definitions are required if you want SAS/Warehouse Administrator to generate the code to schedule and track Jobs. At a minimum, in each Warehouse Environment, create a scheduling server definition for each host where scheduled Jobs will run. This typically includes the host where SAS/Warehouse Administrator is installed, as well as one or more remote hosts.
Preparing to Create Scheduling Server Definitions |
Before you create a scheduling server definition, make the following preparations:
Create a host definition for the computer where the scheduling server application (such as CRON) runs. For details about host definitions, see Host Definitions.
Identify the kind of scheduling server definition that will support your goals. To schedule and track a Job on a UNIX System V computer, you would typically use a CRON definition. To schedule and track a Job on a Microsoft Windows or Windows NT computer, you would typically use an AT definition. To generate Jobs that can be used with scheduling servers other than AT or CRON, use a Null Scheduler definition. A Null Scheduler definition has other uses as well, as described in Typical Uses for a Null Scheduler Definition.
When scheduling server definitions, specify the physical paths for the directories where the scheduling server application can send temporary files. Create or identify these directories. For example, the working directory for an AT scheduling server definition might be c:\job .
Example: Creating an AT Scheduling Server Definition |
This example describes how to create a scheduling server definition for a local host that is running the Microsoft Windows or Windows NT operating system. Details are provided for a remote host running on one of these operating systems.
Note: The steps for creating a CRON scheduling server definition are very similar.
In addition to the instructions given in Preparing to Create Scheduling Server Definitions, more preparation might be needed when the AT command is the scheduling server.
The properties window for a scheduling server definition is used to generate a command for a given scheduling server. For example, the Windows NT AT Server Properties window is used to generate an AT command that schedules a SAS/Warehouse Administrator Job.
Note: The maximum length for an AT command is 129 characters.
If the command generated from the metadata in the properties window is too long, you will get an error message that says that the maximum allowable length for an AT command has been exceeded. You will not be able to schedule the Job until this problem has been fixed. To fix this problem, you must shorten the command that is generated from the properties window by shortening pathnames or removing command options.
Display the Define Items Used Globally window, as described in Using the Define Items Used Globally Window.
In the Type panel of the Define Items Used Globally window, click the button beside Scheduling Servers. Click at the bottom left of the window. The Available Scheduling Servers window displays.
For the current example, on the Available Scheduling Servers window, the Windows NT AT Command is selected. (You would select UNIX System V Cron to create a scheduling server definition for a host running a System V UNIX, and you would select Null Scheduler to generate a Job that could be used with a scheduling server other than AT or CRON.)
After you have selected the appropriate scheduling server, click . A Windows NT AT Server Properties window for the scheduling server displays for you to enter the appropriate information as follows:
Scheduler Name |
specifies a display name for the scheduling server definition you are creating, such as local schedsvr . |
On the General tab, after you have entered a name (and perhaps a description), click the Directories tab. The fields on this tab are
The current example is a scheduling server definition for a local host (SAS/Warehouse Administrator host). Accordingly, the Directories tab only specifies a local working directory: c:\job . If you were creating a scheduling server definition for a remote host, you would specify a working directory on the remote host as well. After specifying the appropriate working directories, click the Host tab. The fields on this tab are
Compute Host |
specifies a definition for the host where the Job will be executed. |
The current example is a scheduling server definition for a local host. Accordingly, a local host definition (which happens to be named local ) is specified on the Host tab. If you were creating a scheduling server definition for a remote host, you would specify a remote host definition. After specifying the appropriate host definition, click the Command tab. The fields on this tab are
Command this server will use to start SAS jobs |
specifies the command that the scheduling server application will use to start SAS, in order to execute the Job. |
When you first display the Command tab, a default command is provided. You might have to edit the default command to start SAS at your site.
Note: Use the Command tab to specify a SAS start command only. Do not specify a script file on this tab.
Note: Do not specify a SAS config file, a SAS autoexec file, or any other options on the Command tab. Specify any SAS start command options on the Options tab.
After specifying the appropriate start command, click the Options tab. The fields on this tab are
On the Options tab, all of the default macros are specified (&jobsrc., &jobsys., and so on). One way to shorten the AT command generated from the Windows NT AT Server Properties window is to omit values in the Log Filename and Print Filename fields, but that was not required in our example.
A SAS config file and SAS autoexec file with short filenames are specified in the Other Command Options field. These short filenames are another way to shorten the AT command generated from the properties window.
After specifying the appropriate command options, click the Tracking tab. The fields on this tab are
For the current example, accept the default value on the Tracking tab: Enabled.
After specifying the appropriate metadata on the Tracking tab, you are finished entering metadata for the example scheduling server definition. Click . The new server definition is added to the list of server definitions in the Define Items Used Globally window.
After a scheduling server definition has been created, it can be used to schedule a Job, as described in Example: Scheduling and Tracking a Job with the AT Command.
Summary: Creating and Using a Null Scheduling Server Definition |
The Available Scheduling Servers window includes a Null Scheduler option, as shown in the following display:
Use the Null Scheduler option to create a scheduling server definition that will save a generated SAS Job as a .sas file in a specified directory, along with a command file to run that Job.
For example, suppose that you wanted to schedule a SAS/Warehouse Administrator Job that would execute on a mainframe computer. You could create a null scheduler definition and use it to schedule the Job. That is, you could define the Job in SAS/Warehouse Administrator, then schedule it, specifying a null scheduling server definition on the Server tab in the Job Properties window as follows:
If you click on the Job Properties window, SAS/Warehouse Administrator will
generate the code appropriate for the Job and save it to a .sas file
generate a SAS start command and write it to a plain text file
write tracking metadata for the Job to the Jobs Information library.
After the command file for the Job has been generated, give it to the mainframe operator who is responsible for scheduling batch jobs. Keep in mind that the mainframe scheduling server would need access to the generated code for the Job, which is specified with the -SYSIN option in the command file.
You can use a null scheduler definition to support the following scenarios:
Many sites do not permit users to schedule their own batch jobs, especially jobs that update shared files. If that were the case at your site, you could schedule a SAS/Warehouse Administrator Job with a null scheduler definition. You could then give the resulting command file to the operator who is responsible for scheduling batch jobs. Keep in mind that the scheduling server application would need access to the generated code for the Job, which is specified with the -SYSIN option in the command file.
If you want to use a scheduling server application other than CRON or AT, create a null scheduler definition and use it to schedule the Job. You could then submit the resulting command file to the scheduling server application. The scheduling server application would need access to the -SYSIN file specified in the command.
You could use a null scheduler definition to generate a set of command files with unique Job IDs. These command files could be executed by a program outside of SAS/Warehouse Administrator. For example, you could create a program that executed the Jobs for all of the data stores in a given Subject, Data Warehouse, or Warehouse Environment.
Except for selecting Null Scheduler from the Available Scheduling Servers window, the steps for creating a null scheduler definition are similar to those described for the AT command in Define Server Properties.
Keep in mind that if a local host is specified in the null scheduler definition, the generated SAS Job and its command file will be sent to the directory specified in the Local Working Directory field on the Directories tab. If a remote host is specified, these files will be sent to the directory specified in the Remote Working Directory field.
Copyright © 2012 by SAS Institute Inc., Cary, NC, USA. All rights reserved.