For Programmers: Free Programming Magazines  


Home > Archive > Cobol > November 2007 > Re: Help with Inspect _src_ replacing all [SPACE]ALPHANUMERIC[SPACE] by space









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Help with Inspect _src_ replacing all [SPACE]ALPHANUMERIC[SPACE] by space
vferr094@alumni.uottawa.ca

2007-11-01, 6:55 pm


William M. Klein wrote:
> "Robert" <no@e.mail> wrote in message
> news:3jpji3dq3sjk2424kvs012km63fsch6nf0@
4ax.com...
>
> Robert,
> What makes you say that was the original question? (read above or to quote
> ...
>
> "I need to replace a space followed by any A-Z or 1-0 followed by another space
> by just a space"
>
> the word "all" appears in "to represent all alphanumeric" but it still appears
> to be talking about a single character.
>
> Now, the OP *may* have wanted a routine to replace a "word" - but that wasn't
> how I read the request.
>
> --
> Bill Klein
> wmklein <at> ix.netcom.com


Hey guys!

Well, I tried the suggestion above, and sure enough it worked.

I am sorry for not originally describing the problem very clearly. It
was somewhere along the lines...

I have a string say- ' big fresh a apple'
I needed to scrapout the a and replace it with a space, I realize this
will give me double spaces, but I have a routine later that scrubs off
additional spaces, which was why I didnt care.

I would have picked perl if I could have done it in any other
language, the thing is, had to be done in Cobol. I'm a java programmer
who's been working with Cobol for the last while, so I am still
transitioning and not quite an expert on it :)
Thanks again, Van

Robert

2007-11-01, 6:55 pm

On Thu, 01 Nov 2007 11:29:44 -0700, vferr094@alumni.uottawa.ca wrote:

>
>William M. Klein wrote:
>
>Hey guys!
>
>Well, I tried the suggestion above, and sure enough it worked.
>
>I am sorry for not originally describing the problem very clearly. It
>was somewhere along the lines...
>
>I have a string say- ' big fresh a apple'
>I needed to scrapout the a and replace it with a space, I realize this
>will give me double spaces, but I have a routine later that scrubs off
>additional spaces, which was why I didnt care.
>
>I would have picked perl if I could have done it in any other
>language, the thing is, had to be done in Cobol. I'm a java programmer
>who's been working with Cobol for the last while, so I am still
>transitioning and not quite an expert on it :)
>Thanks again, Van


In something like " '*' ", I interpreted * to mean any number of characters.
If you had used a question mark, it would have been clear you meant one character.
Pete Dashwood

2007-11-01, 6:55 pm



"Robert" <no@e.mail> wrote in message
news:m1cki31kb3qfg3q8vvmtvhmvg3n7l60gvt@
4ax.com...
> On Thu, 01 Nov 2007 11:29:44 -0700, vferr094@alumni.uottawa.ca wrote:
>
<snip>[color=darkred]
>
> In something like " '*' ", I interpreted * to mean any number of
> characters.
> If you had used a question mark, it would have been clear you meant one
> character.


Yep. Me too.

Just shows how important it is to formulate requirements carefully and
unequivocally :-)

Pete.
--
"I used to write COBOL...now I can do anything."


William M. Klein

2007-11-01, 6:55 pm


"Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
news:5ov47vFosinvU1@mid.individual.net...
>
>
> "Robert" <no@e.mail> wrote in message
> news:m1cki31kb3qfg3q8vvmtvhmvg3n7l60gvt@
4ax.com...
> <snip>
>
> Yep. Me too.
>
> Just shows how important it is to formulate requirements carefully and
> unequivocally :-)
>
> Pete.
> --
> "I used to write COBOL...now I can do anything."
>

<joke>
Just goes to show you how knowing other languages can SOMETIMES confuse your
reading in a COBOL newsgroup. I read the words - and "*" didn't mean anything
special to me.


--
Bill Klein
wmklein <at> ix.netcom.com


Pete Dashwood

2007-11-01, 6:55 pm



"William M. Klein" <wmklein@nospam.netcom.com> wrote in message
news:l0tWi.56090$g82.22764@fe07.news.easynews.com...
>
> "Pete Dashwood" <dashwood@removethis.enternet.co.nz> wrote in message
> news:5ov47vFosinvU1@mid.individual.net...
> <joke>
> Just goes to show you how knowing other languages can SOMETIMES confuse
> your reading in a COBOL newsgroup. I read the words - and "*" didn't mean
> anything special to me.
>


Never typed a DOS command, then, Bill? [DIR *.*]

Or written SQL? [SELECT * FROM WILDCARDS WHERE SYMBOLS NOT IN (SELECT *
FROM KLEINEXPERIENCE)]

:-)

Pete.
--
"I used to write COBOL...now I can do anything."


Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com