Home > Databases > Data Scripts

Data Scripts

The Data Scripts command allows you to save a set of database commands together and run them as one process.

Name is the description of the Data Script. This will be the name displayed in the Data Script Library. You are encouraged to use a name that will readily allow you or a colleague to understand the underlying nature of the Data Script.

Expressions to run lists the commands included in the Data Script in the order in which they will be run. The first command in the script must be Open Database or New Database. The database opened or created in this step will be used as the current database for all subsequent commands, until the next Open Database or New Database command.

To add a command to the bottom of the Data Script click the Add button, select the type of command you wish to add, and enter the parameters required for that command. To insert a command into the middle of the Data Script, select a row in Expressions to run, click the arrow next to the Add button, and select Insert Below or Insert Above. The commands available for inclusion in a Data Script are listed below.

To change the parameters for a command, double-click the command in Expressions to run, or select a command and click the Edit button.

To remove commands from the Data Script, select the commands you want to remove and click Omit. To select multiple commands, hold the Ctrl key down and click on each item you want to remove.

To change the execution order of commands, click the Re-order button and enter revised values in the Order column.

The Run button executes all commands in the script in the specified order. After the script completes processing, an execution summary with one line per command is displayed. Click Details to see more information. To execute the script with a pause in between each command, click the arrow next to the Run button, and then click Step through. After the first command completes processing, an execution summary for that command is displayed. Click Next to continue running the script with a pause after each command, or click Run all to run the remaining commands without a pause, or click Cancel to stop processing.

Open Database

The Open Database command allows you to select the current database used during script execution. The selected database is the current database until the script encounters the next Open Database or New Database.

Click a Database name to select it as the current database used by the Data Script.

Click the Properties button to display information about the selected database. For more information, see Database Properties.

Also see Open Database.

New Database

The New Database command allows you to create a new database. The newly created database is the current database until the script encounters the next Open Database or New Database.

The Database name may contain letters, numbers, most other characters, and spaces. ProVal will automatically assign a “.SF” extension to all database file names.

Existing databases are listed on the screen to assist you in picking a unique name for your new database.

You may enter descriptive Notes for the new database. For more information, see Database Properties.

Also see New Database.

Append Data

The Append Data command copies a ProVal database onto the end of the script’s current database. If this is not the current database that you want to use, insert an Open Database or New Database command above the Append Data command. The appended data is added as new records following those that already exist in the current database.

Select the File to append to the current database from the list of databases in the current Client. The list also includes any databases created by New Database commands in the Data Script.

Select the Fields to append from the list of database fields. An asterisk (*) is shown to the left of fields that are currently defined in the file to append. The list includes fields that do not currently exist in the file to append. This allows you to select fields added to the database in a prior step of the script.

Enter a Selection Expression (or click the  button to recall an expression previously defined and stored in the Selection Expression library) to restrict the appended records to a subset of the records in the file to append.

Also see Append Data.

Import Data

The Import Data command allows you to bring data records from an Excel file into the script’s current database. If this is not the database that you want to use, insert an Open Database or New Database command above the Import Data command.

Enter the name of the Excel File to Import or click the Browse button to navigate to the desired Excel file. Then specify the Worksheet containing the data.

Enter the Start import at row number (rows before this one will be ignored) and whether the Start row contains field names.

Select the Record Layout that describes the format of the import file or click the  button to create a new library entry.

Enter a Selection Expression (or click the  button to recall an expression previously defined and stored in the Selection Expression library)to restrict the import to a subset of the records in the Excel worksheet.

Choose Append records to the end of the database to add the newly imported records onto the end of the script’s current database. Select Replace the database to replace the script’s current database records with only the newly imported records.

Also see Import Data.

Find Duplicates

The Find Duplicates command enables you to determine whether each record in the script’s current database can be uniquely identified by values in the "key" field(s) you specify. If you want to screen a different database for duplicate records, insert an Open Database or New Database command above the Find Duplicates command.

Select one or more Key field(s) which will uniquely identify database records. Check Match case in key(s) if you want upper and lower case letters in character keys to be considered distinct values.

Enter a Selection Expression (or click the  button to recall an expression previously defined and stored in the Selection Expression library) to restrict the check for duplicate keys to a subset of the database.

Click on either row of Result Fields if you want to change the name of fields created during the Find Duplicates process. These fields help you evaluate the results of the process.

Check Log duplicates as errors if you want ProVal to append information about duplicate records to the database’s error log.

Click Sort Records to specify how fields affect the order in which duplicate records are assigned a value for DupID.

Also see Find Duplicates.

Resolve Duplicates

The Resolve Duplicates command allows you to process a database with multiple records per person into a database containing one record for each person.

Select the Resolve Duplicates entry that describes how you want to process duplicate records or click the  button to create a new library entry. The Input Database is the script’s current database. If this is not the database you want to use, insert an Open Database or New Database command above the Resolve Duplicates command. (The Data Script will ignore the Input Database saved with the Resolve Duplicates entry if it differs from the script’s current database.) The Output Database is specified by the Resolve Duplicates entry.

For more information, see Resolve Duplicates.

Merge Data

The Merge Data command merges field information of two ProVal databases, updating the records of a target database file with the data found in corresponding records of a source database file.

Select the Merge Data entry that describes how to merge records into the script’s current database or click the  button to create a new library entry. The Target Database is the script’s current database. If this is not the database you want to use, insert an open or new database command above the Merge Data command. (The Data Script will ignore the Target Database saved with the Merge Data entry if it differs from the script’s current database.) The Source Database is specified by the Merge Data entry.

For more information, see Merge Data.

Expression Sets

The Expression Sets command allows you to run several Define Field by Expression or Define Field by Table library entries as one process.

Select the Expression Set entry that has the collection of Define Field by Expression and Define Field by Table entries you want to run or click the  button to create a new library entry. The expressions will be applied to the current database last opened or created by the script. If this is not the database you want to use, insert an open or new database command above the Expression Set command.

For more information, see Expression Sets.

Screen Data

Select the desired Screen Data entry or click the  button to create a new library entry. The Current Year data to be screened is the current database last opened or created by the script. (The Data Script will ignore the Current Year Database saved with the Screen Data entry if it differs from the script’s current database.)

For more information, see Screen Data.

Data Questions

Select the Data Questions entry that describes the data you wish to export to an Excel workbook. Please ensure that Personally Identifiable Information (PII) is transmitted securely. Any transmission of PII is your responsibility.

Enter the name of the Output file or click the Browse button to navigate to the desired Excel file.

For more information, see Data Questions.

Delete Records

Enter a Selection Expression (or click the  button to recall an expression previously defined and stored in the Selection Expression library). The expression selects the records you wish to keep or delete from the current database last opened or created by the data script.

Select the Delete selected records option if your Selection Expression selects records you wish to delete from the current database.

Select the Keep only selected records option if your Selection Expression selects records you wish to keep in the current database.

Check Pack file after deleting records if you want to eliminate unused space created by deleting records.

For more information, see Delete Records.