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
 

 

Check whether a variable is special character or not

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Sat Jun 30, 2007 2:59 pm    Post subject: Check whether a variable is special character or not
Reply with quote

Hi All,

I have to code a Easytrieve program in which, I have to check whether any special character is present in that variable. The variable is of length 1 only.

I believe I can code like checking whether the given variable is Alphabet or numeric. and when this condition does not match i can say that the variable is a special Character or blank.

Can anybody help me out in checking whether a variable is Alphabet or Numeric like in COBOL we have "IS ALPHABETIC" or "IS NUMERIC". Is there there any equivalent to this in Easytrieve?

Thanks in advance
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: Sat Jun 30, 2007 5:08 pm    Post subject:
Reply with quote

Hello,

You will need to define what exactly is a "special character" for your requirement.

For example, is a lowerr-case letter a special character? Is a hex zero-five (tab) a special character? Etc. . .

Once you have defined your ist of special characters, you can test for them.

If i've not understood what you want to do, please clarify.
Back to top
View user's profile Send private message
ratheesh_1983

New User


Joined: 11 Apr 2007
Posts: 19
Location: hyderabad

PostPosted: Sun Jul 01, 2007 11:29 am    Post subject:
Reply with quote

Hi kaleelahamed,

list all the special characters as constants in the working storage section as follows:

W-SP1 W 3 A VALUE '@'
W-SP2 W 20 A VALUE '#'

lets say WS-VAR is the variable u r checking...

IF WS-VAR = W-SP1 OR +
WS-VAR = W-SP2
PERFORM some section name.

Hope this helps............ icon_lol.gif
Back to top
View user's profile Send private message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Mon Jul 02, 2007 9:22 am    Post subject: Thanks for the help!!!
Reply with quote

But my requirement is like I dont know the special character I will encounter. So I think I will have to define all the Alphabets and numbers in variables and check them for my validation.

Aren't there any option like the one I mentioned earlier?
Quote:
Can anybody help me out in checking whether a variable is Alphabet or Numeric like in COBOL we have "IS ALPHABETIC" or "IS NUMERIC". Is there there any equivalent to this in Easytrieve?


Thanks for the reply.
Back to top
View user's profile Send private message
kaleelahamed

New User


Joined: 08 Jun 2006
Posts: 45
Location: Trumbull, CT

PostPosted: Mon Jul 02, 2007 12:10 pm    Post subject:
Reply with quote

Thanks to both you.

I have used the reply of urs in another topic with subject "Length of Alpha numeric field/string in Easytrieve".

Its working fine for me. Since I am new to Easytrieve I dint try the option at first hand itself.

Thanks once again for the help.

I have used like,

Code:
IF <fieldname> ALPHABETIC OR <fieldname> NUMERIC
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: Mon Jul 02, 2007 5:56 pm    Post subject:
Reply with quote

You're welcome icon_smile.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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Check Binary Values for symbols gandikk CA Products 3 Tue Mar 21, 2017 5:11 am


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