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
 
Checking a variable has a value in uppercase or lowercase

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Checking a variable has a value in uppercase or lowercase
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    Post subject: Re: Checking a variable has a value in uppercase or lowercas
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    Post subject: Re: Checking a variable has a value in uppercase or lowercas
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    Post subject: re uppercase
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    Post subject: Re: Checking a variable has a value in uppercase or lowercas
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    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 Moving values to a variable of copybo... Vignesh Sid COBOL Programming 6 Wed Sep 06, 2017 1:04 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Move from Comp3 variable to Edited Va... sreekusr COBOL Programming 8 Thu Aug 10, 2017 4:20 pm
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am
No new posts Can I traverse a STEM variable? chong.zhou CLIST & REXX 5 Wed May 31, 2017 3:54 pm

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