Warnings : 1
Joined: 07 Feb 2009
Location: Vilnius, Lithuania
|I've got an exec that runs in batch and that does regression testing of a program. The differences found, the exec runs SuperC to compare the output datasets from multiple versions of the program, are saved, and so is the SuperC output, which is later massaged by another exec/edit macro to summarize the changes.
So far so good...
At one stage the format of times in the output was changed from hh.mm to hh:mm, and as the output did not contain any other colons, a simple SuperC
process statement would mask these changes, eliminating a substantial amount of output.
Again, so far so good...
When the above change was made, we also made another change, to the format of dates, they went from dd.mm.yyyy to yyyy-mm-dd (ISO 8601), and at the time we accepted that this would generate differences that weren't really differences, but due to the fact that there weren't all that many dates in the output, we never bothered to do something about this...
However, given that the regression testing now produces way more output, and that two of the output datasets in each set of seven contains a date one virtually every line of output, I've decided to do something about it, and for those two particular datasets it turned out that SuperC's Y2K options allow me to completely mask the differences, by using the following process statements:
cmpcolm 1:41 52:121
ny2c 42:51 yyyysmmsdd
oy2c 42:51 ddsmmsyyyy
ochgt 'Date ',' e Da'
- worksize is a (semi-)undocumented option of SuperC that gives it more storage, potentially speeding up compares, I use it as a default, and it has nothing to do with the problem
- cmpcolm tells SuperC the columns to compare, in this case those that do not contain dates
- ny2c 42:51 yyyysmmsdd tells Superc that the new format dates are in character format, in the specified colums, and with Separators
- oy2c 42:51 ddsmmsyyyy tells Superc that the old format dates are in character format, in the specified colums, and with Separators
changes the header to the column that contains the dates, for the dataset with old format datesThe last process statement was the key to eliminating the last difference, as SuperC will assume the header also to be a date, and when it internally reformats it to the selected masks, there is obviously a difference... (Try it yourself!)
|ochgt 'Date ',' e Da'
Again, so far so good, and as it's now 1:05 and I'm tired, I will continue later, but I hope someone can use parts of the above to their advantage.