The first three positions on column A should be considered as key,I meant every column B record should be attached to these three of column A.
Every number on column B(52,54,57,52,92) has special meaning attached.
The situation which I need to capture is any value which first starts with 52 and then changes to 54 then no necessarly 57(it may or may not),the before it gets value 92 it will always have value 52 occuring in file prior to that.Please note there could be n number of other values can occur in colum B but that will always start with 52.
Also there could be n number of records present in colum A.like in the above example there are 5 values present for value 123 whereas 6 records are for 124.
I want the output file should have value like
123 52
123 54
123 52
123 92
124 52
124 54
124 52
124 92
and so on..
The whole day I keep on thinking what to do to get this file..but I found myself trapped..so thought to check with you experts...I hope I was clear while stating the problem..please provide your input or let me know if this information is not suficient to proceed with...
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
Hello,
Please post a more inclusive set of sample data. Some that have both the 52 and the 54 and some that do not and how the output shoud be created for this expanded set of sample data.
What if the first value is not 52? What if there is no 54? Etc. . .
The requirement may be as Sambhaji assumed, but your explanation appears to have more "rules" than merely including all of the records with the 4 values. Possibly i misunderstand. . .
I have redone the data and included some more description to make my case clear
Hope this clears out.Just to add the column a and b data types are packed(which I missed to add)
Situation 1
123 52(marker activity you can think like application file)
123 54 (second marker activity application rejected)
123 57 (some mid activities to do some verification for why got rejected)
123 52 (same marker activity re-appliation)
123 92 (application approved)
I want to capture this situation 1 in output..
Sambhaji,
The fault was at my side probably I did not stated well...
Situation 2
124 52 (marker activity you can think like application file)
124 54 (second marker activity application rejected)
124 57 (some mid activities to do some verification for why got rejected)
124 62(some other activity to do additional check why got rejected)
124 52 (same marker activity re-appliation)
124 54 (again rejected)
124 57 (some mid activities to do some verification for why got rejected)
124 62(some other activity to do additional check why got rejected)
124 63(additional checking same as above)
124 52(same marker activity application refiled)
124 92 (application approved)
I want to captue situation 2 in putput
Situation 3
123 52(marker activity you can think like application file)
123 92(application approved)
this situation is quiet normal means aplication file and approved so I do not want to capture this.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
raghavmcs,
If I understood your requirement correctly you just want all the accounts which have multiple activity and within the multiple activity you just want to pick the first activity and the close activity (92). What happens if there is an account with multiple activity but no ending 92 activity? Do you need to pick this account in output?
I need the following details.
1. What is the lrecl and recfm of input file?
2. What is the position, length and format of column a and column B?
3. What is the lrecl and recfm of output file?
If there is no end activity for 92 then that should not be captured
LRECL of input file 221
starting position of column a is 6 and the data type is s9(18) comp-3
starting position of field b on file is 34 and type is s9(5) comp-3
lrecl of the out put file is 221 there will be no layout chagne in output file means the layout would remain same as of input file
Just to add as I said there could be n number of records for situation-1 and situation-2 but yes the pattern I am looking for will be same as explained in situation-1 and situation-2
It was really a complex requirement which I got to work on,rather more than what I would have anticipated and really tough to meet the timeline.
I used you logic and used couple of more sort and finally a easytrieve file matching logic was able to come up with that what was needed bu business.
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
raghavmcs wrote:
Thanks Skulosu!!
It was really a complex requirement which I got to work on,rather more than what I would have anticipated and really tough to meet the timeline.
I used you logic and used couple of more sort and finally a easytrieve file matching logic was able to come up with that what was needed bu business.
Thanks!!
raghavmcs,
Unless you haven't given me all the requirement , I don't see as to why you need additional sorts and on top of it an easytrieve program to perform the match