View previous topic :: View next topic
|
Author |
Message |
shr_amar Warnings : 2 Active User
Joined: 02 May 2005 Posts: 128 Location: UK
|
|
|
|
I'm trying to replace space with %20 in a variable length file.
input ==>
ma Jane Abson|ABSOE|BEUNEA1|CLKBCS|
output ==>
ma%20Jane%20Abson|ABSOE|BEUNEA1|CLKBCS| |
|
Back to top |
|
|
shr_amar Warnings : 2 Active User
Joined: 02 May 2005 Posts: 128 Location: UK
|
|
|
|
Hello ,
Can any one please respond . I wish to replace all spaces in the file with %20 .
Here is the example
Input ==>
ma Jane Abson|ABSOE |BEUNEA1
Andy Cox|AC2 |BMUAC2
Output==>
ma%20Jane%20Abson|ABSOE |BEUNEA1
Andy%20Cox|AC2%20|BMUAC2
Should shift right to accomadate all the data
Thanks in advance |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
soliciting for an answer is usually considered bad manners
( especially after one hour and a half from the initial post )
if You had looked around a bit You would have seen that
Frank and Kolusu work in a different time zone ( San Jose, USA )
so it' s up to You to convert 9AM San Jose, USA time to Your local time
and find at what time ( Your time ) they might show up at the work place
( maybe a bit earlier ... )
according to
www.timeanddate.com/worldclock/custom.html?sort=1
right now on the USA western coast is between 5 and 6 AM |
|
Back to top |
|
|
Skolusu
Senior Member
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
|
|
|
|
shr_amar wrote: |
Hello ,
Can any one please respond . I wish to replace all spaces in the file with %20 .
Here is the example
Input ==>
ma Jane Abson|ABSOE |BEUNEA1
Andy Cox|AC2 |BMUAC2
Output==>
ma%20Jane%20Abson|ABSOE |BEUNEA1
Andy%20Cox|AC2%20|BMUAC2
Should shift right to accomadate all the data
Thanks in advance |
shr_amar,
Why aren't you replacing the spaces to %20 at the end of each record? Do you want to restrict the change only to the data part? What is the LRECL and RECFM of the input dataset? |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
shr_amar,
Given that you're in such a rush to get an answer, you should have spent more time stating your requirement clearly.
I can only guess that you want to replace each group of "interior" blanks with a %20. If so, you can use DFSORT control statements like this (I assumed your input file has RECFM=FB and LRECL=80):
Code: |
OPTION COPY
INREC BUILD=(1,80,SQZ=(SHIFT=LEFT,MID=C'%20'))
|
The output would be:
Code: |
ma%20Jane%20Abson|ABSOE%20|BEUNEA1
Andy%20Cox|AC2%20|BMUAC2
|
which does NOT correspond to what you showed as the expected output, but would make more sense.
That's the best I can do based on the information you provided. |
|
Back to top |
|
|
shr_amar Warnings : 2 Active User
Joined: 02 May 2005 Posts: 128 Location: UK
|
|
|
|
Frank ,
I appreciate the valuable suggestion you have provided . Due to short time i had pinged one after other.
However many thanks for the solution it is working fine .
Thanks to all .
Rgrds |
|
Back to top |
|
|
|