IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

To find the value of a Alpha numeric Variable


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Wed Feb 13, 2008 12:19 pm
Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed Feb 13, 2008 12:48 pm
Reply with quote

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
View user's profile Send private message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Wed Feb 13, 2008 12:54 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Feb 13, 2008 1:47 pm
Reply with quote

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
View user's profile Send private message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Wed Feb 13, 2008 2:23 pm
Reply with quote

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
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Feb 13, 2008 4:27 pm
Reply with quote

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
View user's profile Send private message
brit_ch01

New User


Joined: 24 Dec 2007
Posts: 13
Location: Mumbai

PostPosted: Thu Feb 14, 2008 12:37 pm
Reply with quote

I have tried with the Special names
It is working Fine

Thank a lot
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Find the size of a PS file before rea... COBOL Programming 13
No new posts Variable Output file name DFSORT/ICETOOL 8
Search our Forums:

Back to Top