Conditions :
1.Only one record for each account in the output.
2.If the account has 0000000 in both the fields of Field5(986 and 987), the account should be exculded. (Example Field1 12345)
3.the account should have Date4 > 15 Days
4.If the account dont have 30F then record should be excluded (Example Field1 12348)
Output I should have following fields in edited format with CSV.
FIELD1 FIELD2(30F) DATE3(Derived field) DATE2(99 FIELD2) DATE4(should be in Days format).
IS it correct to have KEYBEGIN and BEGIN or do we have any other method to push the record to the last record of the account
example
Is there way in the sort to add months from the give date in format (CYYDDD)
Is there way in the sort to find the day's difference from the give date format (CYYDDD)
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Fri Feb 16, 2018 9:18 pm Post subject:
Magesh_J,
You cannot use both BEGIN and KEYBEGIN at the same time. If I understand your requirement correctly then you can do it differently. Also looks like your dates are of really weird format like in this topic
Thanks for the code. Sorry I should have informed you this in my first post.
The reason why asking for keybegin and begin is because i need to end the push when the key is changed.
kolusu wrote:
You cannot use both BEGIN and KEYBEGIN at the same time. If I understand your requirement correctly then you can do it differently
I need to group the record for every key, the following push statement will push records until it finds the next 986 or 987
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Mon Feb 19, 2018 12:15 pm Post subject:
Magesh_J,
The issue is NOT with the push, but the missing the 986/987 record. You can end the push on OUTREC with (29,3,CH,EQ,C'99')
Since there is no 986/987 record and 30F record is present we are picking it up.
Do you need to drop off those records which don't have a 986, AND 987 record? ie. every group should have a 986 and 987 record. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Mon Feb 19, 2018 12:27 pm Post subject:
Magesh_J,
Here are the updated control cards. Instead of checking if the values are 0, check for NOT EQUAL to 0 and then you can validate them. I used a value of 1 and 2 for push so that it is easy to validate on OUTFIL
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Mon Feb 19, 2018 5:00 pm Post subject:
Magesh_J wrote:
Hi Kolusu,
Modified your code little working great.
Magesh_J
Glad It worked.
Are you always sure that your dates are always between 2000-2099? If not then may be you need to first expand the PD date to a readable format and validate the first Byte using CHANGE command to set the year to 19 when it is 1 and 20 when it is 2 and then 21 when it is 3 and so on. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Tue Feb 20, 2018 1:02 pm Post subject:
Magesh_J wrote:
Hi Kolusu,
They are looking for only 2013 data.
1913 - Application was not designed
2113 - 95 years more.
So no issues, thanks for the kind support and help.
Regards,
Magesh
Magesh it is not issue with available data, but your goal is to design solutions that are error free and fool proof. So even if someone accidentally created a date that extends in 21xx, your control cards needs to handle that. _________________ Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12359 Topics: 75 Location: San Jose
Posted: Tue Feb 20, 2018 3:31 pm Post subject:
Magesh_J,
I think adding 18 to the century portion is much better than having a CHANGE command.
Expand the CYYDDD with as 0CYYDDD and then add 18 to 0C portion to get the century portion.
So if your C is 1 then adding 18 would make it 19 and if C is 2 then adding 18 would make it 20 and so on. So you never have to change the control cards ever.
So change the last IFTHEN on OUTREC to the following
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum