COPY DATA / COPIAR DATOS

English (Español a continuación)

Two methods are usually used to copy data from one section of the database to another section of the same database:

  • Equalization:

Year 2018 = Year 2017 (Equals 2018 to 2017)

  • Using the DATACOPY command:

DATACOPY «Year 2017» TO «Year 2018» (Copy the data from the year 2017 to the year 2018)

Both methods can be used within a FIX structure.

For example:

  • FIX («Madrid»)
  • Year 2018 = Year 2017;
  • ENDFIX

Another example:

  • FIX («Madrid»)
  • DATACOPY «Year 2017» TO «Year 2018»;
  • ENDFIX

Both examples would copy for the “Madrid” market the data from the year 2017 in the year 2018.

As a general rule, the match method is preferable when copying members of a dense dimension, while the DATACOPY method is preferable with members of the sparse dimension.

EQUALIZATION

The problem this method present is that depending on the type of dimension, it may or may not create the necessary blocks in the target section.

DATACOPY

This command offers the great advantage that it creates all the necessary blocks:

The two sections (source and destination) must be the same size.

Examples:

  • DATACOPY “Year 2017” TO “Year 2018”;
  • DATACOPY «Year 2017» -> «January» TO «Year 2018» -> «January»;

Using this command within a FIX allows us to delimit the section of the database that we want to copy:

  • FIX («Madrid», «January»)
  • DATACOPY «Year 2017» TO «Year 2018»;
  • ENDFIX

In the previous example, this command would copy the data from the “Madrid” market for the month “January” corresponding to the year 2017 in the year 2018.

To avoid that when executing this command empty blocks from the source section are copied into the destination section the next command can be included before this instruction:

  • SET COPYMISSINGBLOCK OFF;

The previous example would be:

  • SET COPYMISSINGBLOCK OFF;
  • FIX («Madrid», «January»)
  • DATACOPY «Year 2017» TO «Year 2018»;
  • ENDFIX

Español

Para copiar los datos de una sección de la base de datos en otra sección de la misma base datos se suelen utilizar dos métodos:

  • Igualación:

Año 2018 = Año 2017 (Iguala el año 2018 al 2017)

  • Mediante el comando DATACOPY:

DATACOPY “Año 2017” TO “Año 2018” (Copia los datos del año 2017 en el año 2018)

Ambos métodos se pueden utilizar dentro de una estructura FIX.

Por ejemplo:

FIX(“Madrid”)

Año 2018 = Año 2017;

ENDFIX

Otro ejemplo:

FIX(“Madrid”)

DATACOPY “Año 2017” TO “Año 2018”;

ENDFIX

Ambos ejemplos copiarían para el mercado “Madrid” los datos del año  2017 en el año 2018.

Como regla general es preferible el método de igualación cuando se copian miembros de una dimensión densa, mientras que el método DATACOPY es preferible con miembros de la dimensión dispersa.

IGUALACIÓN

El problema que puede presentar este método es que según el tipo de dimensión puede crear o no los bloques necesarios en la sección destino.

DATACOPY

Este comando ofrece la gran ventaja de que crea todos los bloques necesarios:

Las dos secciones (origen y destino) deben tener el mismo tamaño.

Ejemplos:

  • DATACOPY “Año 2017” TO “Año 2018”;
  • DATACOPY “Año 2017” -> “Enero” TO “Año 2018” -> “Enero”;

Al utilizar este comando dentro de un FIX nos permite delimitar la sección de la base de datos que se quiere copiar:

FIX(“Madrid”, “Enero”)

DATACOPY “Año 2017” TO “Año 2018”;

ENDFIX

En el ejemplo anterior este comando copiaría los datos del mercado “Madrid” del mes “Enero” correspondiente al año 2017 en el año 2018.

Para evitar que al ejecutar este comando se copien bloques vacíos de la sección origen en la sección destino se puede incluir antes de esta instrucción el comando:

  • SET COPYMISSINGBLOCK OFF;

El ejemplo anterior quedaría:

SET COPYMISSINGBLOCK OFF;

FIX(“Madrid”, “Enero”)

DATACOPY “Año 2017” TO “Año 2018”;

ENDFIX

Anuncio publicitario