View previous topic :: View next topic
|
Author |
Message |
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Hi,
I have to create a report every month which will have 12 months rolling history.
The file for this report is generated every month and it has data of previous two months, my task is to produce a report every month which will have the data of all previous months. Like--
The report to be produced in August should have data of all the previous months till now. But the file which will be generated in August will have data of June and July only. I need to append the data to the file always.
Example--
F1--created in Feb; has Jan's data
F2--created in March; has Feb's and Jan's data
F3--created in April; has March, Feb's data; need to Append F2 to get Jan's data and eliminate duplicates
F4--created in May; has April's, March's data; need to Append F3 to get previous data and eliminate duplicates.
On the 13th month the oldest file would be deleted and there should be another job to purge it.
I am planning create a GDG of 12 limit.
Please let me know while coding what all steps i have to take.
Thanks. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
I'd suggest changing your plan to place data from 2 months in the same file. There is no good reason to do this.
If you correct this design, what you want to do becomes trivial.
"Things" that need one month's data use that file. Things that might need 2 or 3 month's data, use 2 or 3 files. The report that needs the rolling 12 months data would concatenate gerneration (0) thru (-11).
I would probably keep more than 12 generations. |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks for the prompt reply.
Could you please explain this in some other way, it's is not very clear to me.
I can change the design, requirement i have put before you. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Create a file each month that has data from only one month.
Use them as needed in whatever processes will create reports.
If you create files with data from only one month, you do not need to be concerned with getting rid of the duplicates caused by the overlapping data. |
|
Back to top |
|
|
the_gautam
Active User
Joined: 05 Jun 2005 Posts: 165 Location: Bangalore
|
|
|
|
As dick scherrer said,
after getting all the data in different files according to the month. you may use the required month data for processing the reports as per the requirement by concatenating the files of those months. |
|
Back to top |
|
|
sedireswarapu
New User
Joined: 18 Jun 2008 Posts: 28 Location: India
|
|
|
|
Hi Meenakshi,
I had a requisite where i had to create a report having current month' s data of individuals & their year-to-date data (total of their 12 months data in the current year).
I did it in the following way,
- Sort the input based on the key fields of the individuals (the input has only current month's data).
- Create a vsam file with those key fields and other required fields, and a TOTALS that occurs 13 times (one for each month & the 13th for year-to-date).
- Read the input file, accumulate the totals of all the records belonging to the same individuals in the appropriate occurrence of TOTALS (can be identified from the current month of the date). Write the output record in the vsam file when there 's a break in the key used, or update the data of the already existing individual for the appropriate month.
- Report the data using the vsam file created in the previous step as input.
- Set up an annual job to initialize the vsam file.
It may not be matching your requirement exactly, but i hope you will get some idea from it. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
It may not be matching your requirement exactly, but i hope you will get some idea from it. |
Meenakshi should not need to add the system overhead and programming maintenance of a vsam file. Your requirement appended "this" month's data to the existing year-to-date file.
This requirement is to simply read the last 12 months (rolling 12 months) and create "the report". |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks all for giving me the suggestions.
One more requirement of this task is that there should be a purge Job(monthly job) which will delete any accounts that are 12 months old.
How shall i link these two jobs. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
if the GDG has a limit of 12, when creating the 13th entry, the oldest one should roll off automatically.
Gerry |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
I am not creating files, i am receving files which will have data of previous 2 months only , and i have to generate a report every month which will have history of all previous months.
That's why i have to concatenate files.
Purge Job is dependent on previous job, i undersatnd that having 12 generations will remove the oldest one once 13th is reached.
But how to work programatically as this is dependent on first job.
I need approach for both, design and programing hints. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Purge Job is dependent on previous job |
Please clarify this - i do not understand what this tells me.
If your incoming data file has data from 2 months, the first thing to do might be to create a new generation of the gdg with only the "current" month info from the 2 months on the file. Once you do this, you are back to the simple task of running "the report" with no concern of eliminating duplicates. Each generation will have only 1 month. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
like pounding sand, huh?
have a good weekend, mine has already started. cold beer and this forum and i am on another planet. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Quote: |
have a good weekend |
You too
Beer:30 - what a great time of day. . .
As my old crew said about an early arrival at the pub. Time for a practice beer or so. The real drinking will soon commence.
d |
|
Back to top |
|
|
meenakshi_forum Warnings : 1 Active User
Joined: 27 May 2008 Posts: 121 Location: India
|
|
|
|
Thanks all.
Dick,
If i create a generation from the input file being received that will have the data of past two months, then will the next generation have the data of past 3 months ? and will the next generation to it will have data of 4 months and so on...
Please let me know
Thanks. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10888 Location: italy
|
|
|
|
just to stir up trouble and make people think about poor approaches
A is the data range for month n
B is the data range for month n+1
C is the data range for month n+2
transmission sequence A+B B+C
what if the B data range provided in the second shipping differs from the previous one
meditate and check ( I would * )
* do the checking, the meditation having already been done |
|
Back to top |
|
|
|