DON BRADMAN ,AUSTRALIA ,101,CAPTAIN AUS
SACHIN TENDULKAR ,INDIA ,99 ,CAPTAIN IND
Need to convert the file to below format and send across to users
Code:
DON BRADMAN,AUSTRALIA,101,CAPTAIN AUS
SACHIN TENDULKAR,INDIA,99,CAPTAIN IND
I used FINDREP and changed x'4040' To x'' which solved the problem to an extent (and then changing single space and comma to just a comma). However whenever there are two spaces within a column, like in example above(CAPTAIN AUS), the logic breaks.
Is there any way we can achieve this through SORT ?
//SYSIN DD *
OPTION COPY
INREC IFTHEN=(WHEN=INIT,
FINDREP=(INOUT=(C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',',
C' ,',C',')))
Joined: 28 Jan 2012 Posts: 316 Location: Room: TREE(3). Hilbert's Hotel
Try this sort card. See if it works for you. I don't have DFSORT, tested it on syncsort assuming both input/output are fb/80.
Input:
Code:
----+----1----+----2----+----3----+----4----+----5----+----6----+----7--
DON BRADMAN ,AUSTRALIA ,101,CAPTAIN AUS
SACHIN TENDULKAR ,INDIA ,99 ,CAPTAIN IND