Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to eliminate hyphen in date when sorting?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to eliminate hyphen in date when sorting?
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: 200
Location: USA

PostPosted: Mon Apr 28, 2008 8:15 pm    Post subject:
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    Post subject:
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: 200
Location: USA

PostPosted: Mon Apr 28, 2008 9:16 pm    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Apr 28, 2008 10:08 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts LISTIDR compiled date/time jerryte IBM Tools 3 Thu Apr 20, 2017 7:37 pm
No new posts SUBSTR for Date functions Shaheen Shaik DB2 4 Thu Apr 06, 2017 2:14 pm
No new posts Date and time format in CICS Chandru3183 CICS 2 Sat Mar 18, 2017 12:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us