IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Report having 12 months rolling history


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Tue Jul 22, 2008 1:03 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 22, 2008 1:11 am
Reply with quote

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
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Tue Jul 22, 2008 1:22 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Tue Jul 22, 2008 2:06 am
Reply with quote

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
View user's profile Send private message
the_gautam

Active User


Joined: 05 Jun 2005
Posts: 165
Location: Bangalore

PostPosted: Wed Jul 23, 2008 1:26 pm
Reply with quote

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
View user's profile Send private message
sedireswarapu

New User


Joined: 18 Jun 2008
Posts: 28
Location: India

PostPosted: Wed Jul 23, 2008 5:35 pm
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Jul 23, 2008 8:33 pm
Reply with quote

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
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Thu Jul 24, 2008 3:14 pm
Reply with quote

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
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Thu Jul 24, 2008 3:31 pm
Reply with quote

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
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Fri Jul 25, 2008 1:08 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 25, 2008 1:17 am
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jul 25, 2008 3:42 am
Reply with quote

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
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Jul 25, 2008 5:52 am
Reply with quote

Quote:
have a good weekend
You too icon_smile.gif

Beer:30 - what a great time of day. . . icon_wink.gif

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
View user's profile Send private message
meenakshi_forum
Warnings : 1

Active User


Joined: 27 May 2008
Posts: 121
Location: India

PostPosted: Fri Jul 25, 2008 12:27 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Fri Jul 25, 2008 2:28 pm
Reply with quote

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 * ) icon_lol.gif

* do the checking, the meditation having already been done
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
No new posts Need help on formatting a report DFSORT/ICETOOL 14
No new posts Creating Report using SORT DFSORT/ICETOOL 7
No new posts Ca7 long running jobs report All Other Mainframe Topics 1
No new posts Report of batch jobs JCL & VSAM 1
Search our Forums:

Back to Top