I have a rather interesting request in hand, and I was wondering if it could be completed using DFSORT or ICETOOL , which would save me the hassle of making a program for such an easy task.
My request is:
I have a file with a lots of records, with this fields
Office
Date
Begining amount
Ending Amount
Incoming amount
Outcoming amount
Well, the things is, the input file has many recors, and only the first record, the one for the date 2009-01-02 has the begining and ending amount informed for each office. I don't have this field for the rest of the year dates. I need to process movements from a series of files with a wide range of dates, let's say, a year. It is needed to build an initial stat.
I need to sort the records in ASC order by the OFFICE and DATE Fields, but the tricky part is that the next begining and endind record have to be calculated from the previous record like this:
New Record Begining Amount = Previous Record endind amount
The Ending Amount for that new record would be calculated like this:
I could easily calculate the new value for ending amount in an outrec step, bu't I'd like to know is there is a way to do all this in a single step through the usage of DFSORT or ICETOOL.
The File specs are not defined yet, but what is certain is that the input file is FB Format, and the OFFICE and DATE Fields are 4 annd 10 CH in length, and the amount fields are 17 bytes ZD length. Let's assume the whole record length is 150 bytes, it doesn't really matters at this point.
Any hints or possibility to do this. I don't know if I can move a field from the previous record to the next one.
As usual, thanks a lot for your support.
I'm sorry if something is not clear enough. I'll Provide more info if needed
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
Ojdiaz,
The following DFSORT/ICETOOL JCL will give you the desired results.
The assumed the following
You dont have the header of 2 as shown in your same output.
1. Begin amount starts in pos 17 for 17 bytes
2. End amount starts in pos 35 for 17 bytes
3. Incoming amount starts in pos 53 for 17 bytes
4. Outcoming amount starts in pos 71 for 17 bytes
Could you please clarify what do you mean when you say:
Quote:
You dont have the header of 2 as shown in your same output.
What I Like about this forum is that each day I learn new stuff. I haven't used before some of the options of the outfil that you used, So I'll use and test the code and I'll try to understand it entirely and I'll let you know the results
Oh!!! Taht's right! I'm sorry if it was a silly question. Indeed those two records are not in my input file. I wrote them just for explanation purposes.
I'll keep workinig on this and I'll let you know the results as soon as posible