#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <time.h>
#include <unistd.h>
#include "u8-mbtouc.h"
printf("<datafile>%s</datafile>\n", get_string());
match_u32_assert(0);
- get_u32();
+
+ time_t date = get_u32();
+ struct tm tm = *localtime(&date);
+ char s[128];
+ strftime(s, sizeof s, "%a, %d %b %Y %H:%M:%S %z", &tm);
+ printf("<date>%s</date>\n", s);
+
match_u32_assert(0);
}
}
(00 @math{|} 01) 00 (00 @math{|} 01) (00 @math{|} 01)
int[@t{epoch}]
byte[@t{decimal}] byte[@t{grouping}]
- byte*8 01
- (string[@t{dataset}] string[@t{data file}] i0 int i0)?
+ (2d 43 1c eb e2 36 1a 3f | 00*8) 01
+ (string[@t{dataset}] string[@t{datafile}] i0 int[@t{date}] i0)?
int[@t{n-ccs}] string*[@t{n-ccs}]
2e (00 @math{|} 01) (i2000000 i0)?
@end format
@code{epoch} is the year that starts the epoch. A 2-digit year is
interpreted as belonging to the 100 years beginning at the epoch. The
default epoch year is 69 years prior to the current year; thus, in
-2017 this field by default contains 1948. In the corpus, @t{epoch}
+2017 this field by default contains 1948. In the corpus, @code{epoch}
ranges from 1943 to 1948, plus some contain -1.
@code{decimal} is the decimal point character. The observed values
@samp{'} (apostrophe), @samp{ } (space), and zero (presumably
indicating that digits should not be grouped).
+@code{dataset} is the name of the dataset analyzed to produce the
+output, e.g.@: @code{DataSet1}, and @code{datafile} the name of the
+file it was read from, e.g.@: @file{C:\Users\foo\bar.sav}. The latter
+is sometimes the empty string.
+
+@code{date} is a date, as seconds since the epoch, i.e.@: since
+January 1, 1970. Pivot tables within an SPV files often have dates a
+few minutes apart, so this is probably a creation date for the tables
+rather than for the file.
+
+Sometimes @code{dataset}, @code{datafile}, and @code{date} are present
+and other times they are absent. The reader can distinguish by
+assuming that they are present and then checking whether the
+presumptive @code{dataset} contains a null byte (a valid string never
+will).
+
@code{n-ccs} is observed as either 0 or 5. When it is 5, the
following strings are CCA through CCE format strings. @xref{Custom
Currency Formats,,, pspp, PSPP}. Most commonly these are all