How to replace 2nd character with space ???



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

How to replace 2nd character with space ???

Postby gauthamnagpur18 » Thu Dec 02, 2010 4:19 pm

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
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times

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

 

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

Postby skolusu » Thu Dec 02, 2010 10:11 pm

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     
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

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

Postby gauthamnagpur18 » Sun Dec 05, 2010 1:03 pm

Thank you . I Got the output !!
gauthamnagpur18
 
Posts: 93
Joined: Sat Oct 23, 2010 1:28 pm
Location: Chennai, India
Has thanked: 3 times
Been thanked: 2 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post