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

Date/time conditions


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
defields9

New User


Joined: 25 Mar 2006
Posts: 4

PostPosted: Sat Mar 25, 2006 1:28 am
Reply with quote

What happened to my earlier question?
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: Sat Mar 25, 2006 1:46 am
Reply with quote

What earlier question? This board got hacked this morning, so maybe some questions were lost. Post it again.
Back to top
View user's profile Send private message
defields9

New User


Joined: 25 Mar 2006
Posts: 4

PostPosted: Sat Mar 25, 2006 3:37 am
Reply with 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?

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Mar 25, 2006 4:16 am
Reply with quote

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
View user's profile Send private message
defields9

New User


Joined: 25 Mar 2006
Posts: 4

PostPosted: Sat Mar 25, 2006 4:21 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Sat Mar 25, 2006 5:15 am
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replacing 'YYMMDD' with date, varying... SYNCSORT 3
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts How to load to DB2 with column level ... DB2 6
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
Search our Forums:

Back to Top