Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
Regression testing of date format conversion

Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message

Senior Member

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

PostPosted: Fri Jan 11, 2019 5:39 am    Post subject: Regression testing of date format conversion
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 hh.mm 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 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:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1


Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts EBCDIC to ASCII conversion help t_bt2 All Other Mainframe Topics 1 Wed Sep 23, 2020 6:34 pm
No new posts Required Date Format in Include Sort ... vivky_vivek DFSORT/ICETOOL 6 Fri Aug 14, 2020 6:52 am
No new posts Trying to add current date in place o... shub2204 DFSORT/ICETOOL 8 Wed Aug 12, 2020 4:14 pm
No new posts Populating Date and Sequence numer in... PORYES SYNCSORT 11 Thu Jul 16, 2020 5:01 pm
No new posts How to filter out certain records bas... manugeorge2004 JCL & VSAM 5 Wed Jun 17, 2020 10:05 pm

Back to Top
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us