Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Generate Cohort report using SORT

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> SYNCSORT
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    Post subject: Generate Cohort report using SORT
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

Senior Member


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

PostPosted: Wed Jun 01, 2016 11:07 am    Post subject:
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    Post subject: Reply to: Generate Cohort report using SORT
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10202
Location: italy

PostPosted: Wed Jun 01, 2016 12:53 pm    Post subject: Reply to: Generate Cohort report using SORT
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: 1715
Location: UK

PostPosted: Wed Jun 01, 2016 2:46 pm    Post subject:
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

Senior Member


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

PostPosted: Wed Jun 01, 2016 10:40 pm    Post subject:
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: 7913
Location: Bellevue, IA

PostPosted: Wed Jun 01, 2016 11:39 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> SYNCSORT All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm
No new posts How to delete second instance from Fl... Gunapala CN DFSORT/ICETOOL 6 Tue Oct 18, 2016 11:42 pm
No new posts Detailed Transaction History report f... Kyle Carroll CICS 5 Tue Oct 18, 2016 12:42 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us