Running a Subset Action from the Command Line

Search Knowledge Base by Keyword

< Back

You can also run Subset Actions from the command line using .CMD scripts. A set of template scripts are shipped in the data-type folders of “VIPTDM\SubsetCloneAndMaskRun”. If you retained the default installation locations, this folder scan be found under C:\VIPTDM\SubsetCloneAndMaskRun. You will find five template scripts:

  1. Subset1_MetaData.cmd
  2. Subset2_Prep.cmd
  3. Subset3_Build.cmd
  4. Subset4_Subset.cmd

The script names tell you that:

  1. Subset_MetaData.cmd” – The action is used for subsetting
  2. “Subset1_MetaData.cmd” – The order in which the Action specified in the script are typically performed.
  3. “Subset1_MetaData.cmd” – The Subset Action that the template script performs.

Each .CMD script should be edited using a text editor before executing a new Action. You must set the mandatory parameters and any optional parameters required.

Each .CMD script is formatted as follows:

Data Subsetting_Command Script

Under “REM Script Parameters” (rows 2-14 above), you can set parameters. Each row is a different parameter that can be “Set”. The parameters are then passed into the script used to Call VIPExecutor (Row 19 above).

The parameters listed under “REM Script Parameters” have been given intuitive names. For example, parDatabaseType is simply named “Database”.

First, edit “Database” (row 8 above) to specify one of the following four database types:

  1. Database=”MySQL”
  2. Database=”SQL Server”
  3. Database=”Postgres”
  4. Database=”Oracle”
  5. Database=”DB2″

For instance, the following parameter should be used when subsetting a Postgres database:

set database=SQL Server

Next, under “flowdirectory” (row 2 above) specify location of the two .vip workflows used during subsetting. If you retained the default location during installation, the flow directory will be “C:\VIPTDM\SubsetCloneAndMask”:

set flowdirectory=C:\VIPTDM\SubsetCloneAndMask

Under “rundirectory” (row 3 above) specify the location of your Run Directory. For example

set rundirectory=C:\VIPTDM\SubsetCloneAndMaskRun\Subset\SQLServer

Next, you must specify the file name of your Basic Control Spreadsheet under “controlspreadsheet” (row 4 above). This will point the VIP workflow to the Basic Control spreadsheet stored in the Run Directory. For example:

set controlspreadsheet=VIPSubsetSQLServer.xlsx

Next, specify where the folder in which the generated Log files and Subset Report will be stored. Use “outputdirectory”(row 5 above) to set a folder directory. You can specify a folder within your Run Directory folder as follows:

set outputdirectory=%rundirectory%\folder name

Next, specify the Subset Actions that you would like to perform for “Action” (row 6 above). For example, to run the GETMETADATA action, set:

action=GETMETADATA

Multiple Actions can be executed by one Script. To execute multiple actions, separate list the Action name in a comma separated list.

These are the mandatory parameters for executing a Subset Action using Test Data Automation. They must be set each time an Action is run.

You can additionally set optional parameters in the call row (row 19 in the above example). To do this, please refer to the examples in the parameters list. It’s advised that you first review the existing parameters in the call row to see if a default has been set. In this instance, simply update the existing parameter.

Run the Action

Once you have parameterized your .cmd script, you can run the action from Command Prompt, or can be executed simply by double clicking it. Each time a script is run, its progress will be shown in the PutFlowsInMemory window with any error messages displayed. Two outputs will further be created in the folder you specified under “outputdirectory”:

  1. A Log file
  2. A Subset Report