I need to pickup the record having 0DMP901BT and the date as current date or current date-1
For example in above input My sort step should pick the first record since it is having 0DMP901BT and have current date .. I only need first record satisfying my condition and leave rest.
I was thinking of sort card soemthing like below but I am not sure how I would compare the date portion of it which starts from 65th column and is of 10 digit.. Challange for me is to compare the date which is having "/" as saperator
Code:
SORT FIELDS=COPY
INCLUDE COND=(1,9,CH,EQ,C'0DMP901BT',AND,65,10,CH,EQ,&DATE ,OR,
65,10,CH,EQ,&DATE-1)
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
I had some work to do with dates, but using DFSORT rather than SYNCSORT, and the solution was to reformat the dates before processing them.
Do a search in the DFSORT forum, with expat as author and they should be easy enough to find as they were quite recent. It may help you with your problem.
********************************* TOP OF DATA **********************************
0DMP901BT DMP901BT JOB14090 2240 1 07/03/2013
0DMP901BT DMP901BT JOB14090 2240 1 07/02/2013
******************************** BOTTOM OF DATA ********************************