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

using sort to sum data for given duration


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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 Developer


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

PostPosted: Fri Jun 24, 2011 12:57 am
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
Search our Forums:

Back to Top