MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Data validation for a string

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Phaninder
Beginner


Joined: 06 Jul 2005
Posts: 27
Topics: 11

PostPosted: Fri Jul 08, 2005 4:52 am    Post subject: Data validation for a string Reply with quote

Hi , In my code i need to check a string for certain values like accents (which are normally given in dictionaries) In need to check each and every character in the string , Is there any code or any logic that would serve the purpose.
Thanking you .
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jul 08, 2005 6:01 am    Post subject: Reply with quote

phanider,

An example of data would help

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phaninder
Beginner


Joined: 06 Jul 2005
Posts: 27
Topics: 11

PostPosted: Fri Jul 08, 2005 6:58 am    Post subject: Reply with quote

Hi Kolusu Thanks a lot for the response

This is a sample data
(CONSTITUCI
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jul 08, 2005 7:30 am    Post subject: Reply with quote

Phanider,

Try this. The basic idea is to convert all the alphabets,numbers and other character like (dot,semicolon...) to one single character using inspect statement and then use unstring to split the record, then check the first byte for accent characters.

[code:1:29e2794b21]
WORKING-STORAGE SECTION.

01 W-ALPHA PIC X(38) VALUE
'ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789.;'.

01 W-ZEROES PIC X(38) VALUE
'00000000000000000000000000000000000000'.

01 W-TEXT PIC X(75) VALUE
'CONSTITUCI
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Phaninder
Beginner


Joined: 06 Jul 2005
Posts: 27
Topics: 11

PostPosted: Fri Jul 08, 2005 11:10 am    Post subject: Reply with quote

Thanks a lot , sir .
The solution you gave is excellent .
Thanks again
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group