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
 

 

How to remove the Special character from the variable?

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

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Thu Jun 25, 2009 7:16 pm    Post subject: How to remove the Special character from the variable?
Reply with quote

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

Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 25, 2009 7:31 pm    Post subject:
Reply with quote

What is your definition of SPECIAL CHARACTERS?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 25, 2009 7:43 pm    Post subject:
Reply with quote

Code a Working storage which don't allow to move those "special characters" into the Working storage variables..!!
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Jun 25, 2009 8:05 pm    Post subject:
Reply with quote

Anuj Dhawan wrote:
Code a Working storage which don't allow to move those "special characters" into the Working storage variables..!!


?
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Jun 25, 2009 8:24 pm    Post subject:
Reply with quote

Was just trying to be sarcastic.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Fri Jun 26, 2009 1:30 am    Post subject: Reply to: How to remove the Special character from the varia
Reply with quote

Click on the below link -

http://ibmmainframes.com/viewtopic.php?p=143786&highlight=#143786

Post questions if you're not sure.

Regards,
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: Fri Jun 26, 2009 1:30 am    Post subject:
Reply with quote

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

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Fri Jun 26, 2009 12:30 pm    Post subject:
Reply with quote

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

Site Director


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

PostPosted: Fri Jun 26, 2009 7:14 pm    Post subject:
Reply with quote

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

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 26, 2009 7:23 pm    Post subject:
Reply with quote

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

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Jun 26, 2009 8:27 pm    Post subject:
Reply with quote

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... icon_rolleyes.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Fri Jun 26, 2009 8:44 pm    Post subject:
Reply with quote

you only need two: aphabetic or numeric...................
Back to top
View user's profile Send private message
Manigandan Aravindhan

New User


Joined: 09 Oct 2007
Posts: 81
Location: India

PostPosted: Thu Jul 09, 2009 6:10 pm    Post subject:
Reply with quote

Ya just alphabets and numeric
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
This topic is locked: you cannot edit posts or make replies. DSList (3.4) cannot display Chinese c... jacobdng TSO/ISPF 4 Wed Oct 05, 2016 2:51 pm
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Continuation Character ballaswaroop SYNCSORT 8 Thu Aug 25, 2016 4:46 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts Adding a descending character to a file Steve Ironmonger DFSORT/ICETOOL 3 Fri Jul 15, 2016 4:57 pm


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