View previous topic :: View next topic
|
Author |
Message |
Indrajit_57 Warnings : 1 New User
Joined: 27 Jun 2006 Posts: 60
|
|
|
|
Hi,
I have a requirement to generate a monthly cohort report using data from the current and previous month. My sample data looks as below: -
Previous Month Data
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
B1 LM <value> <value>
******************************** Bottom of Data ******************************* |
Current Month Data
Code: |
----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8
********************************* Top of Data **********************************
B1 LM <value>
B2 LM+1 <value> <value>
******************************** Bottom of Data ******************************** |
The length of the file is 1500 bytes.
The output should be as below: -
Code: |
***************************** Top of Data ******************************
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
B1 LM <value> <value> <value>
B2 LM+1 <value> <value>
**************************** Bottom of Data **************************** |
In the next month I will be using the above output as previous month data and the current month input will look like
Code: |
***************************** Top of Data ******************************
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
B1 LM <value>
B2 LM+1 <value>
B3 LM+2 <value> <value>
**************************** Bottom of Data **************************** |
The ouput should be as below: -
Code: |
***************************** Top of Data ******************************
B1 LM <value> <value> <value> <value>
B2 LM+1 <value> <value> <value>
B3 LM+2 <value> <value>
**************************** Bottom of Data **************************** |
So basically I need to fill in the blanks by taking the data from previous months in the current months file and generate a report. B1, B2... etc are the keys by which we can identify. Each month the row and column will get increased by 1. I need to do this for 36 months.
Is this possible using SORT or a COBOL program is a better option. |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Have you looked for JOINKEYS yet? |
|
Back to top |
|
|
Indrajit_57 Warnings : 1 New User
Joined: 27 Jun 2006 Posts: 60
|
|
|
|
Yes I have though about JOINKEYS. But in order to merge it, I will need to specify the field position to combine the data. But was looking for something, if I can find the start and end position from where the updates needs to be done. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
monthly cohort(*) report |
avoid using Your organisation jargon, it just adds confusion
(*) Julius Caesar would have been happy to have an automated monthly cohort report
especially after all the confusion Pompeus did shuffling around cohorts and legions |
|
Back to top |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
At Vindolanda the reports wre written by hand on wooden tablets. Do you intend to do that? If not, it is not a cohort report! |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3053 Location: NYC,USA
|
|
|
|
Quote: |
But in order to merge it, I will need to specify the field position to combine the data. |
So what? Reformat fields is what created for. it seems you don't know JOINKEYS how it functions. All you have to do is carry forward the current months population by updating few fields of previous month to the output file. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8696 Location: Dubuque, Iowa, USA
|
|
|
|
Quote: |
monthly cohort report |
I worked with an epidemiologist at an earlier employer, and a cohort study to an epidemiologist is a longitudinal study looking for effects over time (such as smoking or asbestos exposure). It is definitely jargon specific to the field; the TS may be using the term in this fashion or may not. |
|
Back to top |
|
|
|