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

Convert from 1/1/2019 to 01/01/2019


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

New User


Joined: 05 May 2005
Posts: 31

PostPosted: Fri Sep 20, 2019 1:16 am
Reply with quote

I have below data

I
Code:


1/30/2021  1/29/2019
9/2/2020   11/1/2019
9/29/2020  8/14/2017
5/30/2020  12/22/2018
12/30/2022 7/1/2019

I want this to be

01/30/2021  01/29/2019
09/02/2020  11/01/2019
09/29/2020  08/14/2017
05/30/2020  12/22/2018
12/30/2022  07/01/2019

Thanks
Back to top
View user's profile Send private message
John Del

New User


Joined: 27 Apr 2012
Posts: 42
Location: NY

PostPosted: Fri Sep 20, 2019 2:31 am
Reply with quote

What have you tried to do?

My solution would be on the INREC, use PARSE to separate the fields and BUILD the record using UFF into fixed positions and lengths.

Then use an OUTREC BUILD to insert the '/' at the appropriate position,
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Mon Sep 23, 2019 11:56 pm
Reply with quote

Code:
  INREC IFTHEN=(WHEN=INIT,                                     
    PARSE=(%01=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),             
           %02=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),             
           %03=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=4),             
           %11=(ABSPOS=12,STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),   
           %12=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),             
           %13=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=4)),           
    BUILD=(%01,UFF,M11,C'/',%02,UFF,M11,C'/',%03,UFF,M11,X,     
           %11,UFF,M11,C'/',%12,UFF,M11,C'/',%13,UFF,M11))     
  SORT FIELDS=(COPY)                                           
  END                                                           


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

Senior Member


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

PostPosted: Tue Sep 24, 2019 12:16 am
Reply with quote

Minor update

Code:
  INREC IFTHEN=(WHEN=INIT,                                 
    PARSE=(%01=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),         
           %02=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),         
           %03=(STARTAT=NUM,FIXLEN=4),                     
           %11=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),         
           %12=(STARTAT=NUM,ENDBEFR=C'/',FIXLEN=2),         
           %13=(STARTAT=NUM,FIXLEN=4)),                     
    BUILD=(%01,UFF,M11,C'/',%02,UFF,M11,C'/',%03,UFF,M11,X,
           %11,UFF,M11,C'/',%12,UFF,M11,C'/',%13,UFF,M11)) 
  SORT FIELDS=(COPY)                                       
  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 Need to convert date format DFSORT/ICETOOL 20
No new posts Keep leading zero(s) after convert fl... SYNCSORT 7
No new posts Convert single row multi cols to sing... DFSORT/ICETOOL 6
No new posts convert file from VB to FB and use tr... DFSORT/ICETOOL 8
No new posts Convert HEX to Numeric DB2 3
Search our Forums:

Back to Top