![]() Previous |
![]() Next |
A MAINTAIN MOVE TO PARTITION statement combines both add and move capabilities. You can use a MAINTAIN MOVE TO PARTITION statement to:
Add previously-populated dimension or composite values to a partition in the same manner as MAINTAIN ADD TO PARTITION
Change the dimension or composite values defined for a partition in the partition template by which the variables are dimensioned and, at the same time, move the data of a previously-partitioned variables dimensioned by those dimensions and composites from one partition to another.
Syntax
MAINTAIN partition-template MOVE TO PARTITION partition value [TO value]
Parameters
A text expression that is the name of a previously-defined partition template object.
Specifies that values are to be added to the partition or moved from one partition to another.
A text expression that is the name of a previously-defined partition in the partition template specified by partition-template.
Specifies one or more values of a previously-populated dimension or composite. You can specify these values as:
A literal value.
An expression whose value is a dimension value.
For all dimensions except NUMBER
dimensions, an INTEGER
expression whose value represents the position of a dimension value.
A valueset; or a LIMIT function.
For a concat dimension, you can specify a value of the concat dimension, or the name of a component dimension and a value or position of that dimension. You can use the values of a dimension surrogate as the values of value.
Indicates a range of values.
Examples
Specifying the Values of a Partition Using Valuesets
Assume that you have defined a partition template object with the following definition that does not specify the actual dimension values for each partition.
DEFINE PARTITION_SALES_BY_YEAR PARTITION TEMPLATE <TIME PRODUCT> - PARTITION BY LIST (TIME) - (PARTITION TIME_2004 VALUES () <TIME PRODUCT> - PARTITION TIME_2003 VALUES () <TIME PRODUCT> - PARTITION TIME_2002 VALUES () <TIME PRODUCT>)
To specify the values of each partition using valuesets, you take the following steps:
Define a valueset for each year's values.
DEFINE vs_2004 VALUESET time LIMIT vs_2004 to '01Dec2004' '31Dec2004' '01Jan2004''31Jan2004' - 'Jan2004' 'Dec2004' '2004' DEFINE vs_2003 VALUESET time LIMIT vs_2003 to '01Dec2003' '31Dec2003' '01Jan2003''31Jan2003' - 'Jan2003' 'Dec2003' '2003' DEFINE vs_2002 VALUESET time LIMIT vs_2002 to '01Dec2002' '31Dec2002' '01Jan2002''31Jan2002' - 'Jan2002' 'Dec2002' '2002'
Using MAINTAIN MOVE statements, specify values for the partitions of the partition template.
MAINTAIN partition_sales_by_year MOVE TO PARTITION time_2004 vs_2004 MAINTAIN partition_sales_by_year MOVE TO PARTITION time_2003 vs_2003 MAINTAIN partition_sales_by_year MOVE TO PARTITION time_2002 vs_2002
When you issue a DESCRIBE statement, you can see that the description of the partition_sales_by_year
partition template now includes the appropriate values of time
in each partition definition.
DEFINE PARTITION_SALES_BY_YEAR PARTITION TEMPLATE <TIME PRODUCT> - PARTITION BY LIST (TIME) - (PARTITION TIME_2004 VALUES - ('2004','Dec2004','Jan2004', 31Dec2004',01Dec2004','31Jan2004','01Jan2004')- PARTITION TIME_2003 VALUES - ('2003','Dec2003','Jan2003', 31Dec2003',01Dec2003','31Jan2003','01Jan2003')- PARTITION TIME_2002 VALUES - ('2002','Dec2002','Jan2002', 31Dec2002',01Dec2002','31Jan2002','01Jan2002'))