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

Checking a variable has a value in uppercase or lowercase


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

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Tue Aug 29, 2006 10:12 pm
Reply with quote

hi,

can we check whether a variable has a value in uppercase or lowercase.

i.e if name(i)= John

i need to check.
move 1 to i.
if name(i) is uppercaser or lowercase???
i.e it J or j and need to perform some manipulation based on the case of the variable.

is this possible in cobol.
Back to top
View user's profile Send private message
Archana_MF

New User


Joined: 21 Jul 2006
Posts: 49
Location: California

PostPosted: Wed Aug 30, 2006 12:40 am
Reply with quote

Try the below conditions

IF "Variable" IS ALPHABETIC-LOWER
or
IF "Variable" IS ALPHABETIC-UPPER
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Wed Aug 30, 2006 1:19 am
Reply with quote

A clarification,

Are you asking if the first letter of the name is upper or lowwer case, any letter in the name, or all letters in the name?

Dave
Back to top
View user's profile Send private message
satish_r84

New User


Joined: 31 Jul 2006
Posts: 6

PostPosted: Wed Aug 30, 2006 6:04 pm
Reply with quote

Hi Dave,

I am referring to only a letter in name.

Regards
Satish
Back to top
View user's profile Send private message
DavidatK

Active Member


Joined: 22 Nov 2005
Posts: 700
Location: Troy, Michigan USA

PostPosted: Thu Aug 31, 2006 4:41 am
Reply with quote

Building on what Archana posted.

It looks like you have an array (table) and one of the variables is 'NAME'

You want to do something if the first letter of 'NAME' is upper case and something else if lower case.

Try this:

Code:

    IF NAME(I)(1:1) IS ALPHABETIC-UPPER
    THEN
        PERFORM SOMETHING
    ELSE
        PERFORM SOMETHING-ELSE
    END-IF


Dave
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
No new posts Masking variable size field - min 10 ... DFSORT/ICETOOL 4
Search our Forums:

Back to Top