View previous topic :: View next topic
|
Author |
Message |
Tushar Dhadiwal
New User
Joined: 29 Aug 2011 Posts: 7 Location: Pune
|
|
|
|
I have a flat file with some useful data along with timestamp on each record. Inorder to create a report, I need data of that Week ONLY for my further analysis. I need to filter out that week's data using DFSORT. Hope my question is clear.
Thanks and Regards,
Tushar Dhadiwal |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Which "week". Have you looked at the date functions in the manual?
If you use INCLUDE/OMIT for the date range that you want, you should get the data you want. |
|
Back to top |
|
|
Tushar Dhadiwal
New User
Joined: 29 Aug 2011 Posts: 7 Location: Pune
|
|
|
|
for current week, for example if todays date is 20/2/2013 then i want the data of last 5 days. i written the sort like this but it is not working, giving the syntax error.
INCLUDE COND=(001,007,EQ,DATE2(-)-1)
can you please help on the same.
Thanks and Regards,
Tushar Dhadiwal |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Can you please paste the fully SYSOUT showing the syntax error, in the Code tags? |
|
Back to top |
|
|
PeterHolland
Global Moderator
Joined: 27 Oct 2009 Posts: 2481 Location: Netherlands, Amstelveen
|
|
|
|
Look at your input date format.
For date values in the form C'yyyy/mm/dd', you could use the DATE1(/) constant; for date values in the form C'yyyy-mm', you could use the DATE2(-) constant; for date values in the form P'yyyyddd', you
could use the DATE3P constant; and for date values in the form Z'yymmdd' (2-digit year date), you could use the Y'DATE1' constant. |
|
Back to top |
|
|
Tushar Dhadiwal
New User
Joined: 29 Aug 2011 Posts: 7 Location: Pune
|
|
|
|
Input Data Format:2013-02-11-00.00.00.000000 1030101010 TUSHAR
Spool Sysout with error:
Code: |
SYSIN :
SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,
INCLUDE=(001,010,EQ,DATE3(-)-1)
*
WER251A INCLUDE/OMIT INVALID FORMAT
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE |
Code'd |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
You didn't specify the type of field. |
|
Back to top |
|
|
Tushar Dhadiwal
New User
Joined: 29 Aug 2011 Posts: 7 Location: Pune
|
|
|
|
Thanks Bill and Peter... its working now. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Tushar Dhadiwal
Please be aware that you DO NOT use DFSORT
You use SYNCSORT |
|
Back to top |
|
|
satyapn9
New User
Joined: 08 Oct 2010 Posts: 27 Location: India
|
|
|
|
Hi, Look at this, it may helps you.
I have sorted my file which has date field in the format mm/dd/yyyy. My requirement was to include/extract records which are dated between 02/28/2011 & 12/31/2011. File LRECL is 45 only. Below is the example how SORT options were used.
Code: |
//*
//SYSIN DD *
INREC OVERLAY=(46:26,4,20,2,23,2)
SORT FIELDS=(46,8,CH,A)
OUTFIL BUILD=(1,45),
INCLUDE=(46,8,ZD,GE,20110228,AND,46,8,ZD,LE,20111231)
/* |
|
|
Back to top |
|
|
|