Venkata Ramayya
New User
Joined: 03 Dec 2007 Posts: 49 Location: United States
|
|
|
|
Hi
Need help on adding a delimiter using DFSORT. I have multiple record types like '001' ,'002', '003' and each record types have multiple positional fields. I will have to add a delimiter between each field. Appreciate any help
Input
-------
001123456789101 11 20150323
002123456789101 11 123456789012
003123456789101 11 123456789012
002123456789101 11 123456789012
003123456789101 11 123456789012
Output
--------
001;123456789101;11;20150323
002;123456789101;11;123456789012
003;123456789101;11;123456789012
002;123456789101;11;123456789012
003;123456789101;11;123456789012 |
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
Look for something like this:
or
That will do the COPY operation.
Then something like this, for the IFTHEN and the formatting.
Code: |
INREC IFTHEN=(WHEN=(1,3,CH,EQ,C'001'),
BUILD=(1,3,
C';',
4,12,
C';',
16,2,
C';',
19,8
80:X)),
IFTHEN=(WHEN=NONE,
BUILD=(1,3,
C';',
4,12,
C';',
16,2,
C';',
19,12
80:X))
. |
That's assuming fixed-length 80-byte records. |
|