rajesh1183
New User
Joined: 07 Jan 2008 Posts: 98 Location: Hyderabad
|
|
|
|
Hi All,
Is it possible to read a comma delimited file using a DFSORT
For Ex:-
I have a input file like this
Code: |
1,22,333,4444
1,2,3,4
1,,33,444
|
Output should be
Code: |
1 22 333 4444
1 2 3 4
1 33 444
|
The length of
1st field is 1
2nd field is 2
3rd field is 3
4th field is 4 |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
You can use a DFSORT job like the following to do what you asked for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1,22,333,4444
1,2,3,4
1,,33,444
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC PARSE=(%1=(ENDBEFR=C',',FIXLEN=1),
%2=(ENDBEFR=C',',FIXLEN=2),
%3=(ENDBEFR=C',',FIXLEN=3),
%4=(FIXLEN=4)),
BUILD=(%1,2X,%2,2X,%3,2X,%4)
/*
|
|
|