#ARRAY
Creates an array field (effective dated or start & stop), under the Data Defaults topic of Census Specifications, from any of the following:
A list of scalar dates and values
A set of temporary variables created using operators #START, #STOP and #VALUE
A list of compatible arrays
Syntax:
a #ARRAY b
where:
“a” can have the following values and "b" (enclosed by a set parenthesis) is: 1 a list of dates and values for a Start & Stop array in format: startdate1, enddate1, value1, startdate2, enddate2, value2, etc. 2 a list of dates and values for an Effective Dated array in format: effectivedate1, value1, effectivedate2, value2, etc. 11 three temporary variables created from #START, #STOP AND #VALUE for a Start & Stop array in format: (starting dates, stopping dates, values) 12 two temporary variables created from #START, #STOP AND #VALUE for an Effective Dated array in format: (effective dates, values) 21 a list of Start & Stop arrays 22 a list of Effective Dated arrays
Notes:
#ARRAY cannot be used with assignment.
The result of #ARRAY cannot be used with any other operator.
#ARRAY can only be used as the last line of the Data Default expression.
Example 1:
2 #ARRAY (
1/1/2000, 1,
1/1/2001, 2,
1/1/2002, 3,
1/1/2011, 10); Creates an effective dated array field.
Example 2:
1 #ARRAY
01/01/1990, 12/31/1990, 25000,
01/01/1991, 12/31/1991, 28000,
01/01/1992, 12/31/1992, 32000,
01/01/1993, 12/31/1993, 38000,
01/01/1994, 12/31/1994, 45000,
01/01/1995, 12/31/1995, 52000); Creates a start & stop array field.
Example 3:
Hours is an annual effective dated array where the effective date is 12/31 of the year. Here’s how to make a start & stop array:
StopDates:= #START hours & ; gets the effective dates (which will be the stop dates) Amount:= #VALUE hours & ; gets the corresponding hours StartDates:= (Begin #dateminus 1y) #dateplus 1d & ; uses the effective dates to compute the starting dates 11 #ARRAY (StartDates, StopDates, Amount) ; creates the array
Example 4:
Status is a number coded Start & Stop dated array where the start dates are one day after the previous status’s stop date. Here’s how to make a number coded Effective dated array:
EffDates:= #START Status & ; gets the start dates (which will be the effective dates) Codes:= #VALUE Status & ; gets the status codes 12 #ARRAY (EffDates,Codes) ; creates the array
Example 5:
Hours, Overtime_Hours and Vacation_Hours are three different Start & Stop dated arrays. Here’s how to make a single Start & Stop array from them:
21 #ARRAY (Hours, Overtime_Hours, Vacation_Hours) ; creates the array
Example 6:
EffDatedArray1 and EffDatedArray2 are two effective dated arrays. Here is how to make a single effective dated array from them:
22 #ARRAY (EffDatedArray1, EffDatedArray2) ; creates the array
Example 7:
2 #ARRAY ((#EFFDATE CASHBAL) #DATEPLUS 1Y,0) ; Creates an effective dated array field with one value. The effective date is one year after the most recent start date or most recent effective date of the array “cashbal” and the value is zero (0).
Example 8:
2 #ARRAY (12/31/2003,FROZBEN) Creates an effective dated array field with one value. The effective date 12/31/2003 and the value is the amount that the variable “FROZBEN” represents.
Example 9:
EffDates:= #START Status & ; gets the start dates (which will be the effective dates) Codes:= #VALUE Status & ; gets the status codes A:= 2 #ARRAY (1/1/2000,1) Not permitted. #ARRAY cannot be used with assignment.
Example 10:
24 + 2 #ARRAY (1/1/2000,1) Not permitted. The result of #ARRAY cannot be used with any other operator.