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. |
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. |
remove |
Remove the specified column entirely. |
shuffle |
Same as "obscure", but string columns will lose their relationships to one another. |
The following command obscures all columns in the salesCopy cBase and writes the results to the temp directory.
spectre scramble c:\\di_solution_71\projects71\workbench\cbases\salesCopy.cbase -o /temp/testscramble.cbase
The following commands assumes that the environment variables for DI_HOME has been set to the DiveLine dataroot and PATH includes the location of the Spectre executable.
spectre scramble /cbases/EHR-DIV1.cbase --project MEDI
--output EHR-DIV1_scrambled.cbase --mode shuffle
-c "APR Group" keep -c "APR DRG Code - Desc" keep
The target of the scramble operation is the EHR-DIV1 cBase in the MEDI project. The results are written to the EHR-DIV1_scramble cBase. The mode is shuffle, rather than the default obscure. The columns "APR Group" and "APR DRG Code - Desc" are not shuffled.
The following command reduces the cBase to one row.
spectre scramble -m keep -n 1 sales.cbase -o 1row.cbase
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: