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

How to eliminate hyphen in date when sorting?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Mon Apr 28, 2008 3:31 pm
Reply with quote

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
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Mon Apr 28, 2008 8:15 pm
Reply with quote

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

New User


Joined: 25 Mar 2008
Posts: 14
Location: milan, italy

PostPosted: Mon Apr 28, 2008 8:42 pm
Reply with quote

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
View user's profile Send private message
V S Amarendra Reddy

Active User


Joined: 13 Sep 2006
Posts: 216
Location: USA

PostPosted: Mon Apr 28, 2008 9:16 pm
Reply with quote

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

New User


Joined: 25 Mar 2008
Posts: 14
Location: milan, italy

PostPosted: Mon Apr 28, 2008 9:31 pm
Reply with quote

Thanks a lot Mr.Amar it helped me out.

Regards
Denis
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: Mon Apr 28, 2008 10:08 pm
Reply with quote

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
View user's profile Send private message
Lord.of.Wind

New User


Joined: 17 Nov 2005
Posts: 60

PostPosted: Tue Apr 29, 2008 7:16 am
Reply with quote

Yes, thank you Sir!
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 Need to convert date format DFSORT/ICETOOL 20
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Need help to append a date&tsp at... DFSORT/ICETOOL 9
Search our Forums:

Back to Top