View previous topic :: View next topic
|
Author |
Message |
satish_r84
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
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 |
|
|
Archana_MF
New User
Joined: 21 Jul 2006 Posts: 49 Location: California
|
|
|
|
Try the below conditions
IF "Variable" IS ALPHABETIC-LOWER
or
IF "Variable" IS ALPHABETIC-UPPER |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
satish_r84
New User
Joined: 31 Jul 2006 Posts: 6
|
|
|
|
Hi Dave,
I am referring to only a letter in name.
Regards
Satish |
|
Back to top |
|
|
DavidatK
Active Member
Joined: 22 Nov 2005 Posts: 700 Location: Troy, Michigan USA
|
|
|
|
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 |
|
|
|