Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
To find the value of a Alpha numeric Variable

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: To find the value of a Alpha numeric Variable
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: 6968
Location: porcelain throne

PostPosted: Wed Feb 13, 2008 12:48 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Wed Feb 13, 2008 1:47 pm    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Wed Feb 13, 2008 4:27 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts Return a Non Numeric value from REXX Learncoholic CLIST & REXX 3 Fri Sep 01, 2017 8:33 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us