AREV to OI Conversion (OpenInsight Specific)
At 29 APR 1998 12:32:43PM Jason Schaefer wrote:
The conversion manual for AREV to OI, states that there is a program in the SYSOBJ table, in AREV, that converts dots to underscores. The program is Update Application. How can I find this program/application so that I can migrate my AREV tables to OI ?
At 29 APR 1998 01:05PM Jeff Blinn wrote:
The conversion manual for AREV to OI, states that there is a program in the SYSOBJ table, in AREV, that converts dots to underscores. The program is Update Application. How can I find this program/application so that I can migrate my AREV tables to OI ?
You need to log into ARev as the 'INSTALL' user, and choose upgrade application, user tables, etc. - you'll see instruction screens at that point. If I remember correctly, you may need to attach the volumes/tables that you want to update. The utility will change the file and field names - converting '.' to '_'
At 29 APR 1998 03:03PM Kurt Baker wrote:
Jason,
Here is a program that converts dots to underscores as well as doing some other clean up - this program is written for AR3.x - if you are in 2.x or below I have a slightly different program - email me at [email protected] - if you have any ???s -
Note: I pasted the program in the html document - hopefully it will wrap accordingly. If this ends up all mangled - If you leave me your email address I will email it to you.
Kurt
Declare Subroutine Msg, FSMSG, Unassigned
* This routine will assist in migrating Advanced Revelation files and
* dictionaries so they can be used with OpenInsight. Specifically, this
* program will:
*
* a) Rename the file by converting any periods (".") with an underscore
* b) Rename all dictionary fields by converting periods to underscores
* c) Take off all indexes on the file and creates a record (indexes)
* that lists the indexes that were on the file; so they can be reapplied
* within OpenInsight
* d) Adds data typing to each dictionary field
* e) Cleans out any dictionary field that may have information from older
* versions of Advanced Revelation and/or RevG.
*
* Just as significant is what this program does not do. This program does
* not adjust the formulas of symbolic fields. It does not attempt to
* adjust the formulas, because a period character may have multiple meanings
* For example, if the formula is @ANS={QTY} * {UNIT.PRICE} - it is
* obvious that {UNIT.PRICE} should be converted to {UNIT_PRICE}. However,
* if the formula was @ANS={UNIT_PRICE} * .08 - it is obvious that the
* period is a decimal and should remain.
*
* When dealing with the formulas of calculated fields, we recommend that
* you examine each formula to determine the appropriate action. There
* are tools you can use to identify these calculated fields. If you issue
* the command:
*
* SELECT DICT.YOUR_FILE WITH FORMULA CONTAINING '.' then
* DICT YOUR_FILE
*
* The system will provide you a browse list of all symbolic fields that
* have periods in them, you can then modify the formula in the DICT window.
* This technique will save you time in examining your fomulas.
*
* Please run this program only on a backup version of your file until
* you become familiar with the effects this program will have upon your
* files. The most important effect can be on your *existing* Arev
* application. Remember, this routine will change the file and field names,
* therefore, these changes will effect your existing Arev system. (e.g. if
* you have a file that is called MY.FILE and now it is called MY_FILE, your
* Arev application will still look for MY.FILE, and you will get a file not
* found error). You should only run this routine on files that will
* be used only by OpenInsight, or if you plan on making the appropriate
* changes to your Arev application.
*
* Please be aware that this program assumes you are running in Advanced
* Revelation 2.12 or below. If you are running a previous version of
* Advanced Revelation, please run the program 'CONVERT_FROM_3PLUS'
*
* Revelation has provided the source code to this routine to allow you
* to customize the behavior of this program. The most common behavior
* you may want to change is the character that the program will use to
* replace the period ("."). This program converts periods to underscores
* ("_"). To change the character modify the following line:
TransChar=_'
*
$Insert include,logical
$Insert include,dict.equates
Equ No$ To 0
Equ Yes$ To 1
Equ Null$ To
Equ Token_All$ To 'ALL' Equ Token_Xref$ To '.XREF' Indexes=' Msg("Please enter the file name to convert",'RIC',FILE,
)* Make sure the file is available
Open FILE to FileVar Else
FSMSG()StopEnd
Convertedfile=FILE
* Only perform a rename of the file, if necessary.
if index(FILE,'.',1) then
convert '.' to transChar in convertedfilesentence=renamefile ':FILE:' ':convertedfileperform sentenceend
* Take off all indexing; store index definitions in the variable indexes
open '!':convertedfile to indexvar then
read indexes from indexvar,'*indexes' else nullend
WORK:
* Let's start working on the dictionary
DictFileName=DICT.':ConvertedFile
Open DictFileName To DictHandle Else
FSMSG()StopEnd
* The dictionary is open, lets analyze each field
Done=No$
List=Null$
Select DictHandle
Loop
Readnext Key ElseDone=Yes$EndUntil DoneNewKey=KeyIf Key 1, 1 # '%' And Key 1, 1 # '@' ThenRead Record From DictHandle, Key ThenRemove=No$
First check to see if the field has any indexesBegin CaseCase RecordList=KeyRemove=Yes$
Case RecordRemove=Yes$
Case RecordRemove=Yes$
End Case
If an index was on null out the index information, SI.MFS will
take care of the !FILE.If Remove ThenMsg( 'B119', Null$, Image, Key )Record=Null$Record=Null$Record=Null$Record=Null$Record=Null$End
This section adds data types.Validation=RecordBegin CaseCase index(Record,'$',1)Datatype=DOLLARS"Case Validation=(D)'Datatype=DATE"Case Validation=(MT)'Datatype=TIME"Case Validation=(B)'Datatype=BOOLEAN"Case Validation1,3=(MD'Datatype=INTEGER"Case Validation=(DT)'Datatype=TIMEDATE"Case 1Length=RecordIf Length thenDatatype=VARCHAR(":Length:")"End ElseDatatype=VARCHAR(10)"EndEnd CaseRecord=DatatypeRecord=Datatype
This section checks multivalue definitions, if it used the old
format (e.g. M1.1) it will convert it to the proper 'M'Record=record1,1
This section clears out older dictionary informationFor I=31 to 54Record[i]='Next IConvert '.' to Transchar in NewKeyWrite Record To DictHandle, NewKey ThenIf Key NE Newkey ThenDelete DictHandle, Key Else NullEndMsg( Null$, 'DB', Image, Null$ )EndEndEndRepeat
ClearSelect
*
* Delete ".Xref" fields.
*
Pos=1
Loop
Key=List
While Len( Key )
Key := Token_Xref$Delete DictHandle, Key ElseNullEndPos += 1Repeat
* Control Records - DICT.MFS will rebuild %fields and %protect.spec% * The indexes is a record created by this routine that documents the * indexes that were on this file. If Indexes then Write indexes to DictHandle,'indexes%%' else null
End
Delete DictHandle,'%FIELDS%' Else Null
Delete DictHandle,'%PROTECT.SPEC%' Else Null