/* This file is for importing ACT! data into OmniFile or CCv2 */
/* This REXX program expects OMNIFILE or CCv2 to be the host environment */
/* If you are attempting to change this file, you will normally only need to change the commands in the CHANGE_REC subroutine and the user variables. */
/*********** USER VARIABLES **************/
/* If useMgrOwner is set to 1 the owner and manager fields of the ACT! records will be stored as a note */
/* By default, we set this variable to 0 to indicate that these fields will not be converted */
/* If separateBusinesses is set to 1, then ACT records with a business name but no contact name will be */
/* added to the Business database, as opposed to the Individual database */
useMgrOwner = 0
separateBusinesses=1
/******************************************/
/* Define field numbers */
fileType=GetTypeGivenName("File")
fileTypeType=GetTypeGivenName("File Type")
actionType=GetTypeGivenName("Action")
actionTypeType=GetTypeGivenName("Action Type")
codeTypeType=GetTypeGivenName("Code Type")
/* these are field numbers for individuals */
prefixFieldNum = 2
middleFieldNum= 4
suffixFieldNum = 6
IaddressFieldNum = 12
IphoneFieldNum = 13
IcodeFieldNum = 14
InotesFieldNum = 15
/* these are field numbers for businesses */
BaddressFieldNum = 4
BphoneFieldNum = 5
BcodeFieldNum = 6
BnotesFieldNum = 7
addressTypeFieldNum = 1
addressAddressFieldNum = 3
addressCityFieldNum = 4
addressStateFieldNum = 5
addressZipFieldNum = 6
addressNoteFieldNum = 8
phoneTypeFieldNum = 1
phonePhoneFieldNum = 2
phoneNoteFieldNum = 3
fileTypeFieldNum = 1
fileNameFieldNum = 2
codeTypeField = 1
actionTypeField = 1
actionCompletedField = 2
actionDateField = 3
actionTimeField = 4
actionFreqField = 5
actionSummaryField = 7
/* MAIN SUBROUTINE */
szEnvironment = address()
IF ((szEnvironment <> "Omnifile") & (szEnvironment <> "Contacts")) THEN DO
SAY "This rexx file can only be run by Omnifile or Contact Connection, not directly."
RETURN 1
END
/* Load the Rexx variables based on the arguments the user passed in. */
/* FileIn1 has the simple dumped data; FileIn2 has the multiline data like notes */
FileIn1 = ARG(1)
FileIn2 = ARG(2)
/* Make sure the required arguments were given. */
IF FileIn1 = "" THEN DO
SAY "The following arguments are expected: FILEIN1 FILEIN2"
SAY " FILEIN1 is required."
RETURN 1
END
IF FileIn2="" THEN DO
SAY "The notes and activities file was not provided"
END
/* Set the default delimiter to ',' */
Delimiter = ','
SetDefaultDelimiter(Delimiter)
/* Set the Header Line and pass it to OmniFile in order to initialize the import. */
/* Literals in REXX have a limit of 250 chars; but can concatenate to make a bigger one */