View previous topic :: View next topic |
Author |
Message |
priyaranjan.mishra Beginner
Joined: 21 Jan 2008 Posts: 17 Topics: 9
|
Posted: Thu Nov 19, 2009 4:39 am Post subject: removing intermediate spaces in the records of a file |
|
|
I have to remove intermediate spaces in the records ofa file and insert coma in between.
For example:
I/P:
1234 5678
00000 2222
10 25
O/P:
1234,5678
00000,2222
10,25 |
|
Back to top |
|
 |
expat Intermediate

Joined: 01 Mar 2007 Posts: 475 Topics: 9 Location: Welsh Wales
|
Posted: Thu Nov 19, 2009 6:40 am Post subject: |
|
|
What do you expect to see if there are two or more consecutive spaces within a record _________________ If it's true that we are here to help others,
then what exactly are the others here for ? |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Thu Nov 19, 2009 10:43 am Post subject: |
|
|
priyaranjan.mishra,
The following DFSORT JCL will give you the desired results
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
1234 5678
00000 2222
10 25
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C','))
//* |
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|