View previous topic :: View next topic
|
Author |
Message |
ravi_k03
New User
Joined: 13 Mar 2010 Posts: 1 Location: Pune
|
|
|
|
Hi Frank,
Following is my Requirement.
I have a file of LRECL=114 bytes. I have to perform a series of Sort steps on this file in order to get the final file.
Layout of file and a sample record are as follows
Tken Number(20)|Owner Name(24)|id(4)|Card number(20)| Policy numb(25)|Branch code(2)|Agent(3)|Currency(3)|Date(4 in PD)|Table code(9)
1234567897845| Ravi Kavrani | 3454 | 3243432443434 | 23123214141 | PN | ABC | GBP | 2131 | 5PQWERT
Now i have to filter this file on five different Fields. Input will given thorugh JCL Override and the sorting steps should be written in a Proc. These inputs are user defined and the user may or may not specify them...
1) At first step the input file should be filtered on the Basis of Table Code provided as input through JCL override. The filtered file will be input to the next step. I am
If the input is not provided then entire input file should be copied to input file of next step.
2) In the next step, The filtered file will be filtered further on the basis of currency code.
3) The third filter is the one which is causing the most problem. In this filter input will be Date or a range of dates. Now the Date on my input file is Fixed Dec(7) which PD field of 4 bytes. The user may give a date or a Range of Dates based on which filtering needs to be done. But the Date will be input as YYYYMMDD or YYYY/MM/DD. I need to first convert it to PD and then based on the input, Single Date or Range of Dates, i need to produce the output. I am not able to get this filter.
4) Next filter will on Branch code.
5) Next filter will be on combination of Branch and agent id.
After all these filters , the final sorting is to arrange the records in ascending order of policy numbers... I am able to get the 1,2,4 and 5 filter, but i am not able to code the third filter based on premiumDates .. as it has two possibilities.. single dat and range of dates.. Can u tell me any icetool or dfsort step.. which will achieve that...
Thanks,
Ravi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Hopefully, i misunderstand the approach being taken. . .
If this is being done with 5 separate processes, the approach needs to be re-thought. There is no good reason to pass the filtered data 5 times to eventually get to the needed output. . .
If the other filtering code is understood, i do not understand why the "3rd" filter is a problem. Why can't the process determine if one or two values are present and filter accordingly.
If you post the jcl and control statements (for the entire process) written so far, someone may have a suggestion. |
|
Back to top |
|
|
nelson.pandian
Active User
Joined: 09 Apr 2008 Posts: 133 Location: Phoenix, AZ
|
|
|
|
Hi Ravi,
You have given the Rules to achieve output. But you have not posted the output data how you want.
Kindly show us the the example of your INPUT & OUTPUT date and User Input for at least for 3 step.
Is there any specific reason to use different steps for each requirement? Why cont you reduce the steps to try to achieve in single pass? |
|
Back to top |
|
|
|