View previous topic :: View next topic
|
Author |
Message |
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Dear friends,
Is there any easy way to remove the Special characters from the variable?
By not hard coding the special variables in program. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
What is your definition of SPECIAL CHARACTERS? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Code a Working storage which don't allow to move those "special characters" into the Working storage variables..!! |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Anuj Dhawan wrote: |
Code a Working storage which don't allow to move those "special characters" into the Working storage variables..!! |
? |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Was just trying to be sarcastic. |
|
Back to top |
|
|
Bill O'Boyle
CICS Moderator
Joined: 14 Jan 2008 Posts: 2501 Location: Atlanta, Georgia, USA
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Is there any easy way to remove the Special characters from the variable?
By not hard coding the special variables in program. |
Suggest you re-phrase your question and provide a detailed explanation of what you want to accomplish.
One easy to do this is to show some "input" values and explain how you want them dealt with (i.e. what do you want as output?).
Keep in mind that while your question is completely clear to you, it may not be to others.
Also, when someone asks for info, you need to provide it. . .
To Repeat: What is your definition of SPECIAL CHARACTERS? |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Hi all,
Thanks for your reponses.
Input-Variable ==> 'ABCY156*&*('
Output-Variable ==> 'ABCY156'
The above is the sample input and output which i needed to accomplish.
I have some crazy logic to achieve it as detailed below:
If Input variable(temp-cnt:1) = spaces
or Input variable(temp-cnt:1) is Numeric
or Input variable(temp-cnt:1) is Alphabetic
Move Input variable(temp-cnt:1) to Output variable(get-cnt:1)
add 1 to temp-cnt get-cnt
else
add 1 to temp-cnt
end-if
The above logic is working fine
As i can see there are many well experienced persons in this forum. I thought of asking suggestions from you people to know is there any easy way to accomplish it..... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
That is an easy way "to accomplish it".
Another might be to set up an 88 level with all of the valid values and do only 1 compare rather than multiple. . . |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
checking separately for space is not necessary since space is part of the ALPHABETIC class:
ALPHABETIC
identifier-1 consists entirely of any combination of the lowercase or uppercase Latin alphabetic characters A through Z and the space. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Per the input-sample you provide, best approach seems to be what d.sch. (used this just to avoid confusion...) has suggested otherwise how many if constructs or how many "ORs" are you going to use... |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you only need two: aphabetic or numeric................... |
|
Back to top |
|
|
Manigandan Aravindhan
New User
Joined: 09 Oct 2007 Posts: 81 Location: India
|
|
|
|
Ya just alphabets and numeric |
|
Back to top |
|
|
|