To compare Timestamp(26 Chars)



Support for NetApp SyncSort for z/OS, Visual SyncSort, SYNCINIT, SYNCLIST and SYNCTOOL

To compare Timestamp(26 Chars)

Postby praveen_nayak17 » Tue Jan 20, 2009 10:46 pm

Could anyone help me get records which have timestamp(26 characters) greater than 7 days from a file which contains records having timestamp as one of the fields????
Sample field value for timestamp is 2009-01-20-12-00-00-00000
praveen_nayak17
 
Posts: 8
Joined: Thu Jan 15, 2009 11:26 pm
Has thanked: 0 time
Been thanked: 0 time

Re: To compare Timestamp(26 Chars)

 

Re: To compare Timestamp(26 Chars)

Postby dick scherrer » Wed Jan 21, 2009 1:29 am

Hello and welcome to the forum,

To do what you want, use either an INCLUDE or an OMIT.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: To compare Timestamp(26 Chars)

Postby Alissa Margulies » Wed Jan 21, 2009 1:56 am

praveen_nayak17,

Just to clarify, do you want records that have a timestamp/date field which is more than 7 days from the current system date, meaning over a week old?

If this is the case, then the following sort job will give you the desired output:
//SORT1 EXEC PGM=SORT                   
//SORTIN DD *     
2009-01-20-12-00-00-00000   
2009-01-04-12-00-00-00000
2008-12-20-12-00-00-00000   
2009-01-18-12-00-00-00000   
2008-06-10-12-00-00-00000   
2009-01-13-12-00-00-00000   
//SORTOUT DD SYSOUT=*     
//SYSOUT DD SYSOUT=*     
//SYSIN DD *                               
   SORT FIELDS=COPY                           
   INCLUDE COND=(1,10,CH,LT,&DATE1(-)-7)     
/*     

The following records will be included in the output:
2009-01-04-12-00-00-00000
2008-12-20-12-00-00-00000
2008-06-10-12-00-00-00000
Alissa Margulies
Syncsort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Alissa Margulies
Global moderator
 
Posts: 369
Joined: Tue Feb 26, 2008 11:15 pm
Location: USA
Has thanked: 1 time
Been thanked: 1 time

Re: To compare Timestamp(26 Chars)

Postby praveen_nayak17 » Fri Jan 23, 2009 12:12 am

Hi Alissa Margulies

Thank you very much...you have understood my query.
praveen_nayak17
 
Posts: 8
Joined: Thu Jan 15, 2009 11:26 pm
Has thanked: 0 time
Been thanked: 0 time


Return to Syncsort/Synctool

 


  • Related topics
    Replies
    Views
    Last post