I need to sort a syslog data set by date and time.
Suggestions on how to use the combined date and time stamp to create a less than equal to/greater than equal to file?
The first sentence makes it sound like you want to SORT on the date and time. The second sentence makes it sound like you want to INCLUDE on the date and time. I'm guessing it's INCLUDE you really want to do ... right?
No problem with the date, but with the time combined sort finds no matching records.
Please show the control statements you used. Is the date a character string (C'yyddd' as shown) or is it in some other format? If another format, what does it look like? Is the time a character string C'mm:dd' as shown or is it in some other format? If another format, what does it look like.
What is the starting position, length and format of the date? What is the starting position, length and format of the time? What is the RECFM and LRECL of your input file?
Your To date is lower than your From date. Did you mean to show it that way?
It would have been nice if you'd actually answered my questions. Since you didn't, I'll have to guess what you want. All of those conditions ANDed together are NOT going to work because they'd all have to be true individually to include a record, and that's not what you want.
Based on what I could figure out from what you said, I think the following DFSORT job will do what you want. I've assumed your input file has RECFM=FB. I've supplied my own input records to show how it works:
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NO 06077 15:00
NO 06077 16:05
NO 06078 14:59
---> FROM 06078 15:00
YES 06078 15:01
YES 06078 22:05
YES 06079 00:30
YES 06080 00:30
YES 06080 17:29
---> TO 06080 17:30
NO 06080 17:31
NO 06080 18:01
//SORTOUT DD SYSOUT=*
//SYSIN DD *
INCLUDE COND=(20,11,CH,GE,C'06078 15:00',AND,