View previous topic :: View next topic
|
Author |
Message |
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
Hi
I have to validate a Alpha numeric Variable
If Numeric I have to perform Process-1
If Low-values I have perform Process-2
If Alpha Numeric I have perform process-3
For the Numeric and low-values I can use IS numeric and Low values
but for alpha numeric is there any option to find.
Thanks, |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
alpha numeric is a general class. besides, low-values is alphanumeric.
Code: |
evaluate true
when reference-name-alpha-numeric = low-values
perform low-value-routine
when reference-name-numeric is numeric
perform numeric-routine
when other
perform alpha-numeric-routine
end-evaluate
|
|
|
Back to top |
|
|
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
Hi
Above example is fine if the field does not contain special character or junk values .
But this field may contain Special character(A99@),
If this field contain Special character then I have to perform other Process.
So please let me know is there any other way to find.
Thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Quote: |
special character or junk values |
Tell us what is your definition of Alpha-numeric, I mean rules-
0-9, A-Z, a-z, spaces, . are allowed/not allowed etc.
a special charactar or "junk values for you" are alphanumeric under COBOL. |
|
Back to top |
|
|
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
Hi,
Consider the file is converted from the TXT file.
So after reading we have moved the record to Alpha numeric field.
Now we have to check the Fields
If the field conatins only 0-9 then I have to do Process-1
If the field contains A-Z, a-z,0-9 or spaces then I have to do some process
If the field contains special character then I have to do some other Process
Thanks |
|
Back to top |
|
|
agkshirsagar
Active Member
Joined: 27 Feb 2007 Posts: 691 Location: Earth
|
|
|
|
Declare a CLASS for your requirement in the SPECIAL-NAMES. Check if the variable falls under that class. There are plenty of such examples in our forum.
Check below thread. |
|
Back to top |
|
|
brit_ch01
New User
Joined: 24 Dec 2007 Posts: 13 Location: Mumbai
|
|
|
|
I have tried with the Special names
It is working Fine
Thank a lot |
|
Back to top |
|
|
|