+ return $_[int (my_rand ($#_
+ + 1))];
+}
+EOF
+}
+time_in () {
+ data_in_prng
+ cat > time-in.pl << 'EOF'
+#! /usr/bin/perl
+
+use strict;
+use warnings;
+
+do 'my-rand.pl';
+
+my ($skip, $fmt_name, @templates) = @ARGV;
+
+my_rand (1) foreach 1...$skip;
+
+my @times = (# D HH MM SS
+ [ 0, 0, 0, 0.00],
+ [ 1, 4, 50, 38.68],
+ [ 5, 12, 31, 35.82],
+ [ 0, 12, 47, 53.41],
+ [ 3, 1, 26, 0.69],
+ [ 1, 20, 58, 11.19],
+ [ 12, 7, 36, 5.98],
+ [ 52, 15, 43, 49.27],
+ [ 7, 4, 25, 9.24],
+ [ 0, 6, 49, 27.89],
+ [ 20, 2, 57, 52.56],
+ [555, 16, 45, 44.12],
+ [120, 21, 30, 57.27],
+ [ 0, 4, 25, 9.98],
+ [ 3, 6, 49, 27.24],
+ [ 5, 2, 57, 52.13],
+ [ 0, 16, 45, 44.35],
+ [ 1, 21, 30, 57.32],
+ [ 10, 22, 30, 4.27],
+ [ 22, 1, 56, 51.18]);
+
+open (SYNTAX, '>', "$fmt_name.sps") or die "$fmt_name.sps: create: $!\n";
+print SYNTAX "DATA LIST NOTABLE FILE='$fmt_name.data'/$fmt_name 1-40 ($fmt_name).\n";
+print SYNTAX "PRINT OUTFILE='$fmt_name.out'/$fmt_name (F16.2).\n";
+print SYNTAX "EXECUTE.\n";
+close (SYNTAX);
+
+my ($fn) = "$fmt_name.data";
+open (DATA, '>', $fn) or die "$fn: create: $!\n";
+select DATA;
+for my $template (@templates) {
+ for my $time (@times) {
+ print_time_with_template ($time, $template) for 1...10;
+ }
+}
+close (DATA);
+
+sub print_time_with_template {
+ my ($time, $template) = @_;
+ my ($day, $hour, $minute, $second) = @$time;
+ for my $c (split ('', $template)) {
+ if ($c eq '+') {
+ print +pick ('', '-', '+');
+ } elsif ($c eq 'D') {
+ printf (+pick ('%d', '%02d'), $day);
+ $day = 0;
+ } elsif ($c eq 'H') {
+ printf (+pick ('%d', '%02d'), $hour + 24 * $day);
+ } elsif ($c eq 'M') {
+ printf (+pick ('%d', '%02d'), $minute);
+ } elsif ($c eq 'S') {
+ printf (+pick ('%.0f', '%02.0f', '%.1f', '%.2f'), $second);
+ } elsif ($c eq ':') {
+ print +pick (' ', ':');
+ } elsif ($c eq ' ') {
+ print ' ';
+ } else {
+ die;
+ }
+ }
+ print "\n";
+}
+
+sub pick {
+ return $_[int (my_rand ($#_
+ + 1)) ];