MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Sort on date by padding with century

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 02, 2004 1:37 am    Post subject: Sort on date by padding with century Reply with quote

Hi all,
I have to sort a file according to a date field in YYMMDD format in ascending order. The date field type is charecter. I am giving input and expected output
*************************************************************
INPUT DATE FIELD
*************************************************************
011203
041113
990303
990404
001001
040202
*************************************************************
EXPECTED OUTPUT
*************************************************************
990303
990404
001001
011203
040202
041113
*************************************************************
*************************************************************
The ordinary sort wont work in this case as if i give sort fiedls = (1,6,ch,a) it will give 001001 before 990303. I cannot convert it first to a format of CCYYMMDD as the next step after this is a cobol pgm which expects YYMMDD format. I have to accomplish this with sort. I cannot use quick job or easytrieve.
Please tell me how to do this using syncsort.
Thanks
bade_miya.
Back to top
View user's profile Send private message
bade_miya
Beginner


Joined: 10 Dec 2003
Posts: 110
Topics: 38

PostPosted: Thu Sep 02, 2004 2:48 am    Post subject: Reply with quote

Hi all,
I got the answer from the manual itself. We have to give the following sort step just in case if any one wants to know.
********************************************************************
SORT FIELDS=(11646,06,Y2T,A),
CENTWIN=1950
********************************************************************
As i have given CENTWIN=1950, it will sort the dates according to this century window.
********************************************************************
example from the manual
********************************************************************
For example, consider the century window 1950 through 2049. The 2-digit year
fields would be processed as follows:

Two-digit Field in i/p Processed as Year
--------------------------------------------------------
00--------------------- 2000

01--------------------- 2001

49--------------------- 2049

50 ---------------------1950

99 ---------------------1999

*************************************************************

thanks
bade_miya
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group