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
 

 

Keeping some characters and removing rest

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

New User


Joined: 16 May 2007
Posts: 3
Location: Novato,California

PostPosted: Wed May 16, 2007 11:56 pm    Post subject: Keeping some characters and removing rest
Reply with quote

Hi,

In the name of a person field(This is assuming name is in last name, comma, first name, middle initial(optional) format) I want to Remove all characters except characters 'A' THRU 'Z' and '-' '/' ''' ',' ' '
Can Someone help me with example how to do that?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 17, 2007 12:42 am    Post subject:
Reply with quote

What do you want to do with the holes left in the field?
Do you want the unwanted characters squeezed out or replaced with something else?
Back to top
View user's profile Send private message
Sanjay Mishra

New User


Joined: 16 May 2007
Posts: 3
Location: Novato,California

PostPosted: Thu May 17, 2007 1:34 am    Post subject: I want unwanted characters squeezed out from string
Reply with quote

Hi William,

Many Thanks for your response .I want unwanted characters squeezed out .

example
*Willi*&am should be converted to William
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 17, 2007 2:16 am    Post subject:
Reply with quote

What I did, in a similar requirement, was to set up a "class" in special names and do a perform with reference modification squeezing out, from left to right, the characters that did not fall into that class....
Back to top
View user's profile Send private message
Sanjay Mishra

New User


Joined: 16 May 2007
Posts: 3
Location: Novato,California

PostPosted: Thu May 17, 2007 3:49 am    Post subject: Pls give one example for this proposed solution
Reply with quote

Hi William,

I think We are approaching towards solution .Can You please provide one example for the proposed solution.Many Thanks.

CLASS VALID-CHAR 'A' THROUGH 'Z' , '-' , '/' , "" , ',' , ' '

suppose var1 is *Sanjay Ku*mar Mishra so it should be converted to Sanjay Kumar Mishra
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 17, 2007 4:21 am    Post subject: Re: Pls give one example for this proposed solution
Reply with quote

Sanjay Mishra wrote:
suppose var1 is *Sanjay Ku*mar Mishra so it should be converted to Sanjay Kumar Mishra
Special names section is where I would define the characters I wanted to be valid.
Preform varying an if valid move with reference modification will squeeze out the junk....
It's my bedtime.....Tomorrow, but look in the Fine manual, it is not that hard...
Back to top
View user's profile Send private message
Sharmila Jagadish

New User


Joined: 07 Mar 2006
Posts: 4
Location: Texas, USA

PostPosted: Thu May 17, 2007 6:30 am    Post subject: Re: Keeping some characters and removing rest
Reply with quote

Hi,
if you have found a way to do this , please give the details on how to do it. I am interested to know .
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Thu May 17, 2007 6:35 am    Post subject: Re: Keeping some characters and removing rest
Reply with quote

Sharmila Jagadish wrote:
if you have found a way to do this , please give the details on how to do it. I am interested to know .
Jeez, what, you have two ids?
It's pretty much a "no brainer"... The clues so far, should be enough, why can't you start to work it out?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 17, 2007 7:06 am    Post subject:
Reply with quote

Quote:
It's my bedtime.....

Go back to bed icon_smile.gif You've got multiple folks interested.


For the interested folks -
.. did you understand the "class" special-names definition?
.. do you understand reference modification?

If both of those make sense to you, create an "output name" field of the same length as the original. Move spaces to the output name field. Iterate using reference modification on both the input and output name fields move each valid byte from the input field to the output field. Increment both reference modifiers on a valid character and only increment the input modifier when the value is not valid. When the modifier reached the end of the input, your name field has been built.

Put together a small bit of test code and if you have questiojs/problems, post them and someone will have suggestions.
Back to top
View user's profile Send private message
Sharmila Jagadish

New User


Joined: 07 Mar 2006
Posts: 4
Location: Texas, USA

PostPosted: Thu May 17, 2007 7:13 am    Post subject:
Reply with quote

thanks dick scherrer
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 17, 2007 8:17 am    Post subject:
Reply with quote

You're welcome

Please let us know how it works for you.

Good luck icon_smile.gif
Back to top
View user's profile Send private message
SHAILESH OZA

New User


Joined: 10 Jun 2005
Posts: 21
Location: Mumbai

PostPosted: Thu May 17, 2007 3:24 pm    Post subject:
Reply with quote

i am telling little bit longer solution but hopefully this will work.

you are taking only last name. genarally last name might be upto 20 to 30 charecters.

just write the code

unstring last-name-field delimited by "," or ";" (write all the special charecter)

into field1,field2,field3, field4.............

After that string field1,field2, field3.......... delimited by SIZE
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu May 17, 2007 7:13 pm    Post subject:
Reply with quote

Hello,

Please try your solution before posting. You might use the sample originally posted.

I'm reasonably sure this will not do what was requested.
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 Remove junk values in a file and rite... KP1125 DFSORT/ICETOOL 2 Wed Jan 25, 2017 9:58 pm
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Removing Extra Spaces in a comma sepa... Puspojit DFSORT/ICETOOL 3 Tue Sep 13, 2016 7:46 am
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts REST API call - username and password... vasanthz All Other Mainframe Topics 1 Thu Mar 10, 2016 6:34 pm


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