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?
Need Help in a Date conversion
-
- Global moderator
- Posts: 3025
- Joined: Sun Jul 04, 2010 12:13 am
- Skillset: JCL, PL/1, Rexx, Utilities and to a lesser extent (i.e. I have programmed using them) COBOL,DB2,IMS
- Referer: Google
- Location: Pushing up the daisies (almost)
Re: Need Help in a Date conversion
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
Regards
Nic
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Need Help in a Date conversion
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.
That’s it.
Javas and Pythons come and go, but JCL and SORT stay forever.
- sergeyken
- Posts: 458
- Joined: Wed Jul 24, 2019 10:12 pm
- Skillset: Assembler, JCL, Utilities, PL/I, C/C++, DB2, SQL, REXX, COBOL, etc. etc. etc.
- Referer: Internet search
Re: Need Help in a Date conversion
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.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 7
- 1987
-
by sergeyken
View the latest post
Wed Dec 23, 2020 6:39 pm
-
-
.TXT file conversion to .CSV/.XLSX
by dangtran10 » Thu May 20, 2021 7:09 am » in DFSORT/ICETOOL/ICEGENER - 3
- 1918
-
by steve-myers
View the latest post
Fri May 21, 2021 10:57 pm
-
-
- 3
- 5863
-
by sergeyken
View the latest post
Sat Dec 10, 2022 2:30 am
-
-
Code conversion issue while reading JCL using REXX
by vsgurunath » Fri Jun 19, 2020 10:19 pm » in CLIST & REXX - 11
- 4254
-
by vsgurunath
View the latest post
Thu Jun 25, 2020 4:08 pm
-
-
- 1
- 5650
-
by enrico-sorichetti
View the latest post
Fri Dec 10, 2021 5:23 pm