View previous topic :: View next topic
|
Author |
Message |
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Hi,
I need to include all fields that between 2007-04-01 and 2008-03-01.
For example:
Code: |
2007-01-01
2007-02-02
2007-03-03
2007-04-04
2007-05-05
2007-06-06
2007-07-07
2007-08-08
2007-09-09
2007-10-10
2007-11-11
2007-12-12
2008-01-01
2008-02-02
2008-03-03
2008-04-04
2008-05-05
2008-06-06 |
Now I use
Code: |
SORT FIELDS=COPY
INCLUDE COND=(1,6,ZD,GE,DATE2P-12,AND,1,6,ZD,LT,DATE2P) |
I get error
Code: |
ABENDED S000 U0016 CN(INTERNAL) |
I guess the DATE2P should be 200804, how can I skip the '-' between yyyy and mm for example '2008-04' so that the sort works? |
|
Back to top |
|
|
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 216 Location: USA
|
|
|
|
If you want to remove the '-' out of those fields the following control card will help you.
Code: |
OPTION COPY
INREC OVERLAY=(1,10,SQZ=(SHIFT=LEFT,PREBLANK=C'-'))
|
Hope this helps
Regards
Amar |
|
Back to top |
|
|
denis.dhimitri
New User
Joined: 25 Mar 2008 Posts: 14 Location: milan, italy
|
|
|
|
Hi there,
If someone doesn't have installed on his System the latest version of DFSORT how this can be done ?
Thanks
Denis |
|
Back to top |
|
|
V S Amarendra Reddy
Active User
Joined: 13 Sep 2006 Posts: 216 Location: USA
|
|
|
|
Hi
Then you can follow the normal way as we know that the character '-' poistion in the record. Use normal formatting method in the INREC statement.
Code: |
OPTION COPY
INREC BUILD=(1:1,4,5:6,2,7:9,2,72X)----> IF LRECL=80 or change X accordingly.
|
Hope this helps
Regards
Amar |
|
Back to top |
|
|
denis.dhimitri
New User
Joined: 25 Mar 2008 Posts: 14 Location: milan, italy
|
|
|
|
Thanks a lot Mr.Amar it helped me out.
Regards
Denis |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
LOW,
You don't have to remove the hyphens. You just have to use the correct form of the date constant in the INCLUDE statement. Since your input dates are of the form 'yyyy-mm-dd', you should use DATE2(-) rather than DATE2P. DATE2P is for numeric dates - 'yyyy-mm-dd' is NOT a numeric date since a numeric date does NOT have a separator. Here's the control statements you should be using:
Code: |
SORT FIELDS=COPY
INCLUDE COND=(1,7,CH,GE,DATE2(-)-12,AND,1,7,CH,LT,DATE2(-))
|
|
|
Back to top |
|
|
Lord.of.Wind
New User
Joined: 17 Nov 2005 Posts: 60
|
|
|
|
Yes, thank you Sir! |
|
Back to top |
|
|
|