TAM Functions

This document discusses the use of functions that were not created by FoxPro but were specifically installed for TAM. For each function, a table is given that contains the purpose of the function, the syntax for using it, what is returned, parameters to use, additional remarks if applicable, and an example of how it could be used.

Functions included in this section are listed below. Click a link to jump to that function.

CODEDESCLOOKUP( )
CDLU( )

D8TO()

EIGHTTOD( )

MOCHR( )

MOVAL( )

SIXTOD( )

CODEDESCLOOKUP( ) or CDLU( )

Purpose Returns the name or description for a given code in TAM. It can also return address, phone and other information from the client screen for a given client.
Syntax CODEDESCLOOKUP(<expC1>,<expC2>)

CDLU(<expC1>,<expC2>)

Returns Character
Parameters <expC1> Specifies the type of lookup to be preformed. The character expression must be one of the options listed below. Quote marks MUST surround the lookup type.

<expC2> The code to lookup. This character expression may be a field name or a string in quotes.

Lookup Type

Lookup Code

Returns

"ACCOUNT-N" Account + sub-account The account name
"ACTION-N" Action code The description
"AGCYCODE-N" Company code + agency code The company’s code for the agency
"AGCY-N" Agency code The agency name
"ANYCO-N" Company code Company name
"ATTCUSTOM" Attachment Sequence Number The entire custom field from ATTACHEX.DBF
"ATYPES-N" Account type The description
"BCO-N" Company code Company name
"BILL-N" Bill type The description
"BRCH-N" Agency code + Branch code The branch name
"BTYPE-N" Broker type code
1
2
The description
Regular Broker
Excess/Surplus Lines
"CLAIMC-N" Coverage code The description
"CLIENT" Key + Rec Client number & client name
"CLIENT-A-ATTN" Key + Rec The attention line
"CLIENT-A-CFLD" Key + Rec The entire ‘c’ field from INS.DBF
"CLIENT-A-CITY" Key + Rec City
"CLIENT-A-CSZ" Key + Rec City, State & Zip code. Formatted with extra spaces removed
"CLIENT-A-HDG" Key + Rec Heading
"CLIENT-A-NOTE" Key + Rec Note field
"CLIENT-A-PAYAMT" Key + Rec Amount of last payment . For Customers only.
"CLIENT-A-PAYDATE" Key + Rec Date of last payment . For Customers only.
"CLIENT-A-PAYMODE" Key + Rec Payment mode. For Companies only.
"CLIENT-A-PHB" Key + Rec Business phone #
"CLIENT-A-PHF" Key + Rec Fax #
"CLIENT-A-PHR" Key + Rec Residence phone #
"CLIENT-A-STATE" Key + Rec 2 character state or province code
"CLIENT-A-STREET" Key + Rec Street address
"CLIENT-A-STREET2" Key + Rec Second line of address. UK only.
"CLIENT-A-ZIP" Key + Rec Zip code / Postal code
"CLIENT-N" Key + Rec Client name only
"CLNT_TYPE" Key (Client type)
C
B
E
F
L
P
V
Y
Type of clients
Customers
Brokers
Employees
Finance Companies
Lienholders
Producers
Vendors
Companies
"CO-N" Company code Company name
"CSR-N" CSR code CSR’s name
"CUST-CODE-N" Customer code The description
"DEPT-N" Department code Department name
"DOCTYPE"
"DOCTYPE-N"
Doc type code 2-3 character abbreviation
The description
"GROUPS-N" Account group code The group name
"ICO-N" Company code Company name
"INCLASS-N" Class code The description
"JOURNAL-N" Journal number Journal name
"MCO-N" Company code Company name
"MNTH-N" Two character month #
01
02
03
04
05
06
07
08
09
10
11
12
Month Name (Table B)
January
February
March
April
May
June
July
August
September
October
November
December
"OP_ID-N" Operator code Operator’s name
"PAYPLAN-N" Pay plan (a.k.a. pay mode) The description
"PC-N" PC code – Line of Business
P
C
The description
Personal Insurance
Commercial Insurance
"PCODE-N" Prospect code The description
"PLAN-N" Marketing plan code The description
"PR-N" Producer code Producer’s name
"PROSBROK-N" Prospect broker code The broker name
"PROSCO-N" Prospect company code Company name
"PRUSER1-N" Prospect user field 1 code The description
"PRUSER2-N" Prospect user field 2 code The description
"PRUSER3-N" Prospect user field 3 code The description
"RACE-N" Race code The description
"SICCODE-N" SIC code The description
"STATE-N" State code State name
"STATUS-N" Policy status code The description
"TERR-N" Territory code Territory name
"TFCODE-N" Activity code The description
"TIME-N" Follow-up time code The time
"TRANS-N" Transaction code The description
"TYPEGROUP-N" Policy type group The description
"TYPE-N" Policy type code The description
"WHO-N" Who code Name of who to follow up
"YYMM"
"YYMMA"
"YYMMN"

"YYMMAN"
Accounting month Month abbreviated and year - Jan92
Month abbreviated, space & year - Jan 92
Full month name, space & year - January 92
Full month name, space & year with century – January 1992
Remarks On most lookups, the ’-N’ on the lookup type causes only the name or description to be returned. If the ‘-N’ is omitted, both the code and the name/description are returned.

In the "CLIENT" type lookups, a key of "P" returns Prospect information, a key of "p" returns Producer information. Other client keys work as defined. The client code may be substituted for "Key" in the following syntax: the letter code must be in upper case (except for producer) and in quotes, e.g., "C" for customer, "P" for prospect, "p" for Producer, etc. When working from the policy or transact databases for instance, Left(pol_idx,7) may be used to represent the customer code (rec in the lookup codes). Also be aware that the customer code or rec is sometimes named differently in the selections and could be identified as Rec or Customer or Cust, etc. If you use key as "Y", you need to use a company code as rec and if use key as "p", you need to use a producer code as rec.

Examples Suggestions for use of "C" field:
Left(CODEDESCLOOKUP("CLIENT-A-CFLD","C"+rec), 2) returns CSR code
Substr(CODEDESCLOOKUP("CLIENT-A-CFLD","C"+rec),209,3) returns account producer code
Substr(CDLU("CLIENT-A-CFLD","p"+pr),131,11) returns Producer’s Social Security number
Substr(CDLU("CLIENT-A-CFLD","p"+pr),142,10) returns Producer’s Tax code

Other Client Codes and offsets in the ‘c’ field in INS.DBF may be used for specific items contained in that field.

D8TO()

Purpose

Converts a TAM character date into a date expression. This is used for TAM dates that are formatted YYYYMMDD.

Syntax

D8TOD(<expC>)

Returns

Date

Parameters

<expC> Specifies a character date expression with format YYYYMMDD to be converted to a date expression.

Remarks

This function is the only function available to convert the YYYYMMDD into a date data type.

Examples

D8TOD(date) if date is ‘20030625’, it returns 6/25/2003 as a date type.

D8TOD(‘19991203’) returns 12/3/1999 as a date type.

EIGHTTOD( )

Purpose Converts a TAM character date into a date expression. This is used for TAM dates that are formatted MM/DD/YY.
Syntax EIGHTTOD(<expC>)
Returns Date
Parameters <expC> Specifies a character date expression with format MM/DD/YY to be converted to a date expression.
Remarks This function should be used instead of CTOD( ), because it handles TAM’s Y2K solution.
Examples EIGHTTOD(edate) if edate is ‘03/25/99’, it returns 3/25/1999 as a date type.

EIGHTTOD(‘12/03/95’) returns 12/3/1995 as a date type.

MOCHR( )

Purpose Converts a numeric expression into a TAM character accounting month.
Syntax MOCHR(<expN>)
Returns Character
Parameters <expN> Specifies a numeric expression to be converted into a TAM character accounting month. The last two digits of the numeric expression correspond to the month number. The first two or three digits are the number of years since 1900.
Remarks This function can be used in conjunction with MOVAL( ) when adding or subtracting months from the accounting month.
Examples MOCHR(9903) returns ‘9903’.

MOCHR(MOVAL(month)+iif(right(month,2)=’12’),89,1)) if month is ‘9812’, it returns ‘9901’.

MOVAL( )

Purpose Converts a TAM character accounting month into a numeric expression.
Syntax MOVAL(<expC>)
Returns Numeric
Parameters <expC> Specifies a character accounting month with format YYMM to be converted to a numeric expression.
Remarks This function should be used to add or subtract months from the accounting month and can be used in conjunction with MOCHR( ).
Examples MOVAL(month) if month is ‘9903’, it returns 9903.

MOCHR(MOVAL(month)+iif(right(month,2)=’12’),89,1)) if month is ‘9812’, it returns ‘9901’.

SIXTOD( )

Purpose Converts a TAM character date into a date expression. This is used for TAM dates that are formatted YYMMDD.
Syntax SIXTOD(<expC>)
Returns Date
Parameters <expC> Specifies a character date expression with format YYMMDD to be converted to a date expression.
Remarks This function should be used instead of CTOD( ), because it handles TAM’s Y2K solution.
Examples SIXTOD(kdate) if kdate is ‘990325’, it returns 3/25/1999 as a date type.

SIXTOD(‘970430’) returns 4/30/1997 as a date type.