I ended up doing the above using a job. So I have a hash file now (Time_D_Keys) with only one column, which is a key (according to the imported DS UniVerse def.) BUT...
I populate this hash file with a routine:
Code: Select all
FileNameOnDisk = "Time_D_Keys"
open FileNameOnDisk to TimeDimHash else
print 'ERROR: Unable to open ' : FileNameOnDisk : '!'
stop
end
clearfile TimeDimHash
* StartDate is an arg with YYYY-MM-DD HH:MM:SS format.
DateInt = Iconv(MatchField(StartDate,"0X' '2N':'2N':'2N",1),"D-YMD[4,2,2]")
* NumCycles gets a + 1 at the end because the date range is inclusive
NumCycles = Iconv(MatchField(EndDate,"0X' '2N':'2N':'2N",1),"D-YMD[4,2,2]") - DateInt + 1
for i = 1 to NumCycles
rec = ''
rec = convert(" ", "", oconv(DateInt,'DYMD[4,2,2]'))
write rec on TimeDimHash, i else
print 'ERROR: Unable to write to ' : FileNameOnDisk : '!'
stop
end
DateInt += 1
next i
close TimeDimHash
Ans = 0
return(Ans)
When this routine has run, the column in the hash file contains the record number. When I add another column into the UV dictionary like this...
Code: Select all
INSERT INTO DICT Time_D_Keys(@ID, F1, LOC, FORMAT) VALUES ('TestColumn', 'D', 2, '8L');
...then I see the date values in the second column (TestColumn), but that's not what I want. I need the column with the date values to be a key.