Need Help in a Date conversion



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

Need Help in a Date conversion

Postby toanoop » Wed Nov 25, 2020 1:41 pm

Hi,

I have a CSV file where the Users enters a date as 4/9/2020 (read it as April the 9th), is it possible to convert this to 04/09/2020 (exactly like the / is required) using Sort?
toanoop
 
Posts: 1
Joined: Wed Nov 25, 2020 1:34 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Need Help in a Date conversion

Postby NicC » Wed Nov 25, 2020 5:31 pm

is it possible

Yes, but if there is no date conversion routine to do this then you will just have to treat each byte as a byte not part of a date.

Also, this topic may help
http://www.ibmmainframeforum.com/post27455.html?hilit=date%20conversion#p27455
found by searching the forum.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Need Help in a Date conversion

Postby sergeyken » Thu Nov 26, 2020 9:11 pm

Use PARSE= option to split input field by ‘/‘ characters, then use BUILD= to produce fixed length values for month, and day fields.

That’s it.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 436
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times

Re: Need Help in a Date conversion

Postby sergeyken » Sun Nov 29, 2020 6:47 am

Since your “file” has .CSV format, there is no other choice but using PARSE option of SORT to handle any data record, either with date fields, or without it.
Javas and Pythons come and go, but JCL and SORT stay forever.
User avatar
sergeyken
 
Posts: 436
Joined: Wed Jul 24, 2019 10:12 pm
Has thanked: 7 times
Been thanked: 40 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post