Pan is a program that can execute transformations designed by Spoon in XML or in a database repository. Usually transformations are scheduled in batch mode to be run automatically at regular intervals.
To launch Pan on the different platforms these are the scripts that are provided:
Pan can be run on any platform that has a version of the Java Runtime Environment version 1.5 or higher.
These are the command line options that you can use. IMPORTANT NOTES:
Below are the valid options.
This option displays the version of the Spatialytics ETL core library (Spatialytics_ETL.jar). The build version number and build date are shown as well.
This option runs the transformation defined in the XML file. (.ktr : Spatialytics ETL Transformation)
You can set the value of a named parameter, for example: -param:FOO=value
List the named parameters (their name, default value and description) that are defined in the specified transformation.
Specifies the log file. The default is the standard output.
The level option sets the log level for the transformation that's being run. These are the possible values:
Connect to the repository with name “Repository name”. You also need to specify the options –user, –pass and –trans. You can also specify this option in the form of environment variable Spatialytics_ETL_REPOSITORY.
This is the username with which you want to connect to the repository. You can also specify this option in the form of environment variable Spatialytics_ETL_USER.
The password to use to connect to the repository You can also specify this option in the form of environment variable Spatialytics_ETL_PASSWORD.
Use this option to select the transformation to run from the repository
Print a listing of all the sub-directories in the repository directory specified with the option ”-dir”.
Specifies the directory in the repository to use. Repository directories are specified like this:
From version 2.2.2 on, a / (slash) is used to separate directories on all platforms.
Show a list of all the transformations in the repository directory specified with the option ”-dir”.
Print a listing of all the defined repositories.
This options exports the complete repository to a single XML file. To restore this file to a repository, please use the Repository Explorer in Spoon. See the documentation of Spoon for more information.
If you have set environment variables Spatialytics_ETL_REPOSITORY, Spatialytics_ETL_USER, Spatialytics_ETL_PASSWORD, you can prevent Pan from logging into the repository. For example if you want to launch a transformation from an XML file.
Please make sure that you are positioned in the Spatialytics ETL directory before running the samples below. If you put these scripts into a batch file or shell script, simply do a change directory to the installation directory:
If Spatialytics ETL was installed on windows on the D:\ drive
D: cd \Spatialytics_ETL
If Spatialytics ETL was installed in the /product directory on a Unix system:
This example runs a transformation from file on a windows platform:
pan.bat /file:"D:\Transformations\Customer Dimension.ktr" /level:Basic
This example runs a transformation from file on a Linux box:
pan.sh -file="/PRD/Customer Dimension.ktr" -level=Minimal
This example runs a transformation from the repository on a windows platform: (Enter on a single line without returns…)
pan.bat /rep:"Production Repository" /trans:"update Customer Dimension" /dir:/Dimensions/ /user:matt /pass:somepassword123 /level:Basic
If you don't want the output of the file to appear on the screen but rather be put into a log file, you can use redirection.
This example adds the Pan output to an ever-growing log file:
pan.sh -file="/PRD/trans.ktr" -level=Minimal >> /LOG/trans.log
This example writes the Pan output to a file that gets overwritten every time:
pan.bat /file:C:\PRD\trans.ktr /level:Basic > C:\LOG\trans.log
Pan returns an error code based on how the execution went:
The best way to go at it is to test the command first at the dos prompt. Then you can use the windows scheduler to launch this command. Windows versions since Windows 2000 have a GUI for doing this accessible through the control panel. However it's also possible to use the command line to do this:
at 23:30 /every:Monday,Wednesday,Friday "D:\update_dimensions.bat"
To see a list of the scheduled commands simply type:
First create a shell script that runs all the transformations you need. Then you can schedule this script to run. On Unix like systems the easiest way to schedule a command is by using the “cron table”. You can do this by entering the following command:
Then you can enter the time at which the command needs to be run as well as the command on a single line in the text file that is presented. The first options are:
You can specify more then 1 number for each of these values by separating 2 number with a hyphen - . This means an inclusive number range. If you separate the number by commas (,), it means distinct values. If you use * instead of a number, it means: every possible hour, minute, day, month or weekday.
So, if you want to update the dimensions every hour, at 15 and 45 minutes past the hour during the weekdays, you might enter these lines in a crontab:
# # Launches the update of the dimensions in the warehouse # 15,45 * * * 1-5 /PROD/update_dimensions.sh #
From the Pentaho website