Page 1 of 1

Sorting data files based on customized criteria

Posted: June 19th, 2021, 2:26 am
by manishcspro
Hi, I want to sort the data file in order to month starting from April to March.
My data has District code, Division code, Month code and Year in primary id,
since I assigned the month code 01 to 12 starting from Jan to Dec so it sorts the data in order to Jan to Dec
but my need is to sort the data from April (month code 04) to March (month code 03) in a financial year.
Please guide me..

Re: Sorting data files based on customized criteria

Posted: June 21st, 2021, 11:12 am
by Gregory Martin
One option would be to add an item to your dictionary (on a singly-occurring record) that contains the month based on the financial year. You could use a batch application to set these values:
PROC MONTH

   
if MONTH >= 4 then
       
FINANCIAL_MONTH = MONTH - 3;
   
else
       
FINANCIAL_MONTH = MONTH + 9;
   
endif;
Then you could use the Sort Data tool to sort on FINANCIAL_MONTH.

Re: Sorting data files based on customized criteria

Posted: June 22nd, 2021, 1:47 am
by manishcspro
Thanks..