View previous topic :: View next topic |
Author |
Message |
Phaninder Beginner

Joined: 06 Jul 2005 Posts: 27 Topics: 11
|
Posted: Fri Jul 08, 2005 4:52 am Post subject: Data validation for a string |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Jul 08, 2005 6:01 am Post subject: |
|
|
phanider,
An example of data would help
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Phaninder Beginner

Joined: 06 Jul 2005 Posts: 27 Topics: 11
|
Posted: Fri Jul 08, 2005 6:58 am Post subject: |
|
|
Hi Kolusu Thanks a lot for the response
This is a sample data
(CONSTITUCI |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Jul 08, 2005 7:30 am Post subject: |
|
|
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 |
|
 |
Phaninder Beginner

Joined: 06 Jul 2005 Posts: 27 Topics: 11
|
Posted: Fri Jul 08, 2005 11:10 am Post subject: |
|
|
Thanks a lot , sir .
The solution you gave is excellent .
Thanks again |
|
Back to top |
|
 |
|
|