Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 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
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us