IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Replace space with %20


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Wed Mar 10, 2010 4:46 pm
Reply with quote

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
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Wed Mar 10, 2010 6:15 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Mar 10, 2010 6:31 pm
Reply with quote

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
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed Mar 10, 2010 10:18 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Mar 10, 2010 10:58 pm
Reply with quote

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
View user's profile Send private message
shr_amar
Warnings : 2

Active User


Joined: 02 May 2005
Posts: 128
Location: UK

PostPosted: Thu Mar 11, 2010 10:52 am
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts replace word 'MONTH' with current mon... SYNCSORT 11
No new posts To replace jobname in a file with ano... SYNCSORT 12
No new posts Merge 2 lines based on Space from a S... DFSORT/ICETOOL 5
Search our Forums:

Back to Top