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: 30

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

Active User


Joined: 15 Aug 2015
Posts: 396
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

Active User


Joined: 15 Aug 2015
Posts: 396
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 How to convert RESP code 12 to text? CICS 9
No new posts COnvert a column with mix of hex ,cha... DB2 5
No new posts To convert numeric to Packed Decimal DFSORT/ICETOOL 9
No new posts how to convert Hex String t char hex PL/I & Assembler 6
This topic is locked: you cannot edit posts or make replies. DFSORT-How to convert ZD to ZS in DFSORT DFSORT/ICETOOL 2
Search our Forums:

Back to Top