Page 1 of 1

How to replace 2nd character with space ???

PostPosted: Thu Dec 02, 2010 4:19 pm
by gauthamnagpur18
Hi

I have a input like this

sno name
1 ram
2 ganesh
3 rajesh


i need output like this

sno name
1 r m
2 g nesh
3 r jesh

2nd chracter should be replaced with space .


Thanks
Gautham

Re: How to replace 2nd character with space ???

PostPosted: Thu Dec 02, 2010 10:11 pm
by skolusu
gauthamnagpur18,

Assuming you want to replace the 4th character in the file, the following DFSORT JCL will give you the desired results.

//STEP0100 EXEC PGM=SORT     
//SYSOUT    DD SYSOUT=*       
//SORTIN    DD *             
----+----1----+----2----+----3
1 RAM                         
2 GANESH                     
3 RAJESH                     
//SORTOUT   DD SYSOUT=*       
//SYSIN     DD *             
  SORT FIELDS=COPY           
  INREC OVERLAY=(4:X)         
//*


The output from this is

1 R M       
2 G NESH     
3 R JESH     

Re: How to replace 2nd character with space ???

PostPosted: Sun Dec 05, 2010 1:03 pm
by gauthamnagpur18
Thank you . I Got the output !!