adbanginwar
New User
Joined: 06 Sep 2007 Posts: 8 Location: Pune
|
|
|
|
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 |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
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). |
|