Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
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
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1168
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
Code:
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:
Code:
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 Bad arithmetic conversion when assign... Ajay Baghel CLIST & REXX 4 Tue Nov 26, 2019 11:29 am
No new posts IMS DB / DB2 simulator for ETL testin... dejames IMS DB/DC 1 Thu Nov 21, 2019 12:37 pm
No new posts Convert mainframe data to .csv format... karan_reddy DFSORT/ICETOOL 10 Sat Nov 02, 2019 2:09 am
No new posts Parsing single liner XML into readabl... rohanthengal COBOL Programming 1 Fri Oct 18, 2019 8:41 pm
No new posts String to ASCII conversion JPLMARTINS COBOL Programming 4 Sun Sep 29, 2019 12:00 am

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