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
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Reasonable way of checking wildcards ... sergeyken CLIST & REXX 5 Wed Sep 07, 2016 8:43 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am


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