Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all articles
Browse latest Browse all 8500

All Other Mainframe Topics :: Need help in building a logic

$
0
0
Author: Benchwarmer
Subject: Need help in building a logic
Posted: Wed Feb 22, 2017 2:49 am (GMT 5.5)

I am working on a logic which is to assign a unique ID for records matched using a date and flag (Y/N).

It has following rules to assign a unique number

1. If date match
2. If Year in the date match with either month or day along with flag
3. If month and day match with difference in year is 1 along with flag

Initially we assigned unique numbers for a set of records. Now any population comes after need to be matched against the existing population to determine the unique ID.

But am unable to determine how to handle certain situations

e.g., Record from set1 with date 01/17/2017 and flag 'N' is assigned a unique value 008

New population comes in with date and flag as.
Code:
01/01/2017 Y
01/17/2017 Y


Based on the sequence and matching logic record 1 is not matching with any previous record and assigned a unique value 009, when record 2 is processed it matched with two unique value 008 & 009.

Ideally both the records should have to match with 008.

Any pointers would be helpful.

Thanks


Viewing all articles
Browse latest Browse all 8500

Trending Articles