|
View previous topic :: View next topic
|
| Author |
Message |
defields9
New User
Joined: 25 Mar 2006 Posts: 4
|
|
|
|
| What happened to my earlier question? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| What earlier question? This board got hacked this morning, so maybe some questions were lost. Post it again. |
|
| Back to top |
|
 |
defields9
New User
Joined: 25 Mar 2006 Posts: 4
|
|
|
|
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?
For example:
From date = 06080
from time = 17:30
To date = 06078
to time = 15:00
No problem with the date, but with the time combined sort finds no matching records.
Suggestions? |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
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?
| Quote: |
| 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? |
|
| Back to top |
|
 |
defields9
New User
Joined: 25 Mar 2006 Posts: 4
|
|
|
|
I'm using:
INCLUDE COND=(((20,5,CH,GE,C'FMDAT',AND,
26,2,CH,GE,C'FH',AND,
29,2,CH,GE,C'FM'),AND,
(20,5,CH,LE,C'TODAT',AND,
26,2,CH,LE,C'TH',AND,
29,2,CH,LE,C'TM')))
The date format is yyddd.
As you can see, yes I do want to include the appropriate date and times. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
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:
| Code: |
//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 *
OPTION COPY
INCLUDE COND=(20,11,CH,GE,C'06078 15:00',AND,
20,11,CH,LE,C'06080 17:30')
/*
|
When I run this DFSORT job, SORTOUT has:
| Code: |
---> 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
|
I think that's what you want ... right? |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|