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

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: 2588
Location: NYC,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 Moderator


Joined: 14 Mar 2007
Posts: 10727
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: 2455
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: 2588
Location: NYC,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: 8569
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> SYNCSORT

 


Similar Topics
Topic Forum Replies
No new posts Building a sort key DFSORT/ICETOOL 3
No new posts Very Large Sort failed - Seeking reco... DFSORT/ICETOOL 7
No new posts Date conversion using SORT SYNCSORT 4
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
No new posts Using sort on VB records based on off... DFSORT/ICETOOL 6
Search our Forums:

Back to Top