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
 

 

using sort to sum data for given duration

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
adbanginwar

New User


Joined: 06 Sep 2007
Posts: 8
Location: Pune

PostPosted: Thu Jun 23, 2011 11:41 pm    Post subject: using sort to sum data for given duration
Reply with quote

hi all,

we have a application with CICS which when processes anything would store it in its journals. My task is to sort the journal for the records we require.

I have sorted and made different copies for each requeirement but now i'm stuck.

We have timestamp in file for each transaction.
Eg: 23:40:15.45

I have to write a jcl to get total number of transaction per minute. say from 23:40 to 23:41

I'm guessing Inrec and overlay would do the trick but dont know where to begin.

Thanks,
A
Back to top
View user's profile Send private message

Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jun 24, 2011 12:57 am    Post subject:
Reply with quote

Do you mean something like this:

Code:

Minute     Transactions
...
23:40                10
23:41               250
23:42                 9
...


So the first line would say there were 10 transactions in the minute from 23:40:00 to 23:40:59 (hh:mm:ss).

If that's what you want, you can use a DFSORT job like the following (I'm assuming the hh:mm field is in positions 11-15:

Code:

//S1 EXEC PGM=SORT                               
//SYSOUT DD SYSOUT=*                             
//SORTIN DD *                                     
...       23:40:15.45   ...                       
...       23:40:16.02   ...                       
...       23:40:59.59   ...                       
...       23:41:00.00   ...                       
...       23:41:25.15   ...                       
...       23:41:38.27   ...                       
...       23:41:42.01   ...                       
...       23:41:49.03   ...                       
...       23:41:55.12   ...                       
//SORTOUT DD SYSOUT=*                             
//SYSIN DD *                                     
  SORT FIELDS=(11,5,CH,A)                         
  OUTFIL REMOVECC,NODETAIL,                       
    SECTIONS=(11,5,                               
      TRAILER3=(11,5,COUNT=(M10,LENGTH=16)))     


SORTOUT for this small example would have:

Code:

23:40               3
23:41               6


If the input records are already sorted by hh:mm, you can use OPTION COPY instead of SORT FIELDS=(11,5,CH,A).

If you just want an output record for a particular hh:mm value, add an INCLUDE statement to only include the records with that hh:mm value, e.g.

Code:

   INCLUDE COND=(11,5,CH,EQ,C'23:40')


If that doesn't help, then you need to do a better job of explaining what you do want with an example of your input records and expected output records (you should really have done that in your first post so people wouldn't have to guess what you want).
Back to top
View user's profile Send private message
adbanginwar

New User


Joined: 06 Sep 2007
Posts: 8
Location: Pune

PostPosted: Fri Jun 24, 2011 7:46 am    Post subject:
Reply with quote

thanks Frank. Yes you guessed right what i wanted. i'll check out the solution later today.
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am
No new posts JES2 JEC: Use UNIX Pipes to Pass Data... Virendra Shambharkar JCL & VSAM 21 Tue Dec 20, 2016 6:55 pm
No new posts Is the 'prompt' data for the DSLIST p... Willy Jensen TSO/ISPF 2 Tue Dec 06, 2016 4:38 am


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