Exporting factory calendars

About this task

To export an SAP R/3 calendar, from TWA_home/methods (where TWA_home is the complete path where you installed HCL Workload Automation) enter the following command:
Figure 1. Command syntax

1   r3batch   -t RSC   -c XA_Unique_ID   -- " -calendar_ID calendarID   -year_from yyyy   -year_to yyyy
1!  -getworkdays
1  -getfreedays
2?   -tws_name tws_cal_name
2?   -tws_description tws_cal_desc
2?   -filename output_filename
2  "
Where:
-t RSC
The identifier of the task to be performed, in this case RSC (Retrieve SAP R/3 Calendars). This parameter is required.
-c XA_Unique_ID
The unique identifier for the extended agent workstation connected to the SAP R/3 system where the calendar data to export is located. The SAP R/3 system must be configured as a workstation to HCL Workload Automation. This parameter is required. For information about retrieving the unique identifier for the extended agent workstation, see UNIQUE_ID.
-calendar_id calendarID
The identifier of the SAP R/3 calendar to be exported, which consists of two alphanumeric characters. This parameter is required.
-year_from yyyy
The year of the calendar from when to start exporting dates, in the format yyyy. This parameter is required.
-year_to yyyy
The year of the calendar when to stop exporting dates, in the format yyyy. This parameter is required.
-getworkdays | -getfreedays
Specify getworkdays to create the HCL Workload Automation calendar definition based on the working days of the SAP R/3 calendar. In this way, each date of a working day is stored in the output file.

Specify getfreedays to create the HCL Workload Automation calendar definition based on the holidays of the SAP R/3 calendar. Each date of a non-working day is stored in the output file.

These parameters are optional and mutually exclusive. If you do not specify either, the default is getworkdays.

-tws_name tws_cal_name
The HCL Workload Automation name for the exported SAP R/3 factory calendar. It is stored in the output file.
You can specify up to eight alphanumeric characters. This parameter is optional, the default is SAPXX_calendarID, where:
XX
Corresponds to WK if the calendar includes only working days or FR if the calendar includes only non-working days.
calendarID
The identifier of the SAP R/3 calendar.

For example, the default HCL Workload Automation name for an exported calendar, whose identifier is 04, that includes only working days, is SAPWK_04.

-tws_description tws_cal_desc
The description of the HCL Workload Automation calendar. It is stored in the output file. You can specify up to 120 alphanumeric characters. If the description contains blanks, it must be enclosed between single quotes. This parameter is optional.
-filename output_filename
The name of the output file that is to contain the calendar definitions. This file is written in a scheduling language that can be processed by the composer when you add the calendar data to the HCL Workload Automation database.

You can specify a file name with its complete or partial path; if you do not specify any path, the file is created in the current directory. If the path you specify does not exist, it is created, provided that you have the appropriate access rights. Otherwise, the command returns an error message and is not performed.

You can specify up to the maximum number of characters allowed by your operating system. If the name of the file contains blanks, it must be enclosed between single quotes. If another file with the same name exists, it is overwritten.

This parameter is optional. The default value is tws_name.txt, where tws_name is the value you set for the tws_name parameter.

The following is an example of an SAP R/3 factory calendar export command:
r3batch -t RSC -c horse10 -- " -calendar_id 01 -year_from 2007 
-year_to 2010 -tws_name CAL1 -tws_description 'SAP Calendar 01' 
-getworkdays -filename 'my dir/calendar_01.dat' " 
This command exports the SAP R/3 calendar named 01, located on the SAP R/3 system named horse10. The dates exported begin from year 2007, until year 2010, considering only working days. The HCL Workload Automation name used for the calendar is CAL1, and the description written in the output file is SAP Calendar 01. The output file is named calendar_01.dat, stored in <data_dir>/methods/my dir, and its content looks like the following
$CALENDAR
    CAL1
    "SAP Calendar 01"
    01/02/2007 01/03/2007 01/04/2007 01/05/2007 01/08/2007 01/09/2007 01/10/2007 
    01/11/2007 01/12/2007 01/15/2007 01/16/2007 01/17/2007 01/18/2007 01/19/2007 
    01/22/2007 01/23/2007 01/24/2007 01/25/2007 01/26/2007 01/29/2007 01/30/2007 
    01/31/2007 02/01/2007 02/02/2007 02/05/2007 02/06/2007 02/07/2007 02/08/2007 
     .......
    11/24/2010 11/25/2010 11/26/2010 11/29/2010 11/30/2010 12/01/2010 12/02/2010 
    12/03/2010 12/06/2010 12/07/2010 12/08/2010 12/09/2010 12/10/2010 12/13/2010 
    12/14/2010 12/15/2010 12/16/2010 12/17/2010 12/20/2010 12/21/2010 12/22/2010 
    12/23/2010 12/24/2010 12/27/2010 12/28/2010 12/29/2010 12/30/2010 12/31/2010