Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Replacing numbers in a string

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
deepaannjohn

New User


Joined: 23 Feb 2006
Posts: 19
Location: Bangalore

PostPosted: Thu Jun 08, 2006 10:23 am    Post subject: Replacing numbers in a string
Reply with quote

Hi,

I have a variable as below
Refn x(20)
It can have values as below
123 3456
xxx 1234
1234 1234 123

I want to replace all the numbers by some random number or hard coded value. The formatting should be retained as such.

Can somebody help please?
Back to top
View user's profile Send private message

IQofaGerbil

Active User


Joined: 05 May 2006
Posts: 183
Location: Scotland

PostPosted: Thu Jun 08, 2006 2:35 pm    Post subject: Re: Replacing numbers in a string
Reply with quote

Try

INSPECT REFn
CONVERTING
”0123456789 “TO
”##########“ (or whatever values you want to apply)
Back to top
View user's profile Send private message
deepaannjohn

New User


Joined: 23 Feb 2006
Posts: 19
Location: Bangalore

PostPosted: Wed Jun 21, 2006 11:13 am    Post subject:
Reply with quote

This did work. Thank You icon_biggrin.gif
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Incorrect output when trying to add n... monica1 PL/I & Assembler 10 Fri Jan 13, 2017 5:02 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us