I'm sure this is the kind of thing Sort should be able to do easily, but I really don't know where to start.
I have System Trace data as formatted by IPCS with the GMT timestamp option. Trace lines are well documented, but have a few quirks. These are 132 byte records, with a timestamp toward the right (col 107, IIRC) in a form like 10:15:25.855350566 . But... Some records have no timestamp, notably those for PC/PR and friends, BR, and maybe a couple of others. On the other hand many "normal" records are formatted by IPCS as two lines, and in this case not only is the timestamp blank, but also a bunch of stuff at the left such as CPU, ASID TCB/SRB address, and so on. So it's easy enough to tell the difference between these three kinds of lines in the formatted output without having to maintain context: "normal" (has a non-blank timestamp), continuation (starts with blanks and has a blank timestamp), and no-timestamp (does not start with blanks, and has a blank timestamp). Here are three records in the order just mentioned (watch the wrap, of course): 0001-0041 05DB7F00 SRB 00000000_07FAAF30 00000000 073ABA40 1E8812E0 00 0041 0041 10:15:25.273298359 0124 07040000 80000000 00000000 20 0001-0041 05DB7F00 PC ... 0 016C0996 0132E asyncio2 So clearly these formatted records cannot be simply sorted by the timestamp field while maintaining order. But they are already in order, so no problem. (It is also possible that I have overlooked some other style(s) of IPCS-formatted records that might complicate things, but so far I'm not seeing any.) OK - I have separate trace output built by various other programs. These records, when formatted by their respective programs, have a timestamp in exactly the same format as Systrace, but this timestamp is at the very left of each record. (I would be happy enough to move the timestamp to match the position in the Systrace records if it helps, but I don't mind if the overal result has them in the original positions.) All these non-IPCS records do have a timestamp; there are no blank or continuation lines, so they *can* be safely sorted by the timestamp field, and in fact may need to be because the trace tables they come from may have wrapped. So all I want to do is merge these four streams of records to produce a single consolidated list of events in timestamp order. The Systrace records without timestamps must remain in order, and continuation lines must of course stay immediately after their primary lines. There is a minor complication to think about: Where to insert one of my non-IPCS lines when there are several non-timestamped Systrace records between two timestamped ones, and the non-IPCS records's timestamp is in between? I can't think there is any reliable way, so putting it at the start or end of the timestamp gap would be fine. In passing, I can see how to do this in say Rexx, but it just seems to be something Sort *should* be able to handle, and with better performance and the ability to handle a lot more data. And yes, I am aware of potential risks of TOD clock values extended out to nanosecond formatting, and the related issues of conceptual vs actual sequence of execution across processors. So... Would any sort experts care to point me in the right direction? Many thanks! Tony H. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN