Compare Dates in SORT

IBM's Sort Product, ICETOOL, ICEMAN and ICEGENER.
Post Reply
Mr Awasthi
Registered Member
Posts: 26
Joined: Mon Aug 12, 2013 10:42 am

Compare Dates in SORT

Post by Mr Awasthi »

All,

I have a got a file in which one of the columns will have the dates in the MM/DD/YYYY.

Code: Select all

11/25/2015 
10/10/2015 
10/12/2015 
06/29/2015 
09/21/2015 
10/30/2015 
09/12/2015 
08/20/2015 
07/16/2015 
09/27/2015 
04/15/2010 
10/14/2015 
09/20/2015 
I need to get only those records which are older than today date. I used the following control statements.

Code: Select all

SORT FIELDS=COPY                            
INCLUDE COND=(1,10,LT,&DATE(MD4/)),FORMAT=ZD 
OUTREC FIELDS=(1,30)
but it gives a syntax error. Can someone please help me to correct it.
William Collins
Global Moderator
Global Moderator
Posts: 490
Joined: Sun Aug 25, 2013 7:24 pm

Re: Compare Dates in SORT

Post by William Collins »

Perhaps you should look up what &DATE is and where it can be used?
User avatar
Anuj Dhawan
Founder
Posts: 2802
Joined: Sun Apr 21, 2013 7:40 pm
Location: Mumbai, India
Contact:
India

Re: Compare Dates in SORT

Post by Anuj Dhawan »

It's been a while when I used SORT but try with this, assuming your Input FB/80 (not teste):

Code: Select all

//SYSIN    DD *                                                    
  SORT FIELDS=COPY                                                  
  INREC OVERLAY=(81:7,4,1,2,4,2,DATE1)                              
  OUTFIL BUILD=(1,80),INCLUDE=(81,8,CH,LT,89,8,CH)                  
//*
Thanks,
Anuj

Disclaimer: My comments on this website are my own and do not represent the opinions or suggestions of any other person or business entity, in any way.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM DFSort, ICETOOL, ICEMAN, ICEGENER.”