IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Date format correction using dfsort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Bindu Akurathi

New User


Joined: 11 Oct 2024
Posts: 4
Location: India

PostPosted: Tue Oct 15, 2024 7:50 pm
Reply with quote

My input file has date in MM/DD/CCYY format as below, somehow some records from previous step has date in DD/MM/CCYY.

10/13/2024ABCD
10/13/2024XXXX
15/10/2024YYYY
14/10/2024SFDF

I want the output as

10/13/2024ABCD
10/13/2024XXXX
10/15/2024YYYY
10/14/2024SFDF

Please suggest me how can I achieve this desired output.

Thankyou
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Tue Oct 15, 2024 8:25 pm
Reply with quote

Any translation could make things more worse. What's the result of 06/12/2024 or 12/06/2024? Has it to be corrected or not?
Back to top
View user's profile Send private message
Bindu Akurathi

New User


Joined: 11 Oct 2024
Posts: 4
Location: India

PostPosted: Wed Oct 16, 2024 9:56 am
Reply with quote

I just found that the date DD/MM/CCYY is getting populated this only for certain type of records like for example as below, is there a way to correct it now based on this Type indicator field

10/13/2024ABCDTYPEA
10/13/2024XXXXTYPEB
15/10/2024YYYYTYPEC
14/10/2024SFDFTYPEC

I want the output as

10/13/2024ABCDTYPEA
10/13/2024XXXXTYPEB
10/15/2024YYYYTYPEC
10/14/2024SFDFTYPEC
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


Joined: 15 Aug 2015
Posts: 1329
Location: Bamberg, Germany

PostPosted: Wed Oct 16, 2024 11:23 am
Reply with quote

Simple solution for the given sample:
Code:
OPTION COPY                             
INREC IFTHEN=(WHEN=(15,5,CH,EQ,C'TYPEC'),
  BUILD=(4,2,3,1,1,2,6,14))             
END
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Sorting Date Field DFSORT/ICETOOL 4
No new posts CONVERT a given date from UTC TO BST CICS 0
No new posts Pull data using date difference betwe... DB2 6
No new posts CA7 count with DATE variable CA Products 0
No new posts Format Binary file to EBCDIC JCL & VSAM 4
Search our Forums:

Back to Top