View previous topic :: View next topic |
Author |
Message |
Vinodch Beginner
Joined: 23 Dec 2002 Posts: 80 Topics: 32 Location: Chennai, India
|
Posted: Thu Jan 04, 2007 8:28 am Post subject: Alphabet Check |
|
|
Hi
I have a requirement; to check the names as alphabetic but I need to inlcude some special characters also along with the alphabets like "-"; I have tried this using special names but it's not working; anyother means to handle this; the program is written in COBOL. Please help! _________________ Thanks,
Vinod. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
|
Back to top |
|
 |
Vinodch Beginner
Joined: 23 Dec 2002 Posts: 80 Topics: 32 Location: Chennai, India
|
Posted: Thu Jan 04, 2007 11:17 am Post subject: |
|
|
Hi Kolusu
I tried the changes suggested; but what happens is even the alphabetic is getting rejected; please mentioned code below:
*----------------------*
ENVIRONMENT DIVISION.
*----------------------*
CONFIGURATION SECTION.
*----------------------*
SPECIAL-NAMES.
CLASS ALPHA-NUM IS 'A' THRU 'Z',
'a' THRU 'b',
'-'.
.
.
.
.
.
IF INP-DTL-PATIENT-FIRST-NAME IS ALPHA-NUM
CONTINUE
.
.
.
.
. _________________ Thanks,
Vinod. |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Thu Jan 04, 2007 11:34 am Post subject: |
|
|
vinodch,
you are checking 'a' thru 'z' and 'A' thru 'Z' and for '-' only. what happens if the field has spaces?
For ex if INP-DTL-PATIENT-FIRST-NAME is defined x(20) and you moved just 'vinodch' to the field it only occupies 7 bytes and the rest 13 bytes out of 20 are all spaces. In this case your alphabetic check will fail because you are not considering the space as a valid alphabet. Add ' ' also to the Alpha-num list and re-run your program
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
Vinodch Beginner
Joined: 23 Dec 2002 Posts: 80 Topics: 32 Location: Chennai, India
|
Posted: Thu Jan 04, 2007 3:47 pm Post subject: |
|
|
Thanks Kolusu. It worked ! _________________ Thanks,
Vinod. |
|
Back to top |
|
 |
|
|