IBM Mainframe Forum Index
Log In
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register

Regression testing of date format conversion

IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Warnings : 1

Senior Member

Joined: 07 Feb 2009
Posts: 1263
Location: Vilnius, Lithuania

PostPosted: Fri Jan 11, 2019 5:39 am
Reply with quote

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 to hh:mm, and as the output did not contain any other colons, a simple SuperC
nchgt ':','.'

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 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:
worksize 262144
cmpcolm 1:41 52:121
ny2c 42:51 yyyysmmsdd
oy2c 42:51 ddsmmsyyyy
ochgt 'Date      ','     e  Da'

An explanation?
  • 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 icon_lol.gif
  • 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
  • Code:
    ochgt 'Date      ','     e  Da'
    changes the header to the column that contains the dates, for the dataset with old format dates
The 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!)

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.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CLIST & REXX


Similar Topics
Topic Forum Replies
No new posts SORT for dynamic trailer record + CSV... DFSORT/ICETOOL 14
No new posts Date conversation DFSORT/ICETOOL 6
No new posts To pull the file with Date and Time u... TSO/ISPF 17
No new posts Help this REXX Rookie-Bad arithmetic ... CLIST & REXX 7
No new posts Connect:Direct Add yesterday date in ... All Other Mainframe Topics 3
Search our Forums:

Back to Top