Page 1 of 1

How to SORT data from input when it is in YY/MM/DD format

PostPosted: Wed Apr 04, 2018 10:42 pm
by N J Baruah
Hi All,

I am trying to sort data from an input file based on the reference date present in it from column 55 to 62. My requirement is to sort out data which has been last referenced within 3 months.

Please note that the reference date is present in the format YY/DD/MM (e.g: 18/03/14 etc).

I have tried the below sort code but it works only when the date format is YYYY/MM/DD. But I need to sort out the data from the input file which is present in the format YY/DD/MM and was last referenced within 3 months. So can anyone please help me with this.
--------------------------------------------------------------------------------
//SYSIN DD *
SORT FIELDS=COPY
INCLUDE COND=(55,8,CH,GT,DATE1(-)-90)
/*

--------------------------------------------------------------------------------
Coded for you - do it yourself next time

Re: How to SORT data from input when it is in YY/MM/DD forma

PostPosted: Wed Apr 04, 2018 11:39 pm
by NicC
You need to sort yourself out - the title says the date is YY/MM/DD but your post says YY/DD/MM. If it is the latter then sort on 55 for 2, 61 for 2 and 58 for 2.

Re: How to SORT data from input when it is in YY/MM/DD forma

PostPosted: Thu Apr 05, 2018 10:35 am
by N J Baruah
correction Nic.... it is YY/MM/DD

Re: How to SORT data from input when it is in YY/MM/DD forma

PostPosted: Thu Apr 05, 2018 9:37 pm
by N J Baruah
Hi All,

Can anyone please help me?
Your help will be really appreciated...


"I am trying to sort out data from an input file based on the reference date present in it from column 55 to 62. My requirement is to sort out data which has been last referenced within 3 months. Please note that the reference date is present in the format YY/MM/DD (e.g: 18/03/14 etc). "

Re: How to SORT data from input when it is in YY/MM/DD forma

PostPosted: Thu Apr 05, 2018 11:09 pm
by enrico-sorichetti
soliciting for answers is considered bad netiquette
and it will usually make people ignore the topic

remember ...
we reply on our own time and free of charge

if nobody replies it means that
nobody has an in depth knowledge of the topic
nobody is interested in answering
nobody likes You :mrgreen:

Re: How to SORT data from input when it is in YY/MM/DD forma

PostPosted: Fri Apr 06, 2018 1:51 am
by Robert Sample
Furthermore, your post mentions DATE1 but doesn't say if you've tried any of the D2? variables yet. If not, you need to look at them.