expressions: Fix dependency on current year in tests.
[pspp] / tests / language / expressions / evaluate.at
1 m4_define([CHECK_EXPR_EVAL],
2   [AT_SETUP([expressions - $1])
3    AT_DATA([evaluate.sps],
4      [set mxwarn 1000.
5 set mxerr 1000.
6 set epoch 1940.
7 m4_foreach([check], [m4_shift($@)],
8                  [DEBUG EVALUATE NOOPT m4_argn(4, check)/[]m4_car(check).
9 DEBUG EVALUATE m4_argn(4, check)/[]m4_car(check).
10 ])])
11    AT_CAPTURE_FILE([evaluate.sps])
12    m4_pushdef([i], [3])
13    AT_CHECK([pspp --testing-mode --error-file=- --no-output evaluate.sps], 
14      [m4_if(m4_bregexp([m4_foreach([check], [m4_shift($@)], [m4_argn(3, check)])], [error:]), [-1], [0], [1])], 
15      [stdout])
16    # Use sed to transform "file:line.column:" into plain "file:line:",
17    # because column numbers change between opt and noopt versions.
18    AT_CHECK([[sed 's/\(evaluate.sps:[0-9]\{1,\}\)\.[0-9]\{1,\}:/\1:/' stdout]],
19      [0],
20      [m4_foreach([check], [m4_shift($@)],
21         [m4_define([i], m4_incr(i))dnl
22 m4_if(m4_argn(3, check), [], [], [evaluate.sps:[]i[]: m4_argn(3, check)
23 ])dnl
24 m4_argn(2, check)
25 m4_define([i], m4_incr(i))dnl
26 m4_if(m4_argn(3, check), [], [], [evaluate.sps:[]i[]: m4_argn(3, check)
27 ])dnl
28 m4_argn(2, check)
29 ])], [])
30    m4_popdef([i])
31    AT_CLEANUP])
32
33 AT_BANNER([expressions])
34
35 CHECK_EXPR_EVAL([numeric syntax],
36   [[1e2], [100.00]],
37   [[1e+2], [100.00]],
38   [[1e-2], [0.01]],
39   [[1e-99], [0.00]])
40
41 CHECK_EXPR_EVAL([coercion to/from Boolean],
42   [[0 AND 1], [false]],
43   [[$true AND 1], [true]],
44   [[1 OR $false], [true]],
45   [[1 OR $sysmis], [true]],
46   [[2 OR $sysmis], [sysmis],
47    [error: DEBUG EVALUATE: An operand of the logical disjunction (`OR') operator was found to have a value other than 0 (false), 1 (true), or the system-missing value.  The result was forced to 0.]],
48   [[2 AND $sysmis], [false],
49    [error: DEBUG EVALUATE: An operand of the logical conjunction (`AND') operator was found to have a value other than 0 (false), 1 (true), or the system-missing value.  The result was forced to 0.]],
50   [['string' AND $sysmis], [error],
51    [error: DEBUG EVALUATE: Type mismatch while applying logical conjunction (`AND') operator: cannot convert string to boolean.]],
52   [[0 AND $sysmis], [false]],
53   [[(1>2) + 1], [1.00]],
54   [[$true + $false], [1.00]])
55
56 CHECK_EXPR_EVAL([addition and subtraction],
57   [[1 + 2], [3.00]],
58   [[1 + $true], [2.00]],
59   [[$sysmis + 1], [sysmis]],
60   [[7676 + $sysmis], [sysmis]],
61   [[('foo') + 5], [error],
62    [error: DEBUG EVALUATE: Type mismatch while applying addition (`+') operator: cannot convert string to number.]],
63   dnl Arithmetic concatenation requires CONCAT:
64   [[('foo') + ('bar')], [error],
65    [error: DEBUG EVALUATE: Type mismatch while applying addition (`+') operator: cannot convert string to number.]],
66   dnl Lexical concatenation succeeds:
67   [['foo' + 'bar'], ["foobar"]],
68   [[1 +3 - 2 +4 -5], [1.00]],
69   [[1 - $true], [0.00]],
70   [[$true - 4/3], [-0.33]],
71   [['string' - 1e10], [error],
72    [error: DEBUG EVALUATE: Type mismatch while applying subtraction (`-') operator: cannot convert string to number.]],
73   [[9.5 - ''], [error],
74    [error: DEBUG EVALUATE: Type mismatch while applying subtraction (`-') operator: cannot convert string to number.]],
75   [[1 - 2], [-1.00]],
76   [[52 -23], [29.00]])
77
78 CHECK_EXPR_EVAL([multiplication and division],
79   [[5 * 10], [50.00]],
80   [[10 * $true], [10.00]],
81   [[$true * 5], [5.00]],
82   [[1.5 * $true], [1.50]],
83   [[5 * $sysmis], [sysmis]],
84   [[$sysmis * 15], [sysmis]],
85   [[2 * 5 / 10], [1.00]],
86   [[1 / 2], [0.50]],
87   [[2 / 5], [0.40]],
88   [[12 / 3 / 2], [2.00]])
89
90 CHECK_EXPR_EVAL([exponentiation],
91   [[2**8], [256.00]],
92   [[(2**3)**4], [4096.00]],
93   [[2**3**4], [4096.00],
94    [warning: DEBUG EVALUATE: The exponentiation operator (`**') is left-associative, even though right-associative semantics are more useful.  That is, `a**b**c' equals `(a**b)**c', not as `a**(b**c)'.  To disable this warning, insert parentheses.]])
95
96 CHECK_EXPR_EVAL([unary minus],
97   [[2+-3], [-1.00]],
98   [[2*-3], [-6.00]],
99   [[-3**2], [-9.00]],
100   [[(-3)**2], [9.00]],
101   [[2**-1], [0.50]],
102   [[0**0], [sysmis]],
103   [[0**-1], [sysmis]],
104   [[(-3)**1.5], [sysmis]])
105
106 CHECK_EXPR_EVAL([AND truth table],
107   [[$false AND $false], [false]],
108   [[$false AND $true], [false]],
109   [[$false AND $sysmis], [false]],
110   [[$true AND $false], [false]],
111   [[$true AND $true], [true]],
112   [[$true AND $sysmis], [sysmis]],
113   [[$sysmis AND $false], [false]],
114   [[$sysmis AND $true], [sysmis]],
115   [[$sysmis AND $sysmis], [sysmis]],
116   [[$false & $false], [false]],
117   [[$false & $true], [false]],
118   [[$false & $sysmis], [false]],
119   [[$true & $false], [false]],
120   [[$true & $true], [true]],
121   [[$true & $sysmis], [sysmis]],
122   [[$sysmis & $false], [false]],
123   [[$sysmis & $true], [sysmis]],
124   [[$sysmis & $sysmis], [sysmis]])
125
126 CHECK_EXPR_EVAL([OR truth table],
127   [[$false OR $false], [false]],
128   [[$false OR $true], [true]],
129   [[$false OR $sysmis], [sysmis]],
130   [[$true OR $false], [true]],
131   [[$true OR $true], [true]],
132   [[$true OR $sysmis], [true]],
133   [[$sysmis OR $false], [sysmis]],
134   [[$sysmis OR $true], [true]],
135   [[$sysmis OR $sysmis], [sysmis]],
136   [[$false | $false], [false]],
137   [[$false | $true], [true]],
138   [[$false | $sysmis], [sysmis]],
139   [[$true | $false], [true]],
140   [[$true | $true], [true]],
141   [[$true | $sysmis], [true]],
142   [[$sysmis | $false], [sysmis]],
143   [[$sysmis | $true], [true]],
144   [[$sysmis | $sysmis], [sysmis]])
145
146 CHECK_EXPR_EVAL([NOT truth table],
147   [[not $false], [true]],
148   [[not 0], [true]],
149   [[not 2.5], [true],
150    [error: DEBUG EVALUATE: An operand of the logical negation (`NOT') operator was found to have a value other than 0 (false), 1 (true), or the system-missing value.  The result was forced to 0.]],
151   [[not $true], [false]],
152   [[not 1], [false]],
153   [[not $sysmis], [sysmis]],
154   [[~ $false], [true]],
155   [[~ 0], [true]],
156   [[~ 2.5], [true],
157    [error: DEBUG EVALUATE: An operand of the logical negation (`NOT') operator was found to have a value other than 0 (false), 1 (true), or the system-missing value.  The result was forced to 0.]],
158   [[~ $true], [false]],
159   [[~ 1], [false]],
160   [[~ $sysmis], [sysmis]])
161
162 CHECK_EXPR_EVAL([= <= <],
163   [[1 eq 1], [true]],
164   [[1 = 1], [true]],
165   [[1 eq 2], [false]],
166   [[2 = 3], [false]],
167   [[1 eq 'foobar'], [error],
168    [error: DEBUG EVALUATE: Type mismatch while applying numeric equality (`EQ') operator: cannot convert string to number.]],
169   [[5 eq 'foobar'], [error],
170    [error: DEBUG EVALUATE: Type mismatch while applying numeric equality (`EQ') operator: cannot convert string to number.]],
171   [['baz' = 10], [error],
172    [error: DEBUG EVALUATE: Type mismatch while applying string equality (`=') operator: cannot convert number to string.]],
173   [['quux' = 5.55], [error],
174    [error: DEBUG EVALUATE: Type mismatch while applying string equality (`=') operator: cannot convert number to string.]],
175   [['foobar' = 'foobar'], [true]],
176   [['quux' = 'bar'], [false]],
177   [['bar   ' = 'bar'], [true]],
178   [['asdf         ' = 'asdf  '], [true]],
179   [['asdfj   ' = 'asdf'], [false]],
180 dnl Check precedence:
181   [[1 + 2 = 3], [true]],
182   [[1 >= 2 = 2 ge 3], [false],
183    [warning: DEBUG EVALUATE: Chaining relational operators (e.g. `a < b < c') will not produce the mathematically expected result.  Use the AND logical operator to fix the problem (e.g. `a < b AND b < c').  If chaining is really intended, parentheses will disable this warning (e.g. `(a < b) < c'.)]],
184 dnl Mathematically true:
185   [[3 ne 2 ~= 1], [false],
186    [warning: DEBUG EVALUATE: Chaining relational operators (e.g. `a < b < c') will not produce the mathematically expected result.  Use the AND logical operator to fix the problem (e.g. `a < b AND b < c').  If chaining is really intended, parentheses will disable this warning (e.g. `(a < b) < c'.)]],
187   [[3 > 2 > 1], [false],
188    [warning: DEBUG EVALUATE: Chaining relational operators (e.g. `a < b < c') will not produce the mathematically expected result.  Use the AND logical operator to fix the problem (e.g. `a < b AND b < c').  If chaining is really intended, parentheses will disable this warning (e.g. `(a < b) < c'.)]],
189
190   [[1 <= 2], [true]],
191   [[2.5 <= 1.5], [false]],
192   [[1 le 2], [true]],
193   [[2 <= 2], [true]],
194   [[2 le 2], [true]],
195 dnl Make sure <= token can't be split:
196   [[2 < = 2], [error],
197    [error: DEBUG EVALUATE: Syntax error at `='.]],
198   [[1 <= 'foobar'], [error],
199    [error: DEBUG EVALUATE: Type mismatch while applying numeric less-than-or-equal-to (`<=') operator: cannot convert string to number.]],
200   [[5 <= 'foobar'], [error],
201    [error: DEBUG EVALUATE: Type mismatch while applying numeric less-than-or-equal-to (`<=') operator: cannot convert string to number.]],
202   [['baz' <= 10], [error],
203    [error: DEBUG EVALUATE: Type mismatch while applying string less-than-or-equal-to (`<=') operator: cannot convert number to string.]],
204   [['quux' <= 5.55], [error],
205    [error: DEBUG EVALUATE: Type mismatch while applying string less-than-or-equal-to (`<=') operator: cannot convert number to string.]],
206   [['0123' <= '0123'], [true]],
207   [['0123' <= '0124'], [true]],
208   [['0124' le '0123'], [false]],
209   [['0123  ' <= '0123'], [true]],
210   [['0123' le '0123  '], [true]],
211
212   [[1 < 2], [true]],
213   [[2.5 < 1.5], [false]],
214   [[3.5 lt 4], [true]],
215   [[4 lt 3.5], [false]],
216   [[1 lt 'foobar'], [error],
217    [error: DEBUG EVALUATE: Type mismatch while applying numeric less than (`<') operator: cannot convert string to number.]],
218   [[5 lt 'foobar'], [error],
219    [error: DEBUG EVALUATE: Type mismatch while applying numeric less than (`<') operator: cannot convert string to number.]],
220   [['baz' < 10], [error],
221    [error: DEBUG EVALUATE: Type mismatch while applying string less than (`<') operator: cannot convert number to string.]],
222   [['quux' < 5.55], [error],
223    [error: DEBUG EVALUATE: Type mismatch while applying string less than (`<') operator: cannot convert number to string.]],
224   [['0123' lt '0123'], [false]],
225   [['0123' < '0124'], [true]],
226   [['0124' lt '0123'], [false]],
227   [['0123  ' < '0123'], [false]],
228   [['0123' lt '0123  '], [false]])
229
230 CHECK_EXPR_EVAL([>= > <>],
231   [[1 >= 2], [false]],
232   [[2.5 >= 1.5], [true]],
233   [[1 ge 2], [false]],
234   [[2 >= 2], [true]],
235   [[2 ge 2], [true]],
236 dnl Make sure >= token can't be split:
237   [[2 > = 2], [error],
238    [error: DEBUG EVALUATE: Syntax error at `='.]],
239   [[1 >= 'foobar'], [error],
240    [error: DEBUG EVALUATE: Type mismatch while applying numeric greater-than-or-equal-to (`>=') operator: cannot convert string to number.]],
241   [[5 ge 'foobar'], [error],
242    [error: DEBUG EVALUATE: Type mismatch while applying numeric greater-than-or-equal-to (`>=') operator: cannot convert string to number.]],
243   [['baz' ge 10], [error],
244    [error: DEBUG EVALUATE: Type mismatch while applying string greater-than-or-equal-to (`>=') operator: cannot convert number to string.]],
245   [['quux' >= 5.55], [error],
246    [error: DEBUG EVALUATE: Type mismatch while applying string greater-than-or-equal-to (`>=') operator: cannot convert number to string.]],
247   [['0123' ge '0123'], [true]],
248   [['0123' >= '0124'], [false]],
249   [['0124' >= '0123'], [true]],
250   [['0123  ' ge '0123'], [true]],
251   [['0123' >= '0123  '], [true]],
252
253   [[1 > 2], [false]],
254   [[2.5 > 1.5], [true]],
255   [[3.5 gt 4], [false]],
256   [[4 gt 3.5], [true]],
257   [[1 gt 'foobar'], [error],
258    [error: DEBUG EVALUATE: Type mismatch while applying numeric greater than (`>') operator: cannot convert string to number.]],
259   [[5 gt 'foobar'], [error],
260    [error: DEBUG EVALUATE: Type mismatch while applying numeric greater than (`>') operator: cannot convert string to number.]],
261   [['baz' > 10], [error],
262    [error: DEBUG EVALUATE: Type mismatch while applying string greater than (`>') operator: cannot convert number to string.]],
263   [['quux' > 5.55], [error],
264    [error: DEBUG EVALUATE: Type mismatch while applying string greater than (`>') operator: cannot convert number to string.]],
265   [['0123' gt '0123'], [false]],
266   [['0123' > '0124'], [false]],
267   [['0124' gt '0123'], [true]],
268   [['0123  ' > '0123'], [false]],
269   [['0123' gt '0123  '], [false]],
270
271   [[1 ne 1], [false]],
272   [[1 ~= 1], [false]],
273   [[1 <> 2], [true]],
274   [[2 ne 3], [true]],
275   [[1 ~= 'foobar'], [error],
276    [error: DEBUG EVALUATE: Type mismatch while applying numeric inequality (`<>') operator: cannot convert string to number.]],
277   [[5 <> 'foobar'], [error],
278    [error: DEBUG EVALUATE: Type mismatch while applying numeric inequality (`<>') operator: cannot convert string to number.]],
279   [['baz' ne 10], [error],
280    [error: DEBUG EVALUATE: Type mismatch while applying string inequality (`<>') operator: cannot convert number to string.]],
281   [['quux' ~= 5.55], [error],
282    [error: DEBUG EVALUATE: Type mismatch while applying string inequality (`<>') operator: cannot convert number to string.]],
283   [['foobar' <> 'foobar'], [false]],
284   [['quux' ne 'bar'], [true]],
285   [['bar   ' <> 'bar'], [false]],
286   [['asdf         ' ~= 'asdf  '], [false]],
287   [['asdfj   ' ne 'asdf'], [true]],
288 dnl <> token can't be split:
289   [[1 < > 1], [error],
290    [error: DEBUG EVALUATE: Syntax error at `>'.]],
291 dnl # ~= token can't be split:
292   [[1 ~ = 1], [error],
293    [error: DEBUG EVALUATE: Syntax error at `~': expecting end of command.]])
294
295 CHECK_EXPR_EVAL([exp lg10 ln sqrt abs mod mod10 rnd trunc],
296   [[exp(10)], [22026.47]],
297   [[exp('x')], [error],
298    [error: DEBUG EVALUATE: Type mismatch invoking EXP(number) as exp(string).]],
299
300   [[lg10(500)], [2.70]],
301   [[lg10('x')], [error],
302    [error: DEBUG EVALUATE: Type mismatch invoking LG10(number) as lg10(string).]],
303
304   [[ln(10)], [2.30]],
305   [[ln('x')], [error],
306    [error: DEBUG EVALUATE: Type mismatch invoking LN(number) as ln(string).]],
307
308   [[sqrt(500)], [22.36]],
309   [[sqrt('x')], [error],
310    [error: DEBUG EVALUATE: Type mismatch invoking SQRT(number) as sqrt(string).]],
311
312   [[abs(-10.5)], [10.50]],
313   [[abs(-55.79)], [55.79]],
314   [[abs(22)], [22.00]],
315   [[abs(0)], [0.00]],
316
317   [[mod(55.5, 2)], [1.50]],
318   [[mod(-55.5, 2)], [-1.50]],
319   [[mod(55.5, -2)], [1.50]],
320   [[mod(-55.5, -2)], [-1.50]],
321   [[mod('a', 2)], [error],
322    [error: DEBUG EVALUATE: Type mismatch invoking MOD(number, number) as mod(string, number).]],
323   [[mod(2, 'a')], [error],
324    [error: DEBUG EVALUATE: Type mismatch invoking MOD(number, number) as mod(number, string).]],
325   [[mod('a', 'b')], [error],
326    [error: DEBUG EVALUATE: Type mismatch invoking MOD(number, number) as mod(string, string).]],
327
328   [[mod10(55.5)], [5.50]],
329   [[mod10(-55.5)], [-5.50]],
330   [[mod10('x')], [error],
331    [error: DEBUG EVALUATE: Type mismatch invoking MOD10(number) as mod10(string).]],
332
333   [[rnd(5.4)], [5.00]],
334   [[rnd(5.6)], [6.00]],
335   [[rnd(-5.4)], [-5.00]],
336   [[rnd(-5.6)], [-6.00]],
337   [[rnd('x')], [error],
338    [error: DEBUG EVALUATE: Type mismatch invoking RND(number) as rnd(string).]],
339
340   [[trunc(1.2)], [1.00]],
341   [[trunc(1.9)], [1.00]],
342   [[trunc(-1.2)], [-1.00]],
343   [[trunc(-1.9)], [-1.00]],
344   [[trunc('x')], [error],
345    [error: DEBUG EVALUATE: Type mismatch invoking TRUNC(number) as trunc(string).]])
346
347 CHECK_EXPR_EVAL([acos arsin artan cos sin tan],
348   [[acos(.5) / 3.14159 * 180], [60.00]],
349   [[arcos(.75) / 3.14159 * 180], [41.41]],
350   [[arcos(-.5) / 3.14159 * 180], [120.00]],
351   [[acos(-.75) / 3.14159 * 180], [138.59]],
352   [[acos(-1) / 3.14159 * 180], [180.00]],
353   [[arcos(1) / 3.14159 * 180], [0.00]],
354   [[acos(-1.01)], [sysmis]],
355   [[arcos(1.01)], [sysmis]],
356   [[acos('x')], [error],
357    [error: DEBUG EVALUATE: Type mismatch invoking ACOS(number) as acos(string).]],
358
359   [[arsin(.5) / 3.14159 * 180], [30.00]],
360   [[asin(.25) / 3.14159 * 180], [14.48]],
361   [[arsin(-.5) / 3.14159 * 180], [-30.00]],
362   [[asin(-.25) / 3.14159 * 180], [-14.48]],
363   [[arsin(-1.01)], [sysmis]],
364   [[asin(1.01)], [sysmis]],
365   [[arsin('x')], [error],
366    [error: DEBUG EVALUATE: Type mismatch invoking ARSIN(number) as arsin(string).]],
367
368   [[artan(1) / 3.14159 * 180], [45.00]],
369   [[atan(10) / 3.14159 * 180], [84.29]],
370   [[artan(-1) / 3.14159 * 180], [-45.00]],
371   [[atan(-10) / 3.14159 * 180], [-84.29]],
372   [[artan('x')], [error],
373    [error: DEBUG EVALUATE: Type mismatch invoking ARTAN(number) as artan(string).]],
374
375   [[cos(60 / 180 * 3.14159)], [0.50]],
376   [[cos(45 / 180 * 3.14159)], [0.71]],
377   [[cos(30 / 180 * 3.14159)], [0.87]],
378   [[cos(15 / 180 * 3.14159)], [0.97]],
379   [[cos(-60 / 180 * 3.14159)], [0.50]],
380   [[cos(-45 / 180 * 3.14159)], [0.71]],
381   [[cos(-30 / 180 * 3.14159)], [0.87]],
382   [[cos(-15 / 180 * 3.14159)], [0.97]],
383   [[cos(123 / 180 * 3.14159)], [-0.54]],
384   [[cos(321 / 180 * 3.14159)], [0.78]],
385   [[cos('x')], [error],
386    [error: DEBUG EVALUATE: Type mismatch invoking COS(number) as cos(string).]],
387
388   [[sin(60 / 180 * 3.14159)], [0.87]],
389   [[sin(45 / 180 * 3.14159)], [0.71]],
390   [[sin(30 / 180 * 3.14159)], [0.50]],
391   [[sin(15 / 180 * 3.14159)], [0.26]],
392   [[sin(-60 / 180 * 3.14159)], [-0.87]],
393   [[sin(-45 / 180 * 3.14159)], [-0.71]],
394   [[sin(-30 / 180 * 3.14159)], [-0.50]],
395   [[sin(-15 / 180 * 3.14159)], [-0.26]],
396   [[sin(123 / 180 * 3.14159)], [0.84]],
397   [[sin(321 / 180 * 3.14159)], [-0.63]],
398   [[sin('x')], [error],
399    [error: DEBUG EVALUATE: Type mismatch invoking SIN(number) as sin(string).]],
400
401   [[tan(60 / 180 * 3.14159)], [1.73]],
402   [[tan(45 / 180 * 3.14159)], [1.00]],
403   [[tan(30 / 180 * 3.14159)], [0.58]],
404   [[tan(15 / 180 * 3.14159)], [0.27]],
405   [[tan(-60 / 180 * 3.14159)], [-1.73]],
406   [[tan(-45 / 180 * 3.14159)], [-1.00]],
407   [[tan(-30 / 180 * 3.14159)], [-0.58]],
408   [[tan(-15 / 180 * 3.14159)], [-0.27]],
409   [[tan(123 / 180 * 3.14159)], [-1.54]],
410   [[tan(321 / 180 * 3.14159)], [-0.81]],
411   [[tan('x')], [error],
412    [error: DEBUG EVALUATE: Type mismatch invoking TAN(number) as tan(string).]])
413 # FIXME: a variable name as the argument to SYSMIS is a special case
414 # that we don't yet test.  We also can't test VALUE this way.
415 CHECK_EXPR_EVAL([missing nmiss nvalid sysmis any range max min],
416   [[missing(10)], [false]],
417   [[missing($sysmis)], [true]],
418   [[missing(asin(1.01))], [true]],
419   [[missing(asin(.5))], [false]],
420   [[missing('    ')], [error],
421    [error: DEBUG EVALUATE: Type mismatch invoking MISSING(number) as missing(string).]],
422
423   [[nmiss($sysmis)], [1.00]],
424   [[nmiss(0)], [0.00]],
425   [[nmiss($sysmis, $sysmis, $sysmis)], [3.00]],
426   [[nmiss(1, 2, 3, 4)], [0.00]],
427   [[nmiss(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4)], [4.00]],
428
429   [[nvalid($sysmis)], [0.00]],
430   [[nvalid(0)], [1.00]],
431   [[nvalid($sysmis, $sysmis, $sysmis)], [0.00]],
432   [[nvalid(1, 2, 3, 4)], [4.00]],
433   [[nvalid(1, $sysmis, $sysmis, 2, 2, $sysmis, $sysmis, 3, 4)], [5.00]],
434
435   [[sysmis(10)], [false]],
436   [[sysmis($sysmis)], [true]],
437   [[sysmis(asin(1.01))], [true]],
438   [[sysmis(asin(.5))], [false]],
439   [[sysmis('    ')], [error],
440    [error: DEBUG EVALUATE: Function invocation sysmis(string) does not match any known function.  Candidates are:
441 SYSMIS(num_variable)
442 SYSMIS(number).]],
443
444   [[any($sysmis, 1, $sysmis, 3)], [sysmis]],
445   [[any(1, 1, 2, 3)], [true]],
446   [[any(1, $true, 2, 3)], [true]],
447   [[any(1, $false, 2, 3)], [false]],
448   [[any(2, 1, 2, 3)], [true]],
449   [[any(3, 1, 2, 3)], [true]],
450   [[any(5, 1, 2, 3)], [false]],
451   [[any(1, 1, 1, 1)], [true]],
452   [[any($sysmis, 1, 1, 1)], [sysmis]],
453   [[any(1, $sysmis, $sysmis, $sysmis)], [sysmis]],
454   [[any($sysmis, $sysmis, $sysmis, $sysmis)], [sysmis]],
455   [[any(1)], [error],
456    [error: DEBUG EVALUATE: Function invocation any(number) does not match any known function.  Candidates are:
457 ANY(number, number[, number]...)
458 ANY(string, string[, string]...).]],
459   [[any('1', 2, 3, 4)], [error],
460    [error: DEBUG EVALUATE: Function invocation any(string, number, number, number) does not match any known function.  Candidates are:
461 ANY(number, number[, number]...)
462 ANY(string, string[, string]...).]],
463   [[any(1, '2', 3, 4)], [error],
464    [error: DEBUG EVALUATE: Function invocation any(number, string, number, number) does not match any known function.  Candidates are:
465 ANY(number, number[, number]...)
466 ANY(string, string[, string]...).]],
467   [[any(1, 2, '3', 4)], [error],
468    [error: DEBUG EVALUATE: Function invocation any(number, number, string, number) does not match any known function.  Candidates are:
469 ANY(number, number[, number]...)
470 ANY(string, string[, string]...).]],
471   [[any(1, 2, 3, '4')], [error],
472    [error: DEBUG EVALUATE: Function invocation any(number, number, number, string) does not match any known function.  Candidates are:
473 ANY(number, number[, number]...)
474 ANY(string, string[, string]...).]],
475
476   [[any('', 'a', '', 'c')], [true]],
477   [[any('a', 'a', 'b', 'c')], [true]],
478   [[any('b', 'a', 'b', 'c')], [true]],
479   [[any('c', 'a', 'b', 'c')], [true]],
480   [[any('e', 'a', 'b', 'c')], [false]],
481   [[any('a', 'a', 'a', 'a')], [true]],
482   [[any('', 'a', 'a', 'a')], [false]],
483   [[any('a', '', '', '')], [false]],
484   [[any('a')], [error],
485    [error: DEBUG EVALUATE: Function invocation any(string) does not match any known function.  Candidates are:
486 ANY(number, number[, number]...)
487 ANY(string, string[, string]...).]],
488   [[any('a', 'a  ', 'b', 'c')], [true]],
489   [[any('b   ', 'a', 'b', 'c')], [true]],
490   [[any('c   ', 'a', 'b', 'c     ')], [true]],
491   [[any(a10, 'b', 'c', 'd')], [error],
492    [error: DEBUG EVALUATE: Function invocation any(format, string, string, string) does not match any known function.  Candidates are:
493 ANY(number, number[, number]...)
494 ANY(string, string[, string]...).]],
495   [[any('a', b, 'c', 'd')], [error],
496    [error: DEBUG EVALUATE: Unknown identifier b.]],
497   [[any('a', 'b', c, 'd')], [error],
498    [error: DEBUG EVALUATE: Unknown identifier c.]],
499   [[any('a', 'b', 'c', d)], [error],
500    [error: DEBUG EVALUATE: Unknown identifier d.]],
501
502   [[range(5, 1, 10)], [true]],
503   [[range(1, 1, 10)], [true]],
504   [[range(10, 1, 10)], [true]],
505   [[range(-1, 1, 10)], [false]],
506   [[range(12, 1, 10)], [false]],
507   [[range($sysmis, 1, 10)], [sysmis]],
508   [[range(5, 1, $sysmis)], [sysmis]],
509   [[range(5, $sysmis, 10)], [sysmis]],
510   [[range($sysmis, $sysmis, 10)], [sysmis ]],
511   [[range($sysmis, 1, $sysmis)], [sysmis]],
512   [[range($sysmis, $sysmis, $sysmis)], [sysmis]],
513   [[range(0, 1, 8, 10, 18)], [false]],
514   [[range(1, 1, 8, 10, 18)], [true]],
515   [[range(6, 1, 8, 10, 18)], [true]],
516   [[range(8, 1, 8, 10, 18)], [true]],
517   [[range(9, 1, 8, 10, 18)], [false]],
518   [[range(10, 1, 8, 10, 18)], [true]],
519   [[range(13, 1, 8, 10, 18)], [true]],
520   [[range(16, 1, 8, 10, 18)], [true]],
521   [[range(18, 1, 8, 10, 18)], [true]],
522   [[range(20, 1, 8, 10, 18)], [false]],
523   [[range(1)], [error],
524    [error: DEBUG EVALUATE: Function invocation range(number) does not match any known function.  Candidates are:
525 RANGE(number, number, number[, number, number]...)
526 RANGE(string, string, string[, string, string]...).]],
527   [[range(1, 2)], [error],
528    [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an even number of arguments in list.]],
529   [[range(1, 2, 3, 4)], [error],
530    [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an even number of arguments in list.]],
531   [[range(1, 2, 3, 4, 5, 6)], [error],
532    [error: DEBUG EVALUATE: RANGE(number, number, number[, number, number]...) must have an even number of arguments in list.]],
533   [[range('1', 2, 3)], [error],
534    [error: DEBUG EVALUATE: Function invocation range(string, number, number) does not match any known function.  Candidates are:
535 RANGE(number, number, number[, number, number]...)
536 RANGE(string, string, string[, string, string]...).]],
537   [[range(1, '2', 3)], [error],
538    [error: DEBUG EVALUATE: Function invocation range(number, string, number) does not match any known function.  Candidates are:
539 RANGE(number, number, number[, number, number]...)
540 RANGE(string, string, string[, string, string]...).]],
541   [[range(1, 2, '3')], [error],
542    [error: DEBUG EVALUATE: Function invocation range(number, number, string) does not match any known function.  Candidates are:
543 RANGE(number, number, number[, number, number]...)
544 RANGE(string, string, string[, string, string]...).]],
545
546   [[range('123', '111', '888')], [true]],
547   [[range('111', '111', '888')], [true]],
548   [[range('888', '111', '888')], [true]],
549   [[range('110', '111', '888')], [false]],
550   [[range('889', '111', '888')], [false]],
551   [[range('000', '111', '888')], [false]],
552   [[range('999', '111', '888')], [false]],
553   [[range('123   ', '111', '888')], [true]],
554   [[range('123', '111   ', '888')], [true]],
555   [[range('123', '111', '888   ')], [true]],
556   [[range('123', '111    ', '888   ')], [true]],
557   [[range('00', '01', '08', '10', '18')], [false]],
558   [[range('01', '01', '08', '10', '18')], [true]],
559   [[range('06', '01', '08', '10', '18')], [true]],
560   [[range('08', '01', '08', '10', '18')], [true]],
561   [[range('09', '01', '08', '10', '18')], [false]],
562   [[range('10', '01', '08', '10', '18')], [true]],
563   [[range('15', '01', '08', '10', '18')], [true]],
564   [[range('18', '01', '08', '10', '18')], [true]],
565   [[range('19', '01', '08', '10', '18')], [false]],
566   [[range('1')], [error],
567    [error: DEBUG EVALUATE: Function invocation range(string) does not match any known function.  Candidates are:
568 RANGE(number, number, number[, number, number]...)
569 RANGE(string, string, string[, string, string]...).]],
570   [[range('1', '2')], [error],
571    [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an even number of arguments in list.]],
572   [[range('1', '2', '3', '4')], [error],
573    [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an even number of arguments in list.]],
574   [[range('1', '2', '3', '4', '5', '6')], [error],
575    [error: DEBUG EVALUATE: RANGE(string, string, string[, string, string]...) must have an even number of arguments in list.]],
576   [[range(1, '2', '3')], [error],
577    [error: DEBUG EVALUATE: Function invocation range(number, string, string) does not match any known function.  Candidates are:
578 RANGE(number, number, number[, number, number]...)
579 RANGE(string, string, string[, string, string]...).]],
580   [[range('1', 2, '3')], [error],
581    [error: DEBUG EVALUATE: Function invocation range(string, number, string) does not match any known function.  Candidates are:
582 RANGE(number, number, number[, number, number]...)
583 RANGE(string, string, string[, string, string]...).]],
584   [[range('1', '2', 3)], [error],
585    [error: DEBUG EVALUATE: Function invocation range(string, string, number) does not match any known function.  Candidates are:
586 RANGE(number, number, number[, number, number]...)
587 RANGE(string, string, string[, string, string]...).]],
588
589   [[max(1, 2, 3, 4, 5)], [5.00]],
590   [[max(1, $sysmis, 2, 3, $sysmis, 4, 5)], [5.00]],
591   [[max(1, 2)], [2.00]],
592   [[max()], [error],
593    [error: DEBUG EVALUATE: Function invocation max() does not match any known function.  Candidates are:
594 MAX(number[, number]...)
595 MAX(string[, string]...).]],
596   [[max(1)], [1.00]],
597   [[max(1, $sysmis)], [1.00]],
598   [[max(1, 2, 3, $sysmis)], [3.00]],
599   [[max.4(1, 2, 3, $sysmis)], [sysmis]],
600   [[max.4(1, 2, 3)], [error],
601    [error: DEBUG EVALUATE: With MAX(number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
602
603   [[max("2", "3", "5", "1", "4")], ["5"]],
604   [[max("1", "2")], ["2"]],
605   [[max("1")], ["1"]],
606
607   [[min(1, 2, 3, 4, 5)], [1.00]],
608   [[min(1, $sysmis, 2, 3, $sysmis, 4, 5)], [1.00]],
609   [[min(1, 2)], [1.00]],
610   [[min()], [error],
611    [error: DEBUG EVALUATE: Function invocation min() does not match any known function.  Candidates are:
612 MIN(number[, number]...)
613 MIN(string[, string]...).]],
614   [[min(1)], [1.00]],
615   [[min(1, $sysmis)], [1.00]],
616   [[min(1, 2, 3, $sysmis)], [1.00]],
617   [[min.4(1, 2, 3, $sysmis)], [sysmis]],
618   [[min.4(1, 2, 3)], [error],
619    [error: DEBUG EVALUATE: With MIN(number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
620
621   [[min("2", "3", "5", "1", "4")], ["1"]],
622   [[min("1", "2")], ["1"]],
623   [[min("1")], ["1"]])
624
625 CHECK_EXPR_EVAL([cfvar mean sd sum variance],
626   [[cfvar(1, 2, 3, 4, 5)], [0.53]],
627   [[cfvar(1, $sysmis, 2, 3, $sysmis, 4, 5)], [0.53]],
628   [[cfvar(1, 2)], [0.47]],
629   [[cfvar(1)], [error],
630    [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(number).]],
631   [[cfvar(1, $sysmis)], [sysmis]],
632   [[cfvar(1, 2, 3, $sysmis)], [0.50]],
633   [[cfvar.4(1, 2, 3, $sysmis)], [sysmis]],
634   [[cfvar.4(1, 2, 3)], [error],
635    [error: DEBUG EVALUATE: With CFVAR(number, number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
636   [[cfvar('x')], [error],
637    [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(string).]],
638   [[cfvar('x', 1, 2, 3)], [error],
639    [error: DEBUG EVALUATE: Type mismatch invoking CFVAR(number, number[, number]...) as cfvar(string, number, number, number).]],
640
641   [[mean(1, 2, 3, 4, 5)], [3.00]],
642   [[mean(1, $sysmis, 2, 3, $sysmis, 4, 5)], [3.00]],
643   [[mean(1, 2)], [1.50]],
644   [[mean()], [error],
645    [error: DEBUG EVALUATE: Type mismatch invoking MEAN(number[, number]...) as mean().]],
646   [[mean(1)], [1.00]],
647   [[mean(1, $sysmis)], [1.00]],
648   [[mean(1, 2, 3, $sysmis)], [2.00]],
649   [[mean.4(1, 2, 3, $sysmis)], [sysmis]],
650   [[mean.4(1, 2, 3)], [error],
651    [error: DEBUG EVALUATE: With MEAN(number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
652
653
654   [[sd(1, 2, 3, 4, 5)], [1.58]],
655   [[sd(1, $sysmis, 2, 3, $sysmis, 4, 5)], [1.58]],
656   [[sd(1, 2)], [0.71]],
657   [[sd(1)], [error],
658    [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(number).]],
659   [[sd(1, $sysmis)], [sysmis]],
660   [[sd(1, 2, 3, $sysmis)], [1.00]],
661   [[sd.4(1, 2, 3, $sysmis)], [sysmis]],
662   [[sd.4(1, 2, 3)], [error],
663    [error: DEBUG EVALUATE: With SD(number, number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
664   [[sd('x')], [error],
665    [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(string).]],
666   [[sd('x', 1, 2, 3)], [error],
667    [error: DEBUG EVALUATE: Type mismatch invoking SD(number, number[, number]...) as sd(string, number, number, number).]],
668
669   [[sum(1, 2, 3, 4, 5)], [15.00]],
670   [[sum(1, $sysmis, 2, 3, $sysmis, 4, 5)], [15.00]],
671   [[sum(1, 2)], [3.00]],
672   [[sum()], [error],
673    [error: DEBUG EVALUATE: Type mismatch invoking SUM(number[, number]...) as sum().]],
674   [[sum(1)], [1.00]],
675   [[sum(1, $sysmis)], [1.00]],
676   [[sum(1, 2, 3, $sysmis)], [6.00]],
677   [[sum.4(1, 2, 3, $sysmis)], [sysmis]],
678   [[sum.4(1, 2, 3)], [error],
679    [error: DEBUG EVALUATE: With SUM(number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
680
681   [[variance(1, 2, 3, 4, 5)], [2.50]],
682   [[variance(1, $sysmis, 2, 3, $sysmis, 4, 5)], [2.50]],
683   [[variance(1, 2)], [0.50]],
684   [[variance(1)], [error],
685    [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(number).]],
686   [[variance(1, $sysmis)], [sysmis]],
687   [[variance(1, 2, 3, $sysmis)], [1.00]],
688   [[variance.4(1, 2, 3, $sysmis)], [sysmis]],
689   [[variance.4(1, 2, 3)], [error],
690    [error: DEBUG EVALUATE: With VARIANCE(number, number[, number]...), using minimum valid argument count of 4 does not make sense when passing only 3 arguments in list.]],
691   [[variance('x')], [error],
692    [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(string).]],
693   [[variance('x', 1, 2, 3)], [error],
694    [error: DEBUG EVALUATE: Type mismatch invoking VARIANCE(number, number[, number]...) as variance(string, number, number, number).]])
695
696 CHECK_EXPR_EVAL([concat index rindex length lower],
697   [[concat('')], [""]],
698   [[concat('a', 'b')], ["ab"]],
699   [[concat('a', 'b', 'c', 'd', 'e', 'f', 'g', 'h')], ["abcdefgh"]],
700   [[concat('abcdefgh', 'ijklmnopq')], ["abcdefghijklmnopq"]],
701   [[concat('a', 1)], [error],
702    [error: DEBUG EVALUATE: Type mismatch invoking CONCAT(string[, string]...) as concat(string, number).]],
703   [[concat(1, 2)], [error],
704    [error: DEBUG EVALUATE: Type mismatch invoking CONCAT(string[, string]...) as concat(number, number).]],
705
706   [[index('abcbcde', 'bc')], [2.00]],
707   [[index('abcbcde', 'bcd')], [4.00]],
708   [[index('abcbcde', 'bcbc')], [2.00]],
709   [[index('abcdefgh', 'abc')], [1.00]],
710   [[index('abcdefgh', 'bcd')], [2.00]],
711   [[index('abcdefgh', 'cde')], [3.00]],
712   [[index('abcdefgh', 'def')], [4.00]],
713   [[index('abcdefgh', 'efg')], [5.00]],
714   [[index('abcdefgh', 'fgh')], [6.00]],
715   [[index('abcdefgh', 'fghi')], [0.00]],
716   [[index('abcdefgh', 'x')], [0.00]],
717   [[index('abcdefgh', 'abch')], [0.00]],
718   [[index('banana', 'na')], [3.00]],
719   [[index('banana', 'ana')], [2.00]],
720   [[index('', 'x')], [0.00]],
721   [[index('', '')], [sysmis]],
722   [[index('abcdefgh', '')], [sysmis]],
723   [[index('abcdefgh', 'alkjsfdjlskalkjfa')], [0.00]],
724
725   [[index('abcbcde', 'bc', 1)], [2.00]],
726   [[index('abcbcde', 'dc', 1)], [3.00]],
727   [[index('abcbcde', 'abc', 1)], [1.00]],
728   [[index('abcbcde', 'bc', 2)], [2.00]],
729   [[index('abcbcde', 'dc', 2)], [0.00]],
730   [[index('abcbcde', 'abc', 1)], [1.00]],
731   [[index('abcbcde', 'bccb', 2)], [2.00]],
732   [[index('abcbcde', 'bcbc', 2)], [2.00]],
733   [[index('abcbcde', 'bcbc', $sysmis)], [sysmis]],
734
735   [[rindex('abcbcde', 'bc')], [4.00]],
736   [[rindex('abcbcde', 'bcd')], [4.00]],
737   [[rindex('abcbcde', 'bcbc')], [2.00]],
738   [[rindex('abcdefgh', 'abc')], [1.00]],
739   [[rindex('abcdefgh', 'bcd')], [2.00]],
740   [[rindex('abcdefgh', 'cde')], [3.00]],
741   [[rindex('abcdefgh', 'def')], [4.00]],
742   [[rindex('abcdefgh', 'efg')], [5.00]],
743   [[rindex('abcdefgh', 'fgh')], [6.00]],
744   [[rindex('abcdefgh', 'fghi')], [0.00]],
745   [[rindex('abcdefgh', 'x')], [0.00]],
746   [[rindex('abcdefgh', 'abch')], [0.00]],
747   [[rindex('banana', 'na')], [5.00]],
748   [[rindex('banana', 'ana')], [4.00]],
749   [[rindex('', 'x')], [0.00]],
750   [[rindex('', '')], [sysmis]],
751   [[rindex('abcdefgh', '')], [sysmis]],
752   [[rindex('abcdefgh', 'alkjsfdjlskalkjfa')], [0.00]],
753
754   [[rindex('abcbcde', 'bc', 1)], [5.00]],
755   [[rindex('abcbcde', 'dc', 1)], [6.00]],
756   [[rindex('abcbcde', 'abc', 1)], [5.00]],
757   [[rindex('abcbcde', 'bc', 2)], [4.00]],
758   [[rindex('abcbcde', 'dc', 2)], [0.00]],
759   [[rindex('abcbcde', 'abc', 1)], [5.00]],
760   [[rindex('abcbcde', 'bccb', 2)], [4.00]],
761   [[rindex('abcbcde', 'bcbc', 2)], [4.00]],
762   [[rindex('abcbcde', 'bcbc', $sysmis)], [sysmis]],
763   [[rindex('abcbcde', 'bcbcg', 2)], [sysmis]],
764   [[rindex('abcbcde', 'bcbcg', $sysmis)], [sysmis]],
765   [[rindex('abcbcde', 'bcbcg', 'x')], [error],
766    [error: DEBUG EVALUATE: Function invocation rindex(string, string, string) does not match any known function.  Candidates are:
767 RINDEX(string, string)
768 RINDEX(string, string, number).]],
769   [[rindex(1, 'bcdfkjl', 2)], [error],
770    [error: DEBUG EVALUATE: Function invocation rindex(number, string, number) does not match any known function.  Candidates are:
771 RINDEX(string, string)
772 RINDEX(string, string, number).]],
773   [[rindex('aksj', 2, 2)], [error],
774    [error: DEBUG EVALUATE: Function invocation rindex(string, number, number) does not match any known function.  Candidates are:
775 RINDEX(string, string)
776 RINDEX(string, string, number).]],
777   [[rindex(1, 2, 3)], [error],
778    [error: DEBUG EVALUATE: Function invocation rindex(number, number, number) does not match any known function.  Candidates are:
779 RINDEX(string, string)
780 RINDEX(string, string, number).]],
781   [[rindex(1, 2, '3')], [error],
782    [error: DEBUG EVALUATE: Function invocation rindex(number, number, string) does not match any known function.  Candidates are:
783 RINDEX(string, string)
784 RINDEX(string, string, number).]],
785
786   [[length('')], [0.00]],
787   [[length('a')], [1.00]],
788   [[length('xy')], [2.00]],
789   [[length('adsf    ')], [8.00]],
790   [[length('abcdefghijkl')], [12.00]],
791   [[length(0)], [error],
792    [error: DEBUG EVALUATE: Type mismatch invoking LENGTH(string) as length(number).]],
793   [[length($sysmis)], [error],
794    [error: DEBUG EVALUATE: Type mismatch invoking LENGTH(string) as length(number).]],
795
796   [[lower('ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089')], ["abcdefghijklmnopqrstuvwxyz!@%&*089"]],
797   [[lower('')], [""]],
798   [[lower(1)], [error],
799    [error: DEBUG EVALUATE: Type mismatch invoking LOWER(string) as lower(number).]])
800
801 CHECK_EXPR_EVAL([lpad number ltrim lpad rtrim rpad string substr upcase],
802   [[lpad('abc', -1)], [""]],
803   [[lpad('abc', 0)], ["abc"]],
804   [[lpad('abc', 2)], ["abc"]],
805   [[lpad('abc', 3)], ["abc"]],
806   [[lpad('abc', 10)], ["       abc"]],
807   [[lpad('abc', 32768)], [""]],
808   [[lpad('abc', $sysmis)], [""]],
809   [[lpad('abc', -1, '*')], [""]],
810   [[lpad('abc', 0, '*')], ["abc"]],
811   [[lpad('abc', 2, '*')], ["abc"]],
812   [[lpad('abc', 3, '*')], ["abc"]],
813   [[lpad('abc', 10, '*')], ["*******abc"]],
814   [[lpad('abc', 32768, '*')], [""]],
815   [[lpad('abc', $sysmis, '*')], [""]],
816   [[lpad('abc', $sysmis, '')], [""]],
817   [[lpad('abc', $sysmis, 'xy')], [""]],
818   [[lpad(0, 10)], [error],
819    [error: DEBUG EVALUATE: Function invocation lpad(number, number) does not match any known function.  Candidates are:
820 LPAD(string, number)
821 LPAD(string, number, string).]],
822   [[lpad('abc', 'def')], [error],
823    [error: DEBUG EVALUATE: Function invocation lpad(string, string) does not match any known function.  Candidates are:
824 LPAD(string, number)
825 LPAD(string, number, string).]],
826   [[lpad(0, 10, ' ')], [error],
827    [error: DEBUG EVALUATE: Function invocation lpad(number, number, string) does not match any known function.  Candidates are:
828 LPAD(string, number)
829 LPAD(string, number, string).]],
830   [[lpad('abc', 'def', ' ')], [error],
831    [error: DEBUG EVALUATE: Function invocation lpad(string, string, string) does not match any known function.  Candidates are:
832 LPAD(string, number)
833 LPAD(string, number, string).]],
834   [[lpad('x', 5, 0)], [error],
835    [error: DEBUG EVALUATE: Function invocation lpad(string, number, number) does not match any known function.  Candidates are:
836 LPAD(string, number)
837 LPAD(string, number, string).]],
838   [[lpad('x', 5, 2)], [error],
839    [error: DEBUG EVALUATE: Function invocation lpad(string, number, number) does not match any known function.  Candidates are:
840 LPAD(string, number)
841 LPAD(string, number, string).]],
842
843   [[number("123", f3.0)], [123.00]],
844   [[number(" 123", f3.0)], [12.00]],
845   [[number("123", f3.1)], [12.30]],
846   [[number("   ", f3.1)], [sysmis]],
847   [[number("123", a8)], [error],
848    [error: DEBUG EVALUATE: Type mismatch invoking NUMBER(string, num_input_format) as number(string, format).]],
849 dnl CCA is not an input format:
850   [[number("123", cca1.2)], [error],
851    [error: DEBUG EVALUATE: Type mismatch invoking NUMBER(string, num_input_format) as number(string, format).]],
852
853   [[ltrim('   abc')], ["abc"]],
854   [[rtrim('   abc   ')], ["   abc"]],
855   [[ltrim('abc')], ["abc"]],
856   [[ltrim('     abc')], ["      abc"]],
857   [[ltrim('    ')], [""]],
858   [[ltrim('')], [""]],
859   [[ltrim(8)], [error],
860    [error: DEBUG EVALUATE: Function invocation ltrim(number) does not match any known function.  Candidates are:
861 LTRIM(string)
862 LTRIM(string, string).]],
863   [[ltrim('***abc', '*')], ["abc"]],
864   [[ltrim('abc', '*')], ["abc"]],
865   [[ltrim('*abc', '*')], ["abc"]],
866   [[ltrim('', '*')], [""]],
867   [[ltrim(8, '*')], [error],
868    [error: DEBUG EVALUATE: Function invocation ltrim(number, string) does not match any known function.  Candidates are:
869 LTRIM(string)
870 LTRIM(string, string).]],
871   [[ltrim(' x', 8)], [error],
872    [error: DEBUG EVALUATE: Function invocation ltrim(string, number) does not match any known function.  Candidates are:
873 LTRIM(string)
874 LTRIM(string, string).]],
875   [[ltrim(8, 9)], [error],
876    [error: DEBUG EVALUATE: Function invocation ltrim(number, number) does not match any known function.  Candidates are:
877 LTRIM(string)
878 LTRIM(string, string).]],
879
880   [[rpad('abc', -1)], [""]],
881   [[rpad('abc', 0)], ["abc"]],
882   [[rpad('abc', 2)], ["abc"]],
883   [[rpad('abc', 3)], ["abc"]],
884   [[rpad('abc', 10)], ["abc       "]],
885   [[rpad('abc', 32768)], [""]],
886   [[rpad('abc', $sysmis)], [""]],
887   [[rpad('abc', -1, '*')], [""]],
888   [[rpad('abc', 0, '*')], ["abc"]],
889   [[rpad('abc', 2, '*')], ["abc"]],
890   [[rpad('abc', 3, '*')], ["abc"]],
891   [[rpad('abc', 10, '*')], ["abc*******"]],
892   [[rpad('abc', 32768, '*')], [""]],
893   [[rpad('abc', $sysmis, '*')], [""]],
894   [[rpad('abc', $sysmis, '')], [""]],
895   [[rpad('abc', $sysmis, 'xy')], [""]],
896   [[rpad(0, 10)], [error],
897    [error: DEBUG EVALUATE: Function invocation rpad(number, number) does not match any known function.  Candidates are:
898 RPAD(string, number)
899 RPAD(string, number, string).]],
900   [[rpad('abc', 'def')], [error],
901    [error: DEBUG EVALUATE: Function invocation rpad(string, string) does not match any known function.  Candidates are:
902 RPAD(string, number)
903 RPAD(string, number, string).]],
904   [[rpad(0, 10, ' ')], [error],
905    [error: DEBUG EVALUATE: Function invocation rpad(number, number, string) does not match any known function.  Candidates are:
906 RPAD(string, number)
907 RPAD(string, number, string).]],
908   [[rpad('abc', 'def', ' ')], [error],
909    [error: DEBUG EVALUATE: Function invocation rpad(string, string, string) does not match any known function.  Candidates are:
910 RPAD(string, number)
911 RPAD(string, number, string).]],
912   [[rpad('x', 5, 0)], [error],
913    [error: DEBUG EVALUATE: Function invocation rpad(string, number, number) does not match any known function.  Candidates are:
914 RPAD(string, number)
915 RPAD(string, number, string).]],
916   [[rpad('x', 5, 2)], [error],
917    [error: DEBUG EVALUATE: Function invocation rpad(string, number, number) does not match any known function.  Candidates are:
918 RPAD(string, number)
919 RPAD(string, number, string).]],
920
921   [[rtrim('abc   ')], ["abc"]],
922   [[rtrim('   abc   ')], ["   abc"]],
923   [[rtrim('abc')], ["abc"]],
924   [[rtrim('abc  ')], ["abc      "]],
925   [[rtrim('    ')], [""]],
926   [[rtrim('')], [""]],
927   [[rtrim(8)], [error],
928    [error: DEBUG EVALUATE: Function invocation rtrim(number) does not match any known function.  Candidates are:
929 RTRIM(string)
930 RTRIM(string, string).]],
931   [[rtrim('abc***', '*')], ["abc"]],
932   [[rtrim('abc', '*')], ["abc"]],
933   [[rtrim('abc*', '*')], ["abc"]],
934   [[rtrim('', '*')], [""]],
935   [[rtrim(8, '*')], [error],
936    [error: DEBUG EVALUATE: Function invocation rtrim(number, string) does not match any known function.  Candidates are:
937 RTRIM(string)
938 RTRIM(string, string).]],
939   [[rtrim(' x', 8)], [error],
940    [error: DEBUG EVALUATE: Function invocation rtrim(string, number) does not match any known function.  Candidates are:
941 RTRIM(string)
942 RTRIM(string, string).]],
943   [[rtrim(8, 9)], [error],
944    [error: DEBUG EVALUATE: Function invocation rtrim(number, number) does not match any known function.  Candidates are:
945 RTRIM(string)
946 RTRIM(string, string).]],
947
948   [[string(123.56, f5.1)], ["123.6"]],
949   [[string($sysmis, f5.1)], ["   . "]],
950   [[string("abc", A5)], [error],
951    [error: DEBUG EVALUATE: Type mismatch invoking STRING(number, num_output_format) as string(string, format).]],
952 dnl E has a minimum width of 6 on output:
953   [[string(123, e1)], [error],
954    [error: DEBUG EVALUATE: Type mismatch invoking STRING(number, num_output_format) as string(number, format).]],
955   [[string(123, e6.0)], ["1E+002"]],
956
957   [[substr('abcdefgh', -5)], [""]],
958   [[substr('abcdefgh', 0)], [""]],
959   [[substr('abcdefgh', 1)], ["abcdefgh"]],
960   [[substr('abcdefgh', 3)], ["cdefgh"]],
961   [[substr('abcdefgh', 5)], ["efgh"]],
962   [[substr('abcdefgh', 6)], ["fgh"]],
963   [[substr('abcdefgh', 7)], ["gh"]],
964   [[substr('abcdefgh', 8)], ["h"]],
965   [[substr('abcdefgh', 9)], [""]],
966   [[substr('abcdefgh', 10)], [""]],
967   [[substr('abcdefgh', 20)], [""]],
968   [[substr('abcdefgh', $sysmis)], [""]],
969   [[substr(0, 10)], [error],
970    [error: DEBUG EVALUATE: Function invocation substr(number, number) does not match any known function.  Candidates are:
971 SUBSTR(string, number)
972 SUBSTR(string, number, number).]],
973   [[substr('abcd', 'abc')], [error],
974    [error: DEBUG EVALUATE: Function invocation substr(string, string) does not match any known function.  Candidates are:
975 SUBSTR(string, number)
976 SUBSTR(string, number, number).]],
977   [[substr(0, 'abc')], [error],
978    [error: DEBUG EVALUATE: Function invocation substr(number, string) does not match any known function.  Candidates are:
979 SUBSTR(string, number)
980 SUBSTR(string, number, number).]],
981
982   [[substr('abcdefgh', 0, 0)], [""]],
983   [[substr('abcdefgh', 3, 0)], [""]],
984   [[substr('abcdefgh', 5, 0)], [""]],
985   [[substr('abcdefgh', 9, 0)], [""]],
986   [[substr('abcdefgh', 0, 1)], [""]],
987   [[substr('abcdefgh', 0, 5)], [""]],
988   [[substr('abcdefgh', 1, 8)], ["abcdefgh"]],
989   [[substr('abcdefgh', 1, 10)], ["abcdefgh"]],
990   [[substr('abcdefgh', 1, 20)], ["abcdefgh"]],
991   [[substr('abcdefgh', 3, 4)], ["cdef"]],
992   [[substr('abcdefgh', 5, 2)], ["ef"]],
993   [[substr('abcdefgh', 6, 1)], ["f"]],
994   [[substr('abcdefgh', 7, 10)], ["gh"]],
995   [[substr('abcdefgh', 8, 1)], ["h"]],
996   [[substr('abcdefgh', 8, 2)], ["h"]],
997   [[substr('abcdefgh', 9, 11)], [""]],
998   [[substr('abcdefgh', 10, 52)], [""]],
999   [[substr('abcdefgh', 20, 1)], [""]],
1000   [[substr('abcdefgh', $sysmis, 2)], [""]],
1001   [[substr('abcdefgh', 9, $sysmis)], [""]],
1002   [[substr('abcdefgh', $sysmis, $sysmis)], [""]],
1003   [[substr('abc', 1, 'x')], [error],
1004    [error: DEBUG EVALUATE: Function invocation substr(string, number, string) does not match any known function.  Candidates are:
1005 SUBSTR(string, number)
1006 SUBSTR(string, number, number).]],
1007   [[substr(0, 10, 1)], [error],
1008    [error: DEBUG EVALUATE: Function invocation substr(number, number, number) does not match any known function.  Candidates are:
1009 SUBSTR(string, number)
1010 SUBSTR(string, number, number).]],
1011   [[substr(0, 10, 'x')], [error],
1012    [error: DEBUG EVALUATE: Function invocation substr(number, number, string) does not match any known function.  Candidates are:
1013 SUBSTR(string, number)
1014 SUBSTR(string, number, number).]],
1015   [[substr('abcd', 'abc', 0)], [error],
1016    [error: DEBUG EVALUATE: Function invocation substr(string, string, number) does not match any known function.  Candidates are:
1017 SUBSTR(string, number)
1018 SUBSTR(string, number, number).]],
1019   [[substr('abcd', 'abc', 'j')], [error],
1020    [error: DEBUG EVALUATE: Function invocation substr(string, string, string) does not match any known function.  Candidates are:
1021 SUBSTR(string, number)
1022 SUBSTR(string, number, number).]],
1023   [[substr(0, 'abc', 4)], [error],
1024    [error: DEBUG EVALUATE: Function invocation substr(number, string, number) does not match any known function.  Candidates are:
1025 SUBSTR(string, number)
1026 SUBSTR(string, number, number).]],
1027   [[substr(0, 'abc', 'k')], [error],
1028    [error: DEBUG EVALUATE: Function invocation substr(number, string, string) does not match any known function.  Candidates are:
1029 SUBSTR(string, number)
1030 SUBSTR(string, number, number).]],
1031
1032   [[upcase('abcdefghijklmnopqrstuvwxyz!@%&*089')], ["ABCDEFGHIJKLMNOPQRSTUVWXYZ!@%&*089"]],
1033   [[upcase('')], [""]],
1034   [[upcase(1)], [error],
1035    [error: DEBUG EVALUATE: Type mismatch invoking UPCASE(string) as upcase(number).]])
1036
1037 CHECK_EXPR_EVAL([time ctime date yrmoda],
1038   [[time.days(1)], [86400.00]],
1039   [[time.days(-1)], [-86400.00]],
1040   [[time.days(0.5)], [43200.00]],
1041   [[time.days('x')], [error],
1042    [error: DEBUG EVALUATE: Type mismatch invoking TIME.DAYS(number) as time.days(string).]],
1043   [[time.days($sysmis)], [sysmis]],
1044
1045   [[time.hms(4,50,38)], [17438.00]],
1046   [[time.hms(12,31,35)], [45095.00]],
1047   [[time.hms(12,47,53)], [46073.00]],
1048   [[time.hms(1,26,0)], [5160.00]],
1049   [[time.hms(20,58,11)], [75491.00]],
1050   [[time.hms(7,36,5)], [27365.00]],
1051   [[time.hms(15,43,49)], [56629.00]],
1052   [[time.hms(4,25,9)], [15909.00]],
1053   [[time.hms(6,49,27)], [24567.00]],
1054   [[time.hms(2,57,52)], [10672.00]],
1055   [[time.hms(16,45,44)], [60344.00]],
1056   [[time.hms(21,30,57)], [77457.00]],
1057   [[time.hms(22,30,4)], [81004.00]],
1058   [[time.hms(1,56,51)], [7011.00]],
1059   [[time.hms(5, 6, 7)], [18367.00]],
1060   [[time.hms(5, 6, 0)], [18360.00]],
1061   [[time.hms(5, 0, 7)], [18007.00]],
1062   [[time.hms(0, 6, 7)], [367.00]],
1063   [[time.hms(-5, 6, -7)], [sysmis],
1064    [warning: DEBUG EVALUATE: TIME.HMS cannot mix positive and negative arguments.]],
1065   [[time.hms(-5, 5, -7)], [sysmis],
1066    [warning: DEBUG EVALUATE: TIME.HMS cannot mix positive and negative arguments.]],
1067   [[time.hms($sysmis, 6, 7)], [sysmis]],
1068   [[time.hms(5, $sysmis, 7)], [sysmis]],
1069   [[time.hms(5, $sysmis, 7)], [sysmis]],
1070   [[time.hms($sysmis, $sysmis, 7)], [sysmis]],
1071   [[time.hms(5, $sysmis, $sysmis)], [sysmis]],
1072   [[time.hms($sysmis, $sysmis, 7)], [sysmis]],
1073   [[time.hms($sysmis, $sysmis, $sysmis)], [sysmis]],
1074
1075   [[ctime.days(106272)], [1.23]],
1076   [[ctime.hours(106272)], [29.52]],
1077   [[ctime.minutes(106272)], [1771.20]],
1078   [[ctime.seconds(106272)], [106272.00]],
1079   [[ctime.days(-106272)], [-1.23]],
1080   [[ctime.hours(-106272)], [-29.52]],
1081   [[ctime.minutes(-106272)], [-1771.20]],
1082   [[ctime.seconds(-106272)], [-106272.00]],
1083   [[ctime.days($sysmis)], [sysmis]],
1084   [[ctime.hours($sysmis)], [sysmis]],
1085   [[ctime.minutes($sysmis)], [sysmis]],
1086   [[ctime.seconds($sysmis)], [sysmis]],
1087   [[ctime.days('a')], [error],
1088    [error: DEBUG EVALUATE: Type mismatch invoking CTIME.DAYS(number) as ctime.days(string).]],
1089   [[ctime.hours('b')], [error],
1090    [error: DEBUG EVALUATE: Type mismatch invoking CTIME.HOURS(number) as ctime.hours(string).]],
1091   [[ctime.minutes('c')], [error],
1092    [error: DEBUG EVALUATE: Type mismatch invoking CTIME.MINUTES(number) as ctime.minutes(string).]],
1093   [[ctime.seconds('d')], [error],
1094    [error: DEBUG EVALUATE: Type mismatch invoking CTIME.SECONDS(number) as ctime.seconds(string).]],
1095
1096   [[ctime.days(date.dmy(15,10,1582))], [1.00]],
1097   [[ctime.days(date.dmy(6,9,1719))], [50000.00]],
1098   [[ctime.days(date.dmy(24,1,1583))], [102.00]],
1099   [[ctime.days(date.dmy(14,12,1585))], [1157.00]],
1100   [[ctime.days(date.dmy(26,11,1621))], [14288.00]],
1101   [[ctime.days(date.dmy(25,12,1821))], [87365.00]],
1102   [[ctime.days(date.dmy(3,12,1882))], [109623.00]],
1103   [[ctime.days(date.dmy(6,4,2002))], [153211.00]],
1104   [[ctime.days(date.dmy(19,12,1999))], [152372.00]],
1105   [[ctime.days(date.dmy(1,10,1978))], [144623.00]],
1106   [[ctime.days(date.dmy(0,10,1978))], [144622.00]],
1107   [[ctime.days(date.dmy(32,10,1978))], [sysmis],
1108    [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]],
1109   [[ctime.days(date.dmy(31,0,1978))], [144349.00]],
1110   [[ctime.days(date.dmy(31,13,1978))], [144745.00]],
1111   [[ctime.days(date.dmy($sysmis,10,1978))], [sysmis]],
1112   [[ctime.days(date.dmy(31,$sysmis,1978))], [sysmis]],
1113   [[ctime.days(date.dmy(31,10,$sysmis))], [sysmis]],
1114   [[ctime.days(date.dmy($sysmis,$sysmis,1978))], [sysmis]],
1115   [[ctime.days(date.dmy(31,$sysmis,$sysmis))], [sysmis]],
1116   [[ctime.days(date.dmy($sysmis,10,$sysmis))], [sysmis]],
1117   [[ctime.days(date.dmy($sysmis,$sysmis,$sysmis))], [sysmis]],
1118   [[date.dmy('a',1,2)], [error],
1119    [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(string, number, number).]],
1120   [[date.dmy(1,'a',2)], [error],
1121    [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(number, string, number).]],
1122   [[date.dmy(1,2,'a')], [error],
1123    [error: DEBUG EVALUATE: Type mismatch invoking DATE.DMY(number, number, number) as date.dmy(number, number, string).]],
1124 dnl FIXME: check out-of-range and nearly out-of-range values
1125 dnl
1126   [[yrmoda(1582,10,15)], [1.00]],
1127   [[yrmoda(1719,9,6)], [50000.00]],
1128   [[yrmoda(1583,1,24)], [102.00]],
1129   [[yrmoda(1585,12,14)], [1157.00]],
1130   [[yrmoda(1621,11,26)], [14288.00]],
1131   [[yrmoda(1821,12,25)], [87365.00]],
1132   [[yrmoda(1882,12,3)], [109623.00]],
1133   [[yrmoda(2002,4,6)], [153211.00]],
1134   [[yrmoda(1999,12,19)], [152372.00]],
1135   [[yrmoda(1978,10,1)], [144623.00]],
1136   [[yrmoda(1978,10,0)], [144622.00]],
1137   [[yrmoda(1978,10,32)], [sysmis],
1138    [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]],
1139   [[yrmoda(1978,0,31)], [144349.00]],
1140   [[yrmoda(1978,13,31)], [144745.00]],
1141   [[yrmoda(1978,10,$sysmis)], [sysmis]],
1142   [[yrmoda(1978,$sysmis,31)], [sysmis]],
1143   [[yrmoda($sysmis,10,31)], [sysmis]],
1144   [[yrmoda(1978,$sysmis,$sysmis)], [sysmis]],
1145   [[yrmoda($sysmis,$sysmis,31)], [sysmis]],
1146   [[yrmoda($sysmis,10,$sysmis)], [sysmis]],
1147   [[yrmoda($sysmis,$sysmis,$sysmis)], [sysmis]],
1148   [[yrmoda('a',1,2)], [error],
1149    [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(string, number, number).]],
1150   [[yrmoda(1,'a',2)], [error],
1151    [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(number, string, number).]],
1152   [[yrmoda(1,2,'a')], [error],
1153    [error: DEBUG EVALUATE: Type mismatch invoking YRMODA(number, number, number) as yrmoda(number, number, string).]],
1154 dnl FIXME: check out-of-range and nearly out-of-range values
1155 dnl
1156   [[ctime.days(date.mdy(6,10,1648)) + 577735], [601716.00]],
1157   [[ctime.days(date.mdy(6,30,1680)) + 577735], [613424.00]],
1158   [[ctime.days(date.mdy(7,24,1716)) + 577735], [626596.00]],
1159   [[ctime.days(date.mdy(6,19,1768)) + 577735], [645554.00]],
1160   [[ctime.days(date.mdy(8,2,1819)) + 577735], [664224.00]],
1161   [[ctime.days(date.mdy(3,27,1839)) + 577735], [671401.00]],
1162   [[ctime.days(date.mdy(4,19,1903)) + 577735], [694799.00]],
1163   [[ctime.days(date.mdy(8,25,1929)) + 577735], [704424.00]],
1164   [[ctime.days(date.mdy(9,29,1941)) + 577735], [708842.00]],
1165   [[ctime.days(date.mdy(4,19,1943)) + 577735], [709409.00]],
1166   [[ctime.days(date.mdy(10,7,1943)) + 577735], [709580.00]],
1167   [[ctime.days(date.mdy(3,17,1992)) + 577735], [727274.00]],
1168   [[ctime.days(date.mdy(2,25,1996)) + 577735], [728714.00]],
1169   [[ctime.days(date.mdy(11,10,2038)) + 577735], [744313.00]],
1170   [[ctime.days(date.mdy(7,18,2094)) + 577735], [764652.00]],
1171 dnl FIXME: check out-of-range and nearly out-of-range values
1172 dnl
1173   [[ctime.days(date.mdy(10,15,1582))], [1.00]],
1174   [[ctime.days(date.mdy(9,6,1719))], [50000.00]],
1175   [[ctime.days(date.mdy(1,24,1583))], [102.00]],
1176   [[ctime.days(date.mdy(12,14,1585))], [1157.00]],
1177   [[ctime.days(date.mdy(11,26,1621))], [14288.00]],
1178   [[ctime.days(date.mdy(12,25,1821))], [87365.00]],
1179   [[ctime.days(date.mdy(12,3,1882))], [109623.00]],
1180   [[ctime.days(date.mdy(4,6,2002))], [153211.00]],
1181   [[ctime.days(date.mdy(12,19,1999))], [152372.00]],
1182   [[ctime.days(date.mdy(10,1,1978))], [144623.00]],
1183   [[ctime.days(date.mdy(10,0,1978))], [144622.00]],
1184   [[ctime.days(date.mdy(10,32,1978))], [sysmis],
1185    [error: DEBUG EVALUATE: Day 32 is not in acceptable range of 0 to 31.]],
1186   [[ctime.days(date.mdy(0,31,1978))], [144349.00]],
1187   [[ctime.days(date.mdy(13,31,1978))], [144745.00]],
1188   [[ctime.days(date.mdy(10,$sysmis,1978))], [sysmis]],
1189   [[ctime.days(date.mdy($sysmis,31,1978))], [sysmis]],
1190   [[ctime.days(date.mdy(10,31,$sysmis))], [sysmis]],
1191   [[ctime.days(date.mdy($sysmis,$sysmis,1978))], [sysmis]],
1192   [[ctime.days(date.mdy($sysmis,31,$sysmis))], [sysmis]],
1193   [[ctime.days(date.mdy(10,$sysmis,$sysmis))], [sysmis]],
1194   [[ctime.days(date.mdy($sysmis,$sysmis,$sysmis))], [sysmis]],
1195   [[date.mdy('a',1,2)], [error],
1196    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(string, number, number).]],
1197   [[date.mdy(1,'a',2)], [error],
1198    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(number, string, number).]],
1199   [[date.mdy(1,2,'a')], [error],
1200    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MDY(number, number, number) as date.mdy(number, number, string).]],
1201   [[ctime.days(date.mdy(0,0,0))], [152353.00]],
1202   [[ctime.days(date.mdy(0,0,999))], [sysmis],
1203    [error: DEBUG EVALUATE: Date 0998-12-0 is before the earliest acceptable date of 1582-10-15.]],
1204   [[date.mdy(1,1,1582)], [sysmis],
1205    [error: DEBUG EVALUATE: Date 1582-1-1 is before the earliest acceptable date of 1582-10-15.]],
1206   [[date.mdy(10,14,1582)], [sysmis],
1207    [error: DEBUG EVALUATE: Date 1582-10-14 is before the earliest acceptable date of 1582-10-15.]],
1208   [[date.mdy(10,15,1582)], [86400.00]],
1209
1210   [[ctime.days(date.moyr(1,2000))], [152385.00]],
1211   [[ctime.days(date.moyr(2,2000))], [152416.00]],
1212   [[ctime.days(date.moyr(3,2000))], [152445.00]],
1213   [[ctime.days(date.moyr(4,2000))], [152476.00]],
1214   [[ctime.days(date.moyr(5,2000))], [152506.00]],
1215   [[ctime.days(date.moyr(13,2000))], [152751.00]],
1216   [[ctime.days(date.moyr(14,2000))], [sysmis],
1217    [error: DEBUG EVALUATE: Month 14 is not in acceptable range of 0 to 13.]],
1218   [[ctime.days(date.moyr($sysmis,2000))], [sysmis]],
1219   [[ctime.days(date.moyr(1,$sysmis))], [sysmis]],
1220   [[ctime.days(date.moyr($sysmis,$sysmis))], [sysmis]],
1221   [[date.moyr('a',2000)], [error],
1222    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(string, number).]],
1223   [[date.moyr(5,'a')], [error],
1224    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(number, string).]],
1225   [[date.moyr('a','b')], [error],
1226    [error: DEBUG EVALUATE: Type mismatch invoking DATE.MOYR(number, number) as date.moyr(string, string).]],
1227
1228   [[ctime.days(date.qyr(1,2000))], [152385.00]],
1229   [[ctime.days(date.qyr(2,2000))], [152476.00]],
1230   [[ctime.days(date.qyr(5,2000))], [sysmis],
1231    [warning: DEBUG EVALUATE: The first argument to DATE.QYR must be 1, 2, 3, or 4.]],
1232   [[ctime.days(date.qyr(6,2000))], [sysmis],
1233    [warning: DEBUG EVALUATE: The first argument to DATE.QYR must be 1, 2, 3, or 4.]],
1234   [[ctime.days(date.qyr($sysmis,2000))], [sysmis]],
1235   [[ctime.days(date.qyr(1,$sysmis))], [sysmis]],
1236   [[ctime.days(date.qyr($sysmis,$sysmis))], [sysmis]],
1237   [[date.qyr('a',2000)], [error],
1238    [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(string, number).]],
1239   [[date.qyr(5,'a')], [error],
1240    [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(number, string).]],
1241   [[date.qyr('a','b')], [error],
1242    [error: DEBUG EVALUATE: Type mismatch invoking DATE.QYR(number, number) as date.qyr(string, string).]],
1243
1244   [[ctime.days(date.wkyr(1,2000))], [152385.00]],
1245   [[ctime.days(date.wkyr(15,1999))], [152118.00]],
1246   [[ctime.days(date.wkyr(36,1999))], [152265.00]],
1247   [[ctime.days(date.wkyr(54,1999))], [sysmis],
1248    [error: DEBUG EVALUATE: The week argument to DATE.WKYR is outside the acceptable range of 1 to 53.  The result will be system-missing.]],
1249   [[ctime.days(date.wkyr($sysmis,1999))], [sysmis]],
1250   [[ctime.days(date.wkyr(1,$sysmis))], [sysmis]],
1251   [[ctime.days(date.wkyr($sysmis,$sysmis))], [sysmis]],
1252   [[date.wkyr('a',1999)], [error],
1253    [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(string, number).]],
1254   [[date.wkyr(5,'a')], [error],
1255    [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(number, string).]],
1256   [[date.wkyr('a','b')], [error],
1257    [error: DEBUG EVALUATE: Type mismatch invoking DATE.WKYR(number, number) as date.wkyr(string, string).]],
1258
1259   [[ctime.days(date.yrday(2000,1))], [152385.00]],
1260   [[ctime.days(date.yrday(2000,100))], [152484.00]],
1261   [[ctime.days(date.yrday(2000,253))], [152637.00]],
1262   [[ctime.days(date.yrday(2000,500))], [sysmis],
1263    [error: DEBUG EVALUATE: The day argument to DATE.YRDAY is outside the acceptable range of 1 to 366.  The result will be system-missing.]],
1264   [[ctime.days(date.yrday(2000,-100))], [sysmis],
1265    [error: DEBUG EVALUATE: The day argument to DATE.YRDAY is outside the acceptable range of 1 to 366.  The result will be system-missing.]],
1266   [[ctime.days(date.yrday(1999,$sysmis))], [sysmis]],
1267   [[ctime.days(date.yrday($sysmis,1))], [sysmis]],
1268   [[ctime.days(date.yrday($sysmis,$sysmis))], [sysmis]],
1269   [[date.yrday(1999,'a')], [error],
1270    [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(number, string).]],
1271   [[date.yrday('a',5)], [error],
1272    [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(string, number).]],
1273   [[date.yrday('a','b')], [error],
1274    [error: DEBUG EVALUATE: Type mismatch invoking DATE.YRDAY(number, number) as date.yrday(string, string).]])
1275
1276 CHECK_EXPR_EVAL([xdate],
1277   [[xdate.date(date.mdy(6,10,1648) + time.hms(0,0,0)) / 86400], [23981.00]],
1278   [[xdate.date(date.mdy(6,30,1680) + time.hms(4,50,38)) / 86400], [35689.00]],
1279   [[xdate.date(date.mdy(7,24,1716) + time.hms(12,31,35)) / 86400], [48861.00]],
1280   [[xdate.date(date.mdy(6,19,1768) + time.hms(12,47,53)) / 86400], [67819.00]],
1281   [[xdate.date(date.mdy(8,2,1819) + time.hms(1,26,0)) / 86400], [86489.00]],
1282   [[xdate.date(date.mdy(3,27,1839) + time.hms(20,58,11)) / 86400], [93666.00]],
1283   [[xdate.date(date.mdy(4,19,1903) + time.hms(7,36,5)) / 86400], [117064.00]],
1284   [[xdate.date(date.mdy(8,25,1929) + time.hms(15,43,49)) / 86400], [126689.00]],
1285   [[xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400], [131107.00]],
1286   [[xdate.date(date.mdy(4,19,1943) + time.hms(6,49,27)) / 86400], [131674.00]],
1287   [[xdate.date(date.mdy(10,7,1943) + time.hms(2,57,52)) / 86400], [131845.00]],
1288   [[xdate.date(date.mdy(3,17,1992) + time.hms(16,45,44)) / 86400], [149539.00]],
1289   [[xdate.date(date.mdy(2,25,1996) + time.hms(21,30,57)) / 86400], [150979.00]],
1290   [[xdate.date(date.mdy(9,29,1941) + time.hms(4,25,9)) / 86400], [131107.00]],
1291   [[xdate.date(date.mdy(4,19,43) + time.hms(6,49,27)) / 86400], [131674.00]],
1292   [[xdate.date(date.mdy(10,7,43) + time.hms(2,57,52)) / 86400], [131845.00]],
1293   [[xdate.date(date.mdy(3,17,92) + time.hms(16,45,44)) / 86400], [149539.00]],
1294   [[xdate.date(date.mdy(2,25,96) + time.hms(21,30,57)) / 86400], [150979.00]],
1295   [[xdate.date(date.mdy(11,10,2038) + time.hms(22,30,4)) / 86400], [166578.00]],
1296   [[xdate.date(date.mdy(7,18,2094) + time.hms(1,56,51)) / 86400], [186917.00]],
1297   [[xdate.date(123.4)], [0.00]],
1298   [[xdate.date('')], [error],
1299    [error: DEBUG EVALUATE: Type mismatch invoking XDATE.DATE(number) as xdate.date(string).]],
1300
1301   [[xdate.hour(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]],
1302   [[xdate.hour(date.mdy(6,30,1680) + time.hms(4,50,38))], [4.00]],
1303   [[xdate.hour(date.mdy(7,24,1716) + time.hms(12,31,35))], [12.00]],
1304   [[xdate.hour(date.mdy(6,19,1768) + time.hms(12,47,53))], [12.00]],
1305   [[xdate.hour(date.mdy(8,2,1819) + time.hms(1,26,0))], [1.00]],
1306   [[xdate.hour(date.mdy(3,27,1839) + time.hms(20,58,11))], [20.00]],
1307   [[xdate.hour(date.mdy(4,19,1903) + time.hms(7,36,5))], [7.00]],
1308   [[xdate.hour(date.mdy(8,25,1929) + time.hms(15,43,49))], [15.00]],
1309   [[xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9))], [4.00]],
1310   [[xdate.hour(date.mdy(4,19,1943) + time.hms(6,49,27))], [6.00]],
1311   [[xdate.hour(date.mdy(10,7,1943) + time.hms(2,57,52))], [2.00]],
1312   [[xdate.hour(date.mdy(3,17,1992) + time.hms(16,45,44))], [16.00]],
1313   [[xdate.hour(date.mdy(2,25,1996) + time.hms(21,30,57))], [21.00]],
1314   [[xdate.hour(date.mdy(9,29,1941) + time.hms(4,25,9))], [4.00]],
1315   [[xdate.hour(date.mdy(4,19,43) + time.hms(6,49,27))], [6.00]],
1316   [[xdate.hour(date.mdy(10,7,43) + time.hms(2,57,52))], [2.00]],
1317   [[xdate.hour(date.mdy(3,17,92) + time.hms(16,45,44))], [16.00]],
1318   [[xdate.hour(date.mdy(2,25,96) + time.hms(21,30,57))], [21.00]],
1319   [[xdate.hour(date.mdy(11,10,2038) + time.hms(22,30,4))], [22.00]],
1320   [[xdate.hour(date.mdy(7,18,2094) + time.hms(1,56,51))], [1.00]],
1321   [[xdate.hour(-1)], [-1.00]],
1322   [[xdate.hour(1)], [0.00]],
1323   [[xdate.hour($sysmis)], [sysmis]],
1324   [[xdate.hour('')], [error],
1325    [error: DEBUG EVALUATE: Type mismatch invoking XDATE.HOUR(number) as xdate.hour(string).]],
1326
1327   [[xdate.jday(date.mdy(6,10,1648) + time.hms(0,0,0))], [162.00]],
1328   [[xdate.jday(date.mdy(6,30,1680) + time.hms(4,50,38))], [182.00]],
1329   [[xdate.jday(date.mdy(7,24,1716) + time.hms(12,31,35))], [206.00]],
1330   [[xdate.jday(date.mdy(6,19,1768) + time.hms(12,47,53))], [171.00]],
1331   [[xdate.jday(date.mdy(8,2,1819) + time.hms(1,26,0))], [214.00]],
1332   [[xdate.jday(date.mdy(3,27,1839) + time.hms(20,58,11))], [86.00]],
1333   [[xdate.jday(date.mdy(4,19,1903) + time.hms(7,36,5))], [109.00]],
1334   [[xdate.jday(date.mdy(8,25,1929) + time.hms(15,43,49))], [237.00]],
1335   [[xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9))], [272.00]],
1336   [[xdate.jday(date.mdy(4,19,1943) + time.hms(6,49,27))], [109.00]],
1337   [[xdate.jday(date.mdy(10,7,1943) + time.hms(2,57,52))], [280.00]],
1338   [[xdate.jday(date.mdy(3,17,1992) + time.hms(16,45,44))], [77.00]],
1339   [[xdate.jday(date.mdy(2,25,1996) + time.hms(21,30,57))], [56.00]],
1340   [[xdate.jday(date.mdy(9,29,1941) + time.hms(4,25,9))], [272.00]],
1341   [[xdate.jday(date.mdy(4,19,43) + time.hms(6,49,27))], [109.00]],
1342   [[xdate.jday(date.mdy(10,7,43) + time.hms(2,57,52))], [280.00]],
1343   [[xdate.jday(date.mdy(3,17,92) + time.hms(16,45,44))], [77.00]],
1344   [[xdate.jday(date.mdy(2,25,96) + time.hms(21,30,57))], [56.00]],
1345   [[xdate.jday(date.mdy(11,10,2038) + time.hms(22,30,4))], [314.00]],
1346   [[xdate.jday(date.mdy(7,18,2094) + time.hms(1,56,51))], [199.00]],
1347   [[xdate.jday(0)], [sysmis]],
1348   [[xdate.jday(1)], [sysmis]],
1349   [[xdate.jday(86400)], [288.00]],
1350
1351   [[xdate.mday(date.mdy(6,10,1648) + time.hms(0,0,0))], [10.00]],
1352   [[xdate.mday(date.mdy(6,30,1680) + time.hms(4,50,38))], [30.00]],
1353   [[xdate.mday(date.mdy(7,24,1716) + time.hms(12,31,35))], [24.00]],
1354   [[xdate.mday(date.mdy(6,19,1768) + time.hms(12,47,53))], [19.00]],
1355   [[xdate.mday(date.mdy(8,2,1819) + time.hms(1,26,0))], [2.00]],
1356   [[xdate.mday(date.mdy(3,27,1839) + time.hms(20,58,11))], [27.00]],
1357   [[xdate.mday(date.mdy(4,19,1903) + time.hms(7,36,5))], [19.00]],
1358   [[xdate.mday(date.mdy(8,25,1929) + time.hms(15,43,49))], [25.00]],
1359   [[xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9))], [29.00]],
1360   [[xdate.mday(date.mdy(4,19,1943) + time.hms(6,49,27))], [19.00]],
1361   [[xdate.mday(date.mdy(10,7,1943) + time.hms(2,57,52))], [7.00]],
1362   [[xdate.mday(date.mdy(3,17,1992) + time.hms(16,45,44))], [17.00]],
1363   [[xdate.mday(date.mdy(2,25,1996) + time.hms(21,30,57))], [25.00]],
1364   [[xdate.mday(date.mdy(9,29,1941) + time.hms(4,25,9))], [29.00]],
1365   [[xdate.mday(date.mdy(4,19,43) + time.hms(6,49,27))], [19.00]],
1366   [[xdate.mday(date.mdy(10,7,43) + time.hms(2,57,52))], [7.00]],
1367   [[xdate.mday(date.mdy(3,17,92) + time.hms(16,45,44))], [17.00]],
1368   [[xdate.mday(date.mdy(2,25,96) + time.hms(21,30,57))], [25.00]],
1369   [[xdate.mday(date.mdy(11,10,2038) + time.hms(22,30,4))], [10.00]],
1370   [[xdate.mday(date.mdy(7,18,2094) + time.hms(1,56,51))], [18.00]],
1371
1372   [[xdate.minute(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]],
1373   [[xdate.minute(date.mdy(6,30,1680) + time.hms(4,50,38))], [50.00]],
1374   [[xdate.minute(date.mdy(7,24,1716) + time.hms(12,31,35))], [31.00]],
1375   [[xdate.minute(date.mdy(6,19,1768) + time.hms(12,47,53))], [47.00]],
1376   [[xdate.minute(date.mdy(8,2,1819) + time.hms(1,26,0))], [26.00]],
1377   [[xdate.minute(date.mdy(3,27,1839) + time.hms(20,58,11))], [58.00]],
1378   [[xdate.minute(date.mdy(4,19,1903) + time.hms(7,36,5))], [36.00]],
1379   [[xdate.minute(date.mdy(8,25,1929) + time.hms(15,43,49))], [43.00]],
1380   [[xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9))], [25.00]],
1381   [[xdate.minute(date.mdy(4,19,1943) + time.hms(6,49,27))], [49.00]],
1382   [[xdate.minute(date.mdy(10,7,1943) + time.hms(2,57,52))], [57.00]],
1383   [[xdate.minute(date.mdy(3,17,1992) + time.hms(16,45,44))], [45.00]],
1384   [[xdate.minute(date.mdy(2,25,1996) + time.hms(21,30,57))], [30.00]],
1385   [[xdate.minute(date.mdy(9,29,1941) + time.hms(4,25,9))], [25.00]],
1386   [[xdate.minute(date.mdy(4,19,43) + time.hms(6,49,27))], [49.00]],
1387   [[xdate.minute(date.mdy(10,7,43) + time.hms(2,57,52))], [57.00]],
1388   [[xdate.minute(date.mdy(3,17,92) + time.hms(16,45,44))], [45.00]],
1389   [[xdate.minute(date.mdy(2,25,96) + time.hms(21,30,57))], [30.00]],
1390   [[xdate.minute(date.mdy(11,10,2038) + time.hms(22,30,4))], [30.00]],
1391   [[xdate.minute(date.mdy(7,18,2094) + time.hms(1,56,51))], [56.00]],
1392
1393   [[xdate.month(date.mdy(6,10,1648) + time.hms(0,0,0))], [6.00]],
1394   [[xdate.month(date.mdy(6,30,1680) + time.hms(4,50,38))], [6.00]],
1395   [[xdate.month(date.mdy(7,24,1716) + time.hms(12,31,35))], [7.00]],
1396   [[xdate.month(date.mdy(6,19,1768) + time.hms(12,47,53))], [6.00]],
1397   [[xdate.month(date.mdy(8,2,1819) + time.hms(1,26,0))], [8.00]],
1398   [[xdate.month(date.mdy(3,27,1839) + time.hms(20,58,11))], [3.00]],
1399   [[xdate.month(date.mdy(4,19,1903) + time.hms(7,36,5))], [4.00]],
1400   [[xdate.month(date.mdy(8,25,1929) + time.hms(15,43,49))], [8.00]],
1401   [[xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]],
1402   [[xdate.month(date.mdy(4,19,1943) + time.hms(6,49,27))], [4.00]],
1403   [[xdate.month(date.mdy(10,7,1943) + time.hms(2,57,52))], [10.00]],
1404   [[xdate.month(date.mdy(3,17,1992) + time.hms(16,45,44))], [3.00]],
1405   [[xdate.month(date.mdy(2,25,1996) + time.hms(21,30,57))], [2.00]],
1406   [[xdate.month(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]],
1407   [[xdate.month(date.mdy(4,19,43) + time.hms(6,49,27))], [4.00]],
1408   [[xdate.month(date.mdy(10,7,43) + time.hms(2,57,52))], [10.00]],
1409   [[xdate.month(date.mdy(3,17,92) + time.hms(16,45,44))], [3.00]],
1410   [[xdate.month(date.mdy(2,25,96) + time.hms(21,30,57))], [2.00]],
1411   [[xdate.month(date.mdy(11,10,2038) + time.hms(22,30,4))], [11.00]],
1412   [[xdate.month(date.mdy(7,18,2094) + time.hms(1,56,51))], [7.00]],
1413
1414   [[xdate.quarter(date.mdy(6,10,1648) + time.hms(0,0,0))], [2.00]],
1415   [[xdate.quarter(date.mdy(6,30,1680) + time.hms(4,50,38))], [2.00]],
1416   [[xdate.quarter(date.mdy(7,24,1716) + time.hms(12,31,35))], [3.00]],
1417   [[xdate.quarter(date.mdy(6,19,1768) + time.hms(12,47,53))], [2.00]],
1418   [[xdate.quarter(date.mdy(8,2,1819) + time.hms(1,26,0))], [3.00]],
1419   [[xdate.quarter(date.mdy(3,27,1839) + time.hms(20,58,11))], [1.00]],
1420   [[xdate.quarter(date.mdy(4,19,1903) + time.hms(7,36,5))], [2.00]],
1421   [[xdate.quarter(date.mdy(8,25,1929) + time.hms(15,43,49))], [3.00]],
1422   [[xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9))], [3.00]],
1423   [[xdate.quarter(date.mdy(4,19,1943) + time.hms(6,49,27))], [2.00]],
1424   [[xdate.quarter(date.mdy(10,7,1943) + time.hms(2,57,52))], [4.00]],
1425   [[xdate.quarter(date.mdy(3,17,1992) + time.hms(16,45,44))], [1.00]],
1426   [[xdate.quarter(date.mdy(2,25,1996) + time.hms(21,30,57))], [1.00]],
1427   [[xdate.quarter(date.mdy(9,29,1941) + time.hms(4,25,9))], [3.00]],
1428   [[xdate.quarter(date.mdy(4,19,43) + time.hms(6,49,27))], [2.00]],
1429   [[xdate.quarter(date.mdy(10,7,43) + time.hms(2,57,52))], [4.00]],
1430   [[xdate.quarter(date.mdy(3,17,92) + time.hms(16,45,44))], [1.00]],
1431   [[xdate.quarter(date.mdy(2,25,96) + time.hms(21,30,57))], [1.00]],
1432   [[xdate.quarter(date.mdy(11,10,2038) + time.hms(22,30,4))], [4.00]],
1433   [[xdate.quarter(date.mdy(7,18,2094) + time.hms(1,56,51))], [3.00]],
1434
1435   [[xdate.second(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]],
1436   [[xdate.second(date.mdy(6,30,1680) + time.hms(4,50,38))], [38.00]],
1437   [[xdate.second(date.mdy(7,24,1716) + time.hms(12,31,35))], [35.00]],
1438   [[xdate.second(date.mdy(6,19,1768) + time.hms(12,47,53))], [53.00]],
1439   [[xdate.second(date.mdy(8,2,1819) + time.hms(1,26,0))], [0.00]],
1440   [[xdate.second(date.mdy(3,27,1839) + time.hms(20,58,11))], [11.00]],
1441   [[xdate.second(date.mdy(4,19,1903) + time.hms(7,36,5))], [5.00]],
1442   [[xdate.second(date.mdy(8,25,1929) + time.hms(15,43,49))], [49.00]],
1443   [[xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]],
1444   [[xdate.second(date.mdy(4,19,1943) + time.hms(6,49,27))], [27.00]],
1445   [[xdate.second(date.mdy(10,7,1943) + time.hms(2,57,52))], [52.00]],
1446   [[xdate.second(date.mdy(3,17,1992) + time.hms(16,45,44))], [44.00]],
1447   [[xdate.second(date.mdy(2,25,1996) + time.hms(21,30,57))], [57.00]],
1448   [[xdate.second(date.mdy(9,29,1941) + time.hms(4,25,9))], [9.00]],
1449   [[xdate.second(date.mdy(4,19,43) + time.hms(6,49,27))], [27.00]],
1450   [[xdate.second(date.mdy(10,7,43) + time.hms(2,57,52))], [52.00]],
1451   [[xdate.second(date.mdy(3,17,92) + time.hms(16,45,44))], [44.00]],
1452   [[xdate.second(date.mdy(2,25,96) + time.hms(21,30,57))], [57.00]],
1453   [[xdate.second(date.mdy(11,10,2038) + time.hms(22,30,4))], [4.00]],
1454   [[xdate.second(date.mdy(7,18,2094) + time.hms(1,56,51))], [51.00]],
1455
1456   [[xdate.tday(date.mdy(6,10,1648) + time.hms(0,0,0))], [23981.00]],
1457   [[xdate.tday(date.mdy(6,30,1680) + time.hms(4,50,38))], [35689.00]],
1458   [[xdate.tday(date.mdy(7,24,1716) + time.hms(12,31,35))], [48861.00]],
1459   [[xdate.tday(date.mdy(6,19,1768) + time.hms(12,47,53))], [67819.00]],
1460   [[xdate.tday(date.mdy(8,2,1819) + time.hms(1,26,0))], [86489.00]],
1461   [[xdate.tday(date.mdy(3,27,1839) + time.hms(20,58,11))], [93666.00]],
1462   [[xdate.tday(date.mdy(4,19,1903) + time.hms(7,36,5))], [117064.00]],
1463   [[xdate.tday(date.mdy(8,25,1929) + time.hms(15,43,49))], [126689.00]],
1464   [[xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9))], [131107.00]],
1465   [[xdate.tday(date.mdy(4,19,1943) + time.hms(6,49,27))], [131674.00]],
1466   [[xdate.tday(date.mdy(10,7,1943) + time.hms(2,57,52))], [131845.00]],
1467   [[xdate.tday(date.mdy(3,17,1992) + time.hms(16,45,44))], [149539.00]],
1468   [[xdate.tday(date.mdy(2,25,1996) + time.hms(21,30,57))], [150979.00]],
1469   [[xdate.tday(date.mdy(9,29,1941) + time.hms(4,25,9))], [131107.00]],
1470   [[xdate.tday(date.mdy(4,19,43) + time.hms(6,49,27))], [131674.00]],
1471   [[xdate.tday(date.mdy(10,7,43) + time.hms(2,57,52))], [131845.00]],
1472   [[xdate.tday(date.mdy(3,17,92) + time.hms(16,45,44))], [149539.00]],
1473   [[xdate.tday(date.mdy(2,25,96) + time.hms(21,30,57))], [150979.00]],
1474   [[xdate.tday(date.mdy(11,10,2038) + time.hms(22,30,4))], [166578.00]],
1475   [[xdate.tday(date.mdy(7,18,2094) + time.hms(1,56,51))], [186917.00]],
1476
1477   [[xdate.time(date.mdy(6,10,1648) + time.hms(0,0,0))], [0.00]],
1478   [[xdate.time(date.mdy(6,30,1680) + time.hms(4,50,38))], [17438.00]],
1479   [[xdate.time(date.mdy(7,24,1716) + time.hms(12,31,35))], [45095.00]],
1480   [[xdate.time(date.mdy(6,19,1768) + time.hms(12,47,53))], [46073.00]],
1481   [[xdate.time(date.mdy(8,2,1819) + time.hms(1,26,0))], [5160.00]],
1482   [[xdate.time(date.mdy(3,27,1839) + time.hms(20,58,11))], [75491.00]],
1483   [[xdate.time(date.mdy(4,19,1903) + time.hms(7,36,5))], [27365.00]],
1484   [[xdate.time(date.mdy(8,25,1929) + time.hms(15,43,49))], [56629.00]],
1485   [[xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9))], [15909.00]],
1486   [[xdate.time(date.mdy(4,19,1943) + time.hms(6,49,27))], [24567.00]],
1487   [[xdate.time(date.mdy(10,7,1943) + time.hms(2,57,52))], [10672.00]],
1488   [[xdate.time(date.mdy(3,17,1992) + time.hms(16,45,44))], [60344.00]],
1489   [[xdate.time(date.mdy(2,25,1996) + time.hms(21,30,57))], [77457.00]],
1490   [[xdate.time(date.mdy(9,29,1941) + time.hms(4,25,9))], [15909.00]],
1491   [[xdate.time(date.mdy(4,19,43) + time.hms(6,49,27))], [24567.00]],
1492   [[xdate.time(date.mdy(10,7,43) + time.hms(2,57,52))], [10672.00]],
1493   [[xdate.time(date.mdy(3,17,92) + time.hms(16,45,44))], [60344.00]],
1494   [[xdate.time(date.mdy(2,25,96) + time.hms(21,30,57))], [77457.00]],
1495   [[xdate.time(date.mdy(11,10,2038) + time.hms(22,30,4))], [81004.00]],
1496   [[xdate.time(date.mdy(7,18,2094) + time.hms(1,56,51))], [7011.00]],
1497
1498   [[xdate.week(date.mdy(6,10,1648) + time.hms(0,0,0))], [24.00]],
1499   [[xdate.week(date.mdy(6,30,1680) + time.hms(4,50,38))], [26.00]],
1500   [[xdate.week(date.mdy(7,24,1716) + time.hms(12,31,35))], [30.00]],
1501   [[xdate.week(date.mdy(6,19,1768) + time.hms(12,47,53))], [25.00]],
1502   [[xdate.week(date.mdy(8,2,1819) + time.hms(1,26,0))], [31.00]],
1503   [[xdate.week(date.mdy(3,27,1839) + time.hms(20,58,11))], [13.00]],
1504   [[xdate.week(date.mdy(4,19,1903) + time.hms(7,36,5))], [16.00]],
1505   [[xdate.week(date.mdy(8,25,1929) + time.hms(15,43,49))], [34.00]],
1506   [[xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9))], [39.00]],
1507   [[xdate.week(date.mdy(4,19,1943) + time.hms(6,49,27))], [16.00]],
1508   [[xdate.week(date.mdy(10,7,1943) + time.hms(2,57,52))], [40.00]],
1509   [[xdate.week(date.mdy(3,17,1992) + time.hms(16,45,44))], [11.00]],
1510   [[xdate.week(date.mdy(2,25,1996) + time.hms(21,30,57))], [8.00]],
1511   [[xdate.week(date.mdy(9,29,1941) + time.hms(4,25,9))], [39.00]],
1512   [[xdate.week(date.mdy(4,19,43) + time.hms(6,49,27))], [16.00]],
1513   [[xdate.week(date.mdy(10,7,43) + time.hms(2,57,52))], [40.00]],
1514   [[xdate.week(date.mdy(3,17,92) + time.hms(16,45,44))], [11.00]],
1515   [[xdate.week(date.mdy(2,25,96) + time.hms(21,30,57))], [8.00]],
1516   [[xdate.week(date.mdy(11,10,2038) + time.hms(22,30,4))], [45.00]],
1517   [[xdate.week(date.mdy(7,18,2094) + time.hms(1,56,51))], [29.00]],
1518
1519   [[xdate.wkday(date.mdy(6,10,1648))], [4.00]],
1520   [[xdate.wkday(date.mdy(6,30,1680))], [1.00]],
1521   [[xdate.wkday(date.mdy(7,24,1716))], [6.00]],
1522   [[xdate.wkday(date.mdy(6,19,1768))], [1.00]],
1523   [[xdate.wkday(date.mdy(8,2,1819))], [2.00]],
1524   [[xdate.wkday(date.mdy(3,27,1839))], [4.00]],
1525   [[xdate.wkday(date.mdy(4,19,1903))], [1.00]],
1526   [[xdate.wkday(date.mdy(8,25,1929))], [1.00]],
1527   [[xdate.wkday(date.mdy(9,29,1941))], [2.00]],
1528   [[xdate.wkday(date.mdy(4,19,1943))], [2.00]],
1529   [[xdate.wkday(date.mdy(10,7,1943))], [5.00]],
1530   [[xdate.wkday(date.mdy(3,17,1992))], [3.00]],
1531   [[xdate.wkday(date.mdy(2,25,1996))], [1.00]],
1532   [[xdate.wkday(date.mdy(9,29,1941))], [2.00]],
1533   [[xdate.wkday(date.mdy(4,19,43))], [2.00]],
1534   [[xdate.wkday(date.mdy(10,7,43))], [5.00]],
1535   [[xdate.wkday(date.mdy(3,17,92))], [3.00]],
1536   [[xdate.wkday(date.mdy(2,25,96))], [1.00]],
1537   [[xdate.wkday(date.mdy(11,10,2038))], [4.00]],
1538   [[xdate.wkday(date.mdy(7,18,2094))], [1.00]],
1539
1540   [[xdate.year(date.mdy(6,10,1648) + time.hms(0,0,0))], [1648.00]],
1541   [[xdate.year(date.mdy(6,30,1680) + time.hms(4,50,38))], [1680.00]],
1542   [[xdate.year(date.mdy(7,24,1716) + time.hms(12,31,35))], [1716.00]],
1543   [[xdate.year(date.mdy(6,19,1768) + time.hms(12,47,53))], [1768.00]],
1544   [[xdate.year(date.mdy(8,2,1819) + time.hms(1,26,0))], [1819.00]],
1545   [[xdate.year(date.mdy(3,27,1839) + time.hms(20,58,11))], [1839.00]],
1546   [[xdate.year(date.mdy(4,19,1903) + time.hms(7,36,5))], [1903.00]],
1547   [[xdate.year(date.mdy(8,25,1929) + time.hms(15,43,49))], [1929.00]],
1548   [[xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9))], [1941.00]],
1549   [[xdate.year(date.mdy(4,19,1943) + time.hms(6,49,27))], [1943.00]],
1550   [[xdate.year(date.mdy(10,7,1943) + time.hms(2,57,52))], [1943.00]],
1551   [[xdate.year(date.mdy(3,17,1992) + time.hms(16,45,44))], [1992.00]],
1552   [[xdate.year(date.mdy(2,25,1996) + time.hms(21,30,57))], [1996.00]],
1553   [[xdate.year(date.mdy(9,29,1941) + time.hms(4,25,9))], [1941.00]],
1554   [[xdate.year(date.mdy(4,19,43) + time.hms(6,49,27))], [1943.00]],
1555   [[xdate.year(date.mdy(10,7,43) + time.hms(2,57,52))], [1943.00]],
1556   [[xdate.year(date.mdy(3,17,92) + time.hms(16,45,44))], [1992.00]],
1557   [[xdate.year(date.mdy(2,25,96) + time.hms(21,30,57))], [1996.00]],
1558   [[xdate.year(date.mdy(11,10,2038) + time.hms(22,30,4))], [2038.00]],
1559   [[xdate.year(date.mdy(7,18,2094) + time.hms(1,56,51))], [2094.00]])
1560
1561 CHECK_EXPR_EVAL([datediff],
1562   [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'years')], [-32.00]],
1563   [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'years')], [-36.00]],
1564   [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'years')], [-51.00]],
1565   [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'years')], [-51.00]],
1566   [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'years')], [-19.00]],
1567   [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'years')], [-64.00]],
1568   [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'years')], [-26.00]],
1569   [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'years')], [-12.00]],
1570   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'years')], [-1.00]],
1571   [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'years')], [0.00]],
1572   [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'years')], [-48.00]],
1573   [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'years')], [-3.00]],
1574   [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'years')], [-54.00]],
1575   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'years')], [-1.00]],
1576   [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'years')], [0.00]],
1577   [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'years')], [-48.00]],
1578   [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'years')], [-3.00]],
1579   [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'years')], [-42.00]],
1580   [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'years')], [-55.00]],
1581   [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'years')], [-3.00]],
1582   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'years')], [-4.00]],
1583   [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'years')], [-2.00]],
1584
1585   [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'quarters')], [-128.00]],
1586   [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'quarters')], [-144.00]],
1587   [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'quarters')], [-207.00]],
1588   [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'quarters')], [-204.00]],
1589   [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'quarters')], [-78.00]],
1590   [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'quarters')], [-256.00]],
1591   [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'quarters')], [-105.00]],
1592   [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'quarters')], [-48.00]],
1593   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'quarters')], [-6.00]],
1594   [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'quarters')], [-1.00]],
1595   [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'quarters')], [-193.00]],
1596   [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'quarters')], [-15.00]],
1597   [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'quarters')], [-217.00]],
1598   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'quarters')], [-6.00]],
1599   [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'quarters')], [-1.00]],
1600   [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'quarters')], [-193.00]],
1601   [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'quarters')], [-15.00]],
1602   [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'quarters')], [-170.00]],
1603   [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'quarters')], [-222.00]],
1604   [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'quarters')], [-15.00]],
1605   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'quarters')], [-16.00]],
1606   [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'quarters')], [-11.00]],
1607
1608   [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'months')], [-384.00]],
1609   [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'months')], [-432.00]],
1610   [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'months')], [-622.00]],
1611   [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'months')], [-613.00]],
1612   [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'months')], [-235.00]],
1613   [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'months')], [-768.00]],
1614   [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'months')], [-316.00]],
1615   [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'months')], [-145.00]],
1616   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'months')], [-18.00]],
1617   [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'months')], [-5.00]],
1618   [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'months')], [-581.00]],
1619   [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'months')], [-47.00]],
1620   [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'months')], [-652.00]],
1621   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'months')], [-18.00]],
1622   [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'months')], [-5.00]],
1623   [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'months')], [-581.00]],
1624   [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'months')], [-47.00]],
1625   [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'months')], [-512.00]],
1626   [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'months')], [-668.00]],
1627   [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'months')], [-47.00]],
1628   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'months')], [-48.00]],
1629   [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'months')], [-35.00]],
1630
1631   [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'weeks')], [-1672.00]],
1632   [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'weeks')], [-1881.00]],
1633   [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'weeks')], [-2708.00]],
1634   [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'weeks')], [-2667.00]],
1635   [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'weeks')], [-1025.00]],
1636   [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'weeks')], [-3342.00]],
1637   [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'weeks')], [-1375.00]],
1638   [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'weeks')], [-631.00]],
1639   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'weeks')], [-81.00]],
1640   [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'weeks')], [-24.00]],
1641   [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'weeks')], [-2527.00]],
1642   [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'weeks')], [-205.00]],
1643   [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'weeks')], [-2838.00]],
1644   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'weeks')], [-81.00]],
1645   [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'weeks')], [-24.00]],
1646   [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'weeks')], [-2527.00]],
1647   [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'weeks')], [-205.00]],
1648   [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'weeks')], [-2228.00]],
1649   [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'weeks')], [-2905.00]],
1650   [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'weeks')], [-208.00]],
1651   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'weeks')], [-208.00]],
1652   [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'weeks')], [-156.00]],
1653
1654   [[datediff(date.mdy(6,10,1648), date.mdy(6,30,1680), 'days')], [-11708.00]],
1655   [[datediff(date.mdy(6,30,1680), date.mdy(7,24,1716), 'days')], [-13172.00]],
1656   [[datediff(date.mdy(7,24,1716), date.mdy(6,19,1768), 'days')], [-18958.00]],
1657   [[datediff(date.mdy(6,19,1768), date.mdy(8,2,1819), 'days')], [-18670.00]],
1658   [[datediff(date.mdy(8,2,1819), date.mdy(3,27,1839), 'days')], [-7177.00]],
1659   [[datediff(date.mdy(3,27,1839), date.mdy(4,19,1903), 'days')], [-23398.00]],
1660   [[datediff(date.mdy(4,19,1903), date.mdy(8,25,1929), 'days')], [-9625.00]],
1661   [[datediff(date.mdy(8,25,1929), date.mdy(9,29,1941), 'days')], [-4418.00]],
1662   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,1943), 'days')], [-567.00]],
1663   [[datediff(date.mdy(4,19,1943), date.mdy(10,7,1943), 'days')], [-171.00]],
1664   [[datediff(date.mdy(10,7,1943), date.mdy(3,17,1992), 'days')], [-17694.00]],
1665   [[datediff(date.mdy(3,17,1992), date.mdy(2,25,1996), 'days')], [-1440.00]],
1666   [[datediff(date.mdy(9,29,1941), date.mdy(2,25,1996), 'days')], [-19872.00]],
1667   [[datediff(date.mdy(9,29,1941), date.mdy(4,19,43), 'days')], [-567.00]],
1668   [[datediff(date.mdy(4,19,43), date.mdy(10,7,43), 'days')], [-171.00]],
1669   [[datediff(date.mdy(10,7,43), date.mdy(3,17,92), 'days')], [-17694.00]],
1670   [[datediff(date.mdy(3,17,92), date.mdy(2,25,96), 'days')], [-1440.00]],
1671   [[datediff(date.mdy(2,25,96), date.mdy(11,10,2038), 'days')], [-15599.00]],
1672   [[datediff(date.mdy(11,10,2038), date.mdy(7,18,2094), 'days')], [-20339.00]],
1673   [[datediff(date.mdy(2,29,1900), date.mdy(2,29,1904), 'days')], [-1460.00]],
1674   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1908), 'days')], [-1461.00]],
1675   [[datediff(date.mdy(2,29,1900), date.mdy(2,28,1903), 'days')], [-1094.00]],
1676
1677   [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'years')], [32.00]],
1678   [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'years')], [36.00]],
1679   [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'years')], [51.00]],
1680   [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'years')], [51.00]],
1681   [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'years')], [19.00]],
1682   [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'years')], [64.00]],
1683   [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'years')], [26.00]],
1684   [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'years')], [12.00]],
1685   [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'years')], [1.00]],
1686   [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'years')], [0.00]],
1687   [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'years')], [48.00]],
1688   [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'years')], [3.00]],
1689   [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'years')], [54.00]],
1690   [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'years')], [1.00]],
1691   [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'years')], [0.00]],
1692   [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'years')], [48.00]],
1693   [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'years')], [3.00]],
1694   [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'years')], [42.00]],
1695   [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'years')], [55.00]],
1696   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'years')], [3.00]],
1697   [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'years')], [4.00]],
1698   [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'years')], [2.00]],
1699
1700   [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'months')], [384.00]],
1701   [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'months')], [432.00]],
1702   [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'months')], [622.00]],
1703   [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'months')], [613.00]],
1704   [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'months')], [235.00]],
1705   [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'months')], [768.00]],
1706   [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'months')], [316.00]],
1707   [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'months')], [145.00]],
1708   [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'months')], [18.00]],
1709   [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'months')], [5.00]],
1710   [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'months')], [581.00]],
1711   [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'months')], [47.00]],
1712   [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'months')], [652.00]],
1713   [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'months')], [18.00]],
1714   [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'months')], [5.00]],
1715   [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'months')], [581.00]],
1716   [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'months')], [47.00]],
1717   [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'months')], [512.00]],
1718   [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'months')], [668.00]],
1719   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'months')], [47.00]],
1720   [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'months')], [48.00]],
1721   [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'months')], [35.00]],
1722
1723   [[datediff(date.mdy(6,30,1680), date.mdy(6,10,1648), 'quarters')], [128.00]],
1724   [[datediff(date.mdy(7,24,1716), date.mdy(6,30,1680), 'quarters')], [144.00]],
1725   [[datediff(date.mdy(6,19,1768), date.mdy(7,24,1716), 'quarters')], [207.00]],
1726   [[datediff(date.mdy(8,2,1819), date.mdy(6,19,1768), 'quarters')], [204.00]],
1727   [[datediff(date.mdy(3,27,1839), date.mdy(8,2,1819), 'quarters')], [78.00]],
1728   [[datediff(date.mdy(4,19,1903), date.mdy(3,27,1839), 'quarters')], [256.00]],
1729   [[datediff(date.mdy(8,25,1929), date.mdy(4,19,1903), 'quarters')], [105.00]],
1730   [[datediff(date.mdy(9,29,1941), date.mdy(8,25,1929), 'quarters')], [48.00]],
1731   [[datediff(date.mdy(4,19,1943), date.mdy(9,29,1941), 'quarters')], [6.00]],
1732   [[datediff(date.mdy(10,7,1943), date.mdy(4,19,1943), 'quarters')], [1.00]],
1733   [[datediff(date.mdy(3,17,1992), date.mdy(10,7,1943), 'quarters')], [193.00]],
1734   [[datediff(date.mdy(2,25,1996), date.mdy(3,17,1992), 'quarters')], [15.00]],
1735   [[datediff(date.mdy(2,25,1996), date.mdy(9,29,1941), 'quarters')], [217.00]],
1736   [[datediff(date.mdy(4,19,43), date.mdy(9,29,1941), 'quarters')], [6.00]],
1737   [[datediff(date.mdy(10,7,43), date.mdy(4,19,43), 'quarters')], [1.00]],
1738   [[datediff(date.mdy(3,17,92), date.mdy(10,7,43), 'quarters')], [193.00]],
1739   [[datediff(date.mdy(2,25,96), date.mdy(3,17,92), 'quarters')], [15.00]],
1740   [[datediff(date.mdy(11,10,2038), date.mdy(2,25,96), 'quarters')], [170.00]],
1741   [[datediff(date.mdy(7,18,2094), date.mdy(11,10,2038), 'quarters')], [222.00]],
1742   [[datediff(date.mdy(2,29,1904), date.mdy(2,29,1900), 'quarters')], [15.00]],
1743   [[datediff(date.mdy(2,29,1908), date.mdy(2,29,1904), 'quarters')], [16.00]],
1744   [[datediff(date.mdy(2,28,1903), date.mdy(2,29,1900), 'quarters')], [11.00]],
1745
1746 dnl time of day is significant for DATEDIFF
1747   [[datediff(date.mdy(10,15,1910) + 234, date.mdy(10,10,1910) + 123, 'days')],
1748     [5.00]],
1749   [[datediff(date.mdy(10,15,1910) + 123, date.mdy(10,10,1910) + 234, 'days')],
1750     [4.00]],
1751   [[datediff(date.mdy(10,24,1910) + 234, date.mdy(10,10,1910) + 123, 'weeks')],
1752     [2.00]],
1753   [[datediff(date.mdy(10,24,1910) + 123, date.mdy(10,10,1910) + 234, 'weeks')],
1754     [1.00]],
1755   [[datediff(date.mdy(10,10,1910) + 234, date.mdy(5,10,1910) + 123, 'months')],
1756     [5.00]],
1757   [[datediff(date.mdy(10,10,1910) + 123, date.mdy(5,10,1910) + 234, 'months')],
1758     [4.00]],
1759   [[datediff(date.mdy(5,10,1919) + 234, date.mdy(5,10,1910) + 123, 'years')],
1760     [9.00]],
1761   [[datediff(date.mdy(5,10,1919) + 123, date.mdy(5,10,1910) + 234, 'years')],
1762     [8.00]],
1763
1764   [[datediff(date.mdy(10,10,1910) + 123, date.mdy(10,15,1910) + 234, 'days')],
1765     [-5.00]],
1766   [[datediff(date.mdy(10,10,1910) + 234, date.mdy(10,15,1910) + 123, 'days')],
1767     [-4.00]],
1768   [[datediff(date.mdy(10,10,1910) + 123, date.mdy(10,24,1910) + 234, 'weeks')],
1769     [-2.00]],
1770   [[datediff(date.mdy(10,10,1910) + 234, date.mdy(10,24,1910) + 123, 'weeks')],
1771     [-1.00]],
1772   [[datediff(date.mdy(5,10,1910) + 123, date.mdy(10,10,1910) + 234, 'months')],
1773     [-5.00]],
1774   [[datediff(date.mdy(5,10,1910) + 234, date.mdy(10,10,1910) + 123, 'months')],
1775     [-4.00]],
1776   [[datediff(date.mdy(5,10,1910) + 123, date.mdy(5,10,1919) + 234, 'years')],
1777     [-9.00]],
1778   [[datediff(date.mdy(5,10,1910) + 234, date.mdy(5,10,1919) + 123, 'years')],
1779     [-8.00]])
1780
1781 CHECK_EXPR_EVAL([datesum],
1782 dnl DATESUM with non-leap year
1783   [[ctime.days(datesum(date.mdy(1,31,1900), 1, 'months') - date.mdy(1,1,1900))], [58.00]],
1784   [[ctime.days(datesum(date.mdy(1,31,1900), 2, 'months') - date.mdy(1,1,1900))], [89.00]],
1785   [[ctime.days(datesum(date.mdy(1,31,1900), 3, 'months') - date.mdy(1,1,1900))], [119.00]],
1786   [[ctime.days(datesum(date.mdy(1,31,1900), 4, 'months') - date.mdy(1,1,1900))], [150.00]],
1787   [[ctime.days(datesum(date.mdy(1,31,1900), 5.4, 'months') - date.mdy(1,1,1900))], [180.00]],
1788   [[ctime.days(datesum(date.mdy(1,31,1900), 6, 'months') - date.mdy(1,1,1900))], [211.00]],
1789   [[ctime.days(datesum(date.mdy(1,31,1900), 7, 'months') - date.mdy(1,1,1900))], [242.00]],
1790   [[ctime.days(datesum(date.mdy(1,31,1900), 8, 'months') - date.mdy(1,1,1900))], [272.00]],
1791   [[ctime.days(datesum(date.mdy(1,31,1900), 9, 'months') - date.mdy(1,1,1900))], [303.00]],
1792   [[ctime.days(datesum(date.mdy(1,31,1900), 10, 'months') - date.mdy(1,1,1900))], [333.00]],
1793   [[ctime.days(datesum(date.mdy(1,31,1900), 11, 'months') - date.mdy(1,1,1900))], [364.00]],
1794   [[ctime.days(datesum(date.mdy(1,31,1900), 12, 'months') - date.mdy(1,1,1900))], [395.00]],
1795   [[ctime.days(datesum(date.mdy(1,31,1900), 13.9, 'months') - date.mdy(1,1,1900))], [423.00]],
1796   [[ctime.days(datesum(date.mdy(1,31,1900), 1, 'months', 'rollover') - date.mdy(1,1,1900))], [61.00]],
1797   [[ctime.days(datesum(date.mdy(1,31,1900), 2, 'months', 'rollover') - date.mdy(1,1,1900))], [89.00]],
1798   [[ctime.days(datesum(date.mdy(1,31,1900), 3.2, 'months', 'rollover') - date.mdy(1,1,1900))], [120.00]],
1799   [[ctime.days(datesum(date.mdy(1,31,1900), 4, 'months', 'rollover') - date.mdy(1,1,1900))], [150.00]],
1800   [[ctime.days(datesum(date.mdy(1,31,1900), 5, 'months', 'rollover') - date.mdy(1,1,1900))], [181.00]],
1801   [[ctime.days(datesum(date.mdy(1,31,1900), 6, 'months', 'rollover') - date.mdy(1,1,1900))], [211.00]],
1802   [[ctime.days(datesum(date.mdy(1,31,1900), 7, 'months', 'rollover') - date.mdy(1,1,1900))], [242.00]],
1803   [[ctime.days(datesum(date.mdy(1,31,1900), 8, 'months', 'rollover') - date.mdy(1,1,1900))], [273.00]],
1804   [[ctime.days(datesum(date.mdy(1,31,1900), 9, 'months', 'rollover') - date.mdy(1,1,1900))], [303.00]],
1805   [[ctime.days(datesum(date.mdy(1,31,1900), 10, 'months', 'rollover') - date.mdy(1,1,1900))], [334.00]],
1806   [[ctime.days(datesum(date.mdy(1,31,1900), 11, 'months', 'rollover') - date.mdy(1,1,1900))], [364.00]],
1807   [[ctime.days(datesum(date.mdy(1,31,1900), 12, 'months', 'rollover') - date.mdy(1,1,1900))], [395.00]],
1808   [[ctime.days(datesum(date.mdy(1,31,1900), 13, 'months', 'rollover') - date.mdy(1,1,1900))], [426.00]],
1809
1810 dnl DATESUM with leap year
1811   [[ctime.days(datesum(date.mdy(1,31,1904), 1, 'months') - date.mdy(1,1,1904))], [59.00]],
1812   [[ctime.days(datesum(date.mdy(1,31,1904), 2.5, 'months') - date.mdy(1,1,1904))], [90.00]],
1813   [[ctime.days(datesum(date.mdy(1,31,1904), 3, 'months') - date.mdy(1,1,1904))], [120.00]],
1814   [[ctime.days(datesum(date.mdy(1,31,1904), 4.9, 'months') - date.mdy(1,1,1904))], [151.00]],
1815   [[ctime.days(datesum(date.mdy(1,31,1904), 5.1, 'months') - date.mdy(1,1,1904))], [181.00]],
1816   [[ctime.days(datesum(date.mdy(1,31,1904), 6, 'months') - date.mdy(1,1,1904))], [212.00]],
1817   [[ctime.days(datesum(date.mdy(1,31,1904), 7, 'months') - date.mdy(1,1,1904))], [243.00]],
1818   [[ctime.days(datesum(date.mdy(1,31,1904), 8, 'months') - date.mdy(1,1,1904))], [273.00]],
1819   [[ctime.days(datesum(date.mdy(1,31,1904), 9, 'months') - date.mdy(1,1,1904))], [304.00]],
1820   [[ctime.days(datesum(date.mdy(1,31,1904), 10, 'months') - date.mdy(1,1,1904))], [334.00]],
1821   [[ctime.days(datesum(date.mdy(1,31,1904), 11, 'months') - date.mdy(1,1,1904))], [365.00]],
1822   [[ctime.days(datesum(date.mdy(1,31,1904), 12, 'months') - date.mdy(1,1,1904))], [396.00]],
1823   [[ctime.days(datesum(date.mdy(1,31,1904), 13, 'months') - date.mdy(1,1,1904))], [424.00]],
1824   [[ctime.days(datesum(date.mdy(1,31,1904), 1, 'months', 'rollover') - date.mdy(1,1,1904))], [61.00]],
1825   [[ctime.days(datesum(date.mdy(1,31,1904), 2, 'months', 'rollover') - date.mdy(1,1,1904))], [90.00]],
1826   [[ctime.days(datesum(date.mdy(1,31,1904), 3, 'months', 'rollover') - date.mdy(1,1,1904))], [121.00]],
1827   [[ctime.days(datesum(date.mdy(1,31,1904), 4, 'months', 'rollover') - date.mdy(1,1,1904))], [151.00]],
1828   [[ctime.days(datesum(date.mdy(1,31,1904), 5, 'months', 'rollover') - date.mdy(1,1,1904))], [182.00]],
1829   [[ctime.days(datesum(date.mdy(1,31,1904), 6, 'months', 'rollover') - date.mdy(1,1,1904))], [212.00]],
1830   [[ctime.days(datesum(date.mdy(1,31,1904), 7, 'months', 'rollover') - date.mdy(1,1,1904))], [243.00]],
1831   [[ctime.days(datesum(date.mdy(1,31,1904), 8, 'months', 'rollover') - date.mdy(1,1,1904))], [274.00]],
1832   [[ctime.days(datesum(date.mdy(1,31,1904), 9, 'months', 'rollover') - date.mdy(1,1,1904))], [304.00]],
1833   [[ctime.days(datesum(date.mdy(1,31,1904), 10, 'months', 'rollover') - date.mdy(1,1,1904))], [335.00]],
1834   [[ctime.days(datesum(date.mdy(1,31,1904), 11, 'months', 'rollover') - date.mdy(1,1,1904))], [365.00]],
1835   [[ctime.days(datesum(date.mdy(1,31,1904), 12, 'months', 'rollover') - date.mdy(1,1,1904))], [396.00]],
1836   [[ctime.days(datesum(date.mdy(1,31,1904), 13, 'months', 'rollover') - date.mdy(1,1,1904))], [427.00]],
1837
1838   [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'weeks') - date.mdy(6,10,1648))], [7.00]],
1839   [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'weeks') - date.mdy(6,30,1680))], [17.50]],
1840   [[ctime.days(datesum(date.mdy(7,24,1716), -3, 'weeks') - date.mdy(7,24,1716))], [-21.00]],
1841   [[ctime.days(datesum(date.mdy(6,19,1768), 4, 'weeks') - date.mdy(6,19,1768))], [28.00]],
1842   [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'weeks') - date.mdy(8,2,1819))], [35.00]],
1843
1844   [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'days') - date.mdy(6,10,1648))], [1.00]],
1845   [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'days') - date.mdy(6,30,1680))], [2.50]],
1846   [[ctime.days(datesum(date.mdy(7,24,1716), -3, 'days') - date.mdy(7,24,1716))], [-3.00]],
1847   [[ctime.days(datesum(date.mdy(6,19,1768), 4, 'days') - date.mdy(6,19,1768))], [4.00]],
1848   [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'days') - date.mdy(8,2,1819))], [5.00]],
1849   [[ctime.days(datesum(date.mdy(6,10,1648), 1, 'hours') - date.mdy(6,10,1648))], [0.04]],
1850   [[ctime.days(datesum(date.mdy(6,30,1680), 2.5, 'hours') - date.mdy(6,30,1680))], [0.10]],
1851   [[ctime.days(datesum(date.mdy(6,19,1768), -4, 'hours') - date.mdy(6,19,1768))], [-0.17]],
1852   [[ctime.days(datesum(date.mdy(8,2,1819), 5, 'hours') - date.mdy(8,2,1819))], [0.21]],
1853
1854 dnl DATESUM preserves time-of-day for units of days and longer.
1855   [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'days') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [5.00]],
1856   [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'weeks') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [35.00]],
1857   [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'months') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [153.00]],
1858   [[ctime.days(datesum(date.mdy(8,2,1819) + time.hms(1,2,3), 5, 'years') - (date.mdy(8,2,1819) + time.hms(1,2,3)))], [1827.00]])
1859
1860 CHECK_EXPR_EVAL([miscellaneous],
1861 dnl These test values are from Applied Statistics, Algorithm AS 310.
1862   [[1000 * ncdf.beta(.868,10,20,150)], [937.66]],
1863   [[1000 * ncdf.beta(.9,10,10,120)], [730.68]],
1864   [[1000 * ncdf.beta(.88,15,5,80)], [160.43]],
1865   [[1000 * ncdf.beta(.85,20,10,110)], [186.75]],
1866   [[1000 * ncdf.beta(.66,20,30,65)], [655.94]],
1867   [[1000 * ncdf.beta(.72,20,50,130)], [979.69]],
1868   [[1000 * ncdf.beta(.72,30,20,80)], [116.24]],
1869   [[1000 * ncdf.beta(.8,30,40,130)], [993.04]],
1870
1871 dnl FIXME: LAG
1872 dnl
1873   [[X], [1.00], [], [(X = 1.00)]],
1874   [[SYSMIS(1)], [false]],
1875   [[SYSMIS($SYSMIS)], [true]],
1876   [[SYSMIS(1 + $SYSMIS)], [true]],
1877
1878 dnl FIXME: out-of-range and nearly out-of-range values on dates
1879 dnl
1880 dnl Tests correctness of generic optimizations in optimize_tree().
1881   [[x + 0], [10.00], [], [(X = 10.00)]],
1882   [[x - 0], [-3.00], [], [(X = -3.00)]],
1883   [[0 + x], [5.00], [], [(X = 5.00)]],
1884   [[x * 1], [10.00], [], [(X = 10.00)]],
1885   [[1 * x], [-3.00], [], [(X = -3.00)]],
1886   [[x / 1], [5.00], [], [(X = 5.00)]],
1887   [[0 * x], [0.00], [], [(X = 10.00)]],
1888   [[x * 0], [0.00], [], [(X = -3.00)]],
1889   [[0 / x], [0.00], [], [(X = 5.00)]],
1890   [[mod(0, x)], [0.00], [], [(X = 5.00)]],
1891   [[x ** 1], [5.00], [], [(X = 5.00)]],
1892   [[x ** 2], [25.00], [], [(X = 5.00)]])
1893
1894 AT_SETUP([LAG function])
1895 AT_DATA([lag.sps], [dnl
1896 data list /W 1.
1897 begin data.
1898 1
1899 2
1900 3
1901 4
1902 5
1903 end data.
1904
1905 compute X=lag(w,1).
1906 compute Y=lag(x).
1907 compute Z=lag(w,2).
1908 list.
1909 ])
1910 AT_CHECK([pspp -o pspp.csv lag.sps])
1911 AT_CHECK([cat pspp.csv], [0], [dnl
1912 Table: Reading 1 record from INLINE.
1913 Variable,Record,Columns,Format
1914 W,1,1-  1,F1.0
1915
1916 Table: Data List
1917 W,X,Y,Z
1918 1,.  ,.  ,.  @&t@
1919 2,1.00,.  ,.  @&t@
1920 3,2.00,1.00,1.00
1921 4,3.00,2.00,2.00
1922 5,4.00,3.00,3.00
1923 ])
1924 AT_CLEANUP
1925
1926 AT_SETUP([LAG crash bug])
1927 AT_DATA([lag.sps], [dnl
1928 DATA LIST LIST /x.
1929 BEGIN DATA
1930
1931
1932 END DATA.
1933
1934 DO IF (x <> LAG(x) ).
1935         ECHO 'hello'.
1936 END IF.
1937
1938 EXECUTE.
1939 ])
1940 AT_CHECK([pspp -o pspp.csv lag.sps])
1941 AT_CHECK([cat pspp.csv], [0], [dnl
1942 Table: Reading free-form data from INLINE.
1943 Variable,Format
1944 x,F8.0
1945
1946 hello
1947 ])
1948 AT_CLEANUP
1949
1950 dnl Tests for a bug which caused UNIFORM(x) to always return zero.
1951 AT_SETUP([UNIFORM function])
1952 AT_DATA([uniform.sps], [dnl
1953 set seed=10.
1954 input program.
1955 + loop #i = 1 to 20.
1956 +    do repeat response=R1.
1957 +       compute response = uniform(10).
1958 +    end repeat.
1959 +    end case.
1960 + end loop.
1961 + end file.
1962 end input program.
1963
1964 list.
1965 ])
1966 AT_CHECK([pspp -o pspp.csv uniform.sps])
1967 AT_CHECK([cat pspp.csv], [0], [dnl
1968 Table: Data List
1969 R1
1970 7.71
1971 2.99
1972 .21
1973 4.95
1974 6.34
1975 4.43
1976 7.49
1977 8.32
1978 4.99
1979 5.83
1980 2.25
1981 .25
1982 1.98
1983 7.09
1984 7.61
1985 2.66
1986 1.69
1987 2.64
1988 .88
1989 1.50
1990 ])
1991 AT_CLEANUP
1992
1993 AT_SETUP([VALUELABEL function])
1994 AT_DATA([valuelabel.sps], [dnl
1995 DATA LIST notable /n 1 s 2(a).
1996 VALUE LABELS /n 0 'Very dissatisfied'
1997                 1 'Dissatisfied'
1998                 1.5 'Slightly Peeved'
1999                 2 'Neutral'
2000                 3 'Satisfied'
2001                 4 'Very satisfied'.
2002 VALUE LABELS /s 'a' 'Wouldn''t buy again'
2003                 'b' 'Unhappy'
2004                 'c' 'Bored'
2005                 'd' 'Satiated'
2006                 'e' 'Elated'.
2007 STRING nlabel slabel(a10).
2008 COMPUTE nlabel = VALUELABEL(n).
2009 COMPUTE slabel = VALUELABEL(s).
2010 LIST.
2011 BEGIN DATA.
2012
2013 0a
2014 1b
2015 2c
2016 3d
2017 4e
2018 5f
2019 6g
2020 END DATA.
2021 ])
2022 AT_CHECK([pspp -o pspp.csv valuelabel.sps])
2023 AT_CHECK([cat pspp.csv], [0], [dnl
2024 Table: Data List
2025 n,s,nlabel,slabel
2026 .,,,
2027 0,a,Very dissa,Wouldn't b
2028 1,b,Dissatisfi,Unhappy   @&t@
2029 2,c,Neutral   ,Bored     @&t@
2030 3,d,Satisfied ,Satiated  @&t@
2031 4,e,Very satis,Elated    @&t@
2032 5,f,,
2033 6,g,,
2034 ])
2035 AT_CLEANUP
2036
2037 AT_SETUP([variables in expressions])
2038 AT_DATA([variables.sps], [dnl
2039 DATA LIST NOTABLE/N1 TO N5 1-5.
2040 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
2041 BEGIN DATA.
2042 12345
2043 6789 
2044 END DATA.
2045
2046 COMPUTE P1=N1.
2047 COMPUTE P2=N2.
2048 COMPUTE P3=N3.
2049 COMPUTE P4=N4.
2050 COMPUTE P5=N5.
2051
2052 COMPUTE MC=NMISS(N1 TO N5).
2053 COMPUTE VC=NVALID(N1 TO N5).
2054
2055 COMPUTE S1=SYSMIS(N1).
2056 COMPUTE S2=SYSMIS(N2).
2057 COMPUTE S3=SYSMIS(N3).
2058 COMPUTE S4=SYSMIS(N4).
2059 COMPUTE S5=SYSMIS(N5).
2060
2061 COMPUTE M1=MISSING(N1).
2062 COMPUTE M2=MISSING(N2).
2063 COMPUTE M3=MISSING(N3).
2064 COMPUTE M4=MISSING(N4).
2065 COMPUTE M5=MISSING(N5).
2066
2067 COMPUTE V1=VALUE(N1).
2068 COMPUTE V2=VALUE(N2).
2069 COMPUTE V3=VALUE(N3).
2070 COMPUTE V4=VALUE(N4).
2071 COMPUTE V5=VALUE(N5).
2072
2073 FORMATS ALL (F1).
2074
2075 LIST.
2076 ])
2077 AT_CHECK([pspp -o pspp.csv variables.sps])
2078 AT_CHECK([cat pspp.csv], [0], [dnl
2079 Table: Data List
2080 N1,N2,N3,N4,N5,P1,P2,P3,P4,P5,MC,VC,S1,S2,S3,S4,S5,M1,M2,M3,M4,M5,V1,V2,V3,V4,V5
2081 1,2,3,4,5,.,2,.,.,.,4,1,0,0,0,0,0,1,0,1,1,1,1,2,3,4,5
2082 6,7,8,9,.,6,7,8,9,.,1,4,0,0,0,0,1,0,0,0,0,1,6,7,8,9,.
2083 ])
2084 AT_CLEANUP
2085
2086 AT_SETUP([vectors in expressions])
2087 AT_DATA([vectors.sps], [dnl
2088 DATA LIST NOTABLE /N1 TO N5 1-5.
2089 MISSING VALUES N1 TO N5 (3 THRU 5, 1).
2090 BEGIN DATA.
2091 12345
2092 6789 
2093 END DATA.
2094
2095 VECTOR N=N1 TO N5.
2096 VECTOR X(5).
2097 LOOP I=1 TO 5.
2098 COMPUTE X(I)=N(I) + 1.
2099 END LOOP.
2100
2101 FORMATS ALL (F2).
2102
2103 LIST.
2104 ])
2105 AT_CHECK([pspp -o pspp.csv vectors.sps])
2106 AT_CHECK([cat pspp.csv], [0], [dnl
2107 Table: Data List
2108 N1,N2,N3,N4,N5,X1,X2,X3,X4,X5,I
2109 1,2,3,4,5,.,3,.,.,.,5
2110 6,7,8,9,.,7,8,9,10,.,5
2111 ])
2112 AT_CLEANUP