Spectre scramble Options

The Spectre command line scramble sub-command allows you to mask data that needs to be shared for debugging purposes. It alters strings and numbers while keeping the cBase structure intact. Dives and cPlans should continue to work as before, but show nonsense. It has the following syntax:

spectre scramble <filename> [options]

The <filename> points to an existing cBase file. The <filename> can take various forms:

  • If you set DI_PROJECT or pass --project, then you can use a project path (e.g. /cbases/sales.cbase). This always uses forward slashes, regardless of the operating system.
  • If you do not set DI_PROJECT and do not pass --project, then you can use a filesystem path (e.g. C:\di\project\sales\cbases\sales.cbase, or sales.cbase if the current working directory is already C:\di\project\sales\cbases).

For example:

spectre scramble /cbases/sales.cbase

Enter spectre scramble -h to display the syntax and options as shown in the table.

NOTE: It is a best practice to make a backup copy of your cBase first—whichever cBase you run the command on is altered if you do not specify an alternate output. The default behavior is to obscure all columns.

Spectre scramble Sub-command Options

Option Description
--dataroot arg

Set the path to the DiveLine server dataroot.

For example:

spectre scramble /cbases/sales.cbase --dataroot c:\di\solution\dl-dataroot

Instead of using this option, you can set the DI_HOME environment variable. See Setting Environment Variables.

--project arg

Set the project name.

For example:

spectre scramble /cbases/sales.cbase --project sales

Instead of using this option, you can set the DI_PROJECT environment variable. See Setting Environment Variables.

-n [ --num-rows ] arg

Limit the number of output rows.

For example:

spectre scramble /cbases/sales.cbase -n 500

-m [ --mode ] arg

Specify the mode: "blank", "keep", "obscure", "randomize", "remove", or "shuffle". See definitions below.

For example:

spectre scramble /cbases/sales.cbase -m shuffle

Default is "obscure".

-c [ --column-mode ] column mode

Override the mode for a particular column. Useful when you want to only scramble columns with sensitive data.

For example:

spectre scramble /cbases/sales.cbase --mode shuffle -c "cost ytd" keep

-o [ --output ] arg

Specify the output file path.

For example:

spectre scramble /cbases/sales.cbase -m obscure --output /temp/obscure_sales.cbase

NOTE: If not set, the output defaults to the source cBase.

Mode options:
blank

Replace all values with nulls.

construct Does the same work that obscure does, but string columns lose their relationships to one another.
keep

Leave the specified column untouched.

obscure

Replace numbers and strings with random data, but keeps some properties. This is the default.

Number, date, and period columns will keep their mean, minimum, maximum, and variance.

String columns will keep their string counts and relationships to one another.

randomize

Replace all values with random values, with very little connection to the original data.
Columns keep their bit widths and signedness.

remove

Remove the specified column entirely.

shuffle

Same as "obscure", but string columns will lose their relationships to one another.

TIP: If you are scrambling your data for technical review, be sure you can examine it using the cBase Viewer in Workbench, or run some dives, before compressing it and sending it to Tech Support.

See also: