Portal | Manuals | 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: 1161
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 Convert string to packed format ajaydwivedi4u COBOL Programming 1 Sat Sep 21, 2019 5:01 pm
No new posts Pack to Unpack conversion for sending... A_programmers COBOL Programming 13 Wed Sep 11, 2019 10:46 pm
No new posts Date insertion returns -180 Raghu navaikulam CICS 1 Mon Jul 29, 2019 5:12 pm
This topic is locked: you cannot edit posts or make replies. Need to write the date at the end of ... Poha Eater DFSORT/ICETOOL 16 Tue Jul 23, 2019 2:33 pm
No new posts Converting a copybook value into Json... srikant314 COBOL Programming 1 Mon Jun 03, 2019 11:17 am

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