Difference between revisions of "Reading Spectrum Data Change Records"
>Johno (→Accessing the SD file in AskPlus/Visimage) |
>Johno (→Sample AskPlus Query) |
||
Line 78: | Line 78: | ||
===Sample AskPlus Query=== | ===Sample AskPlus Query=== | ||
− | + | Once the extract job has been run, and the DC-FILE has been created, the following will find all changes made to the APR field. | |
/ASKPLUS/askplus | /ASKPLUS/askplus |
Revision as of 18:24, 17 January 2014
Contents
Reading Spectrum Data Change Records
Overview
The SH-HISTORY and LN-HISTORY datasets (HISTRY database) contain data change records that are stored in a binary format. AskPlus provides two special functions designed to read and interpret these records. To use these functions the datachng.sl (or .so Itanium) must be installed in the /ASKPLUS directory. An AskPlus job is also available that extracts specific data change records based on their TYPE and ENTRY-DATE.
Installing the Data Change Files
The data change library file and the extract job are provided in a single gz download. Choose the pa32 file for PARISC and the it64 file for Itanium. Transfer the gz file to the /ASKPLUS directory on UNIX and execute the command.
- gunzip datachange_pa32.gz
or
- gunzip datachange_it64.gz
The library file (datachng.sl or datachng.so) must remain in the /ASKPLUS directory. The extract job (ask_datachange_job) should be moved to a location with access to the Spectrum databases and may be renamed. The contents of the job may also be copied into UC4 a script.
Editing the Job Parameters
The job contains a prompts section to customize the extract. You may specify a date range, specific record types and the name of the final SD file that is created. You can also specify whether or not to include share history and/or loan history.
*** Start of Prompts Section *** * * START-DATE is the range start-date (YYYYMMDD format) * END-DATE is the range end-date (YYYYMMDD format) * * The range maximum is 100 days from the start-date, regardless of end-date. *
Enter the date range here:
newreg #START-DATE:I2 = 20140101 newreg #END-DATE:I2 = 20140131
* * INCLUDE-SH-HIST is the flag to include SH-HISTORY ("Y" or "N") * INCLUDE-LN-HIST is the flag to include LN-HISTORY ("Y" or "N") *
By default, the extract will include both SH-HISTORY and LN-HISTORY.
newreg #INCLUDE-SH-HIST:X1 = "Y" newreg #INCLUDE-LN-HIST:X1 = "Y"
* * VALID-TYPES is the list of the datachange HISTORY.TYPE values to look for. *
Enter all valid types in a list. Each line (except the last) must be terminated by a cat
newreg #VALID-TYPES:x300 load #VALID-TYPES = "200,201,202,203,204,205,206,210," cat "300,303,304,305,306,307,308,309,313,314,315,396,399," cat "400,401,403,405,410,430,440,497," cat "500,506,510,550,551,552,560,570," cat "600,700,800,850,900,910,920,921,930,940,950,960,970"
* * OUTPUT-FILE is the fully qualified file name of the final Self Describing file . *
Enter a fully qualified file name for the job to create.
newreg #OUTPUT-FILE:X100 = “/ASKPLUS/visimage/DC-FILE”; *** End of Prompts section ***
Accessing the SD file in AskPlus/Visimage
The SD file may be used in AskPlus with an OPEN command or in Visimage using the View > Host Databases window.
The file contains one record for each item with a recorded data change value. These data change records have a DC-TYPE = "Change" and include both a before (DC-BEFORE-VALUE) and an after (DC-AFTER-VALUE) value for the item. The file also contains constant records (DC-TYPE = "Const") that, in some cases, help to identify the record that was updated. Const records do not have an after value. The before and after values are stored as X50. Numeric values can be easily converted by AskPlus.
Each record contains ENTRY-DATE, ACCOUNT, SUFFIX, TELLER-INTL, COMMAND, SEQUENCE and many more fields that identify the data change. The specific data change records are as follows:
Actual Change Records:
DC-TYPE: = "Change" DC-ITEM-NAME: The name of the item (field) that was changed. - Array items are shown with the index, for example: ADDRESS-LINES(02) DC-ITEM-TYPE: The Eloquence data type. For example: I2, X30 DC-BEFORE-VALUE: The value of the item before the change. DC-AFTER-VALUE: The value of the item after the change.
Constant (Lookup) Records:
DC-TYPE: = "Const" DC-ITEM-NAME: The name of the lookup (field) to help identify the change. DC-ITEM-TYPE: The Eloquence data type. For example: I2, X30 DC-BEFORE-VALUE: The value of the lookup item. DC-AFTER-VALUE: Blank.
Sample AskPlus Query
Once the extract job has been run, and the DC-FILE has been created, the following will find all changes made to the APR field.
/ASKPLUS/askplus open /ASKPLUS/visimage/DC-FILE; find primary=DC-FILE; outsel=(@) DC-TYPE="Change" and DC-ITEM-NAME = "APR"