IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

Generate Cohort report using SORT


 
IBM Mainframe Forums -> SYNCSORT
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Wed Jun 01, 2016 9:41 am
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 2503
Location: NY,USA

PostPosted: Wed Jun 01, 2016 11:07 am
Reply with quote

Have you looked for JOINKEYS yet?
Back to top
View user's profile Send private message
Indrajit_57
Warnings : 1

New User


Joined: 27 Jun 2006
Posts: 60

PostPosted: Wed Jun 01, 2016 12:11 pm
Reply with quote

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

Senior Member


Joined: 14 Mar 2007
Posts: 10695
Location: italy

PostPosted: Wed Jun 01, 2016 12:53 pm
Reply with quote

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

Global Moderator


Joined: 10 May 2007
Posts: 2431
Location: Hampshire, UK

PostPosted: Wed Jun 01, 2016 2:46 pm
Reply with quote

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

Global Moderator


Joined: 21 Sep 2010
Posts: 2503
Location: NY,USA

PostPosted: Wed Jun 01, 2016 10:40 pm
Reply with quote

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

Global Moderator


Joined: 06 Jun 2008
Posts: 8566
Location: Dubuque, Iowa, USA

PostPosted: Wed Jun 01, 2016 11:39 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> SYNCSORT
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts COBOL VS SORT Utility for file format... COBOL Programming 6
No new posts Copying data from prev record using SORT SYNCSORT 19
No new posts Combining more 4 files with sorted or... DFSORT/ICETOOL 3
This topic is locked: you cannot edit posts or make replies. Parsing more than 1000 columns in a s... SYNCSORT 10
No new posts XML-GENERATE to render edited numeric COBOL Programming 0

Back to Top