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
 
Converting upper case tp lower case ?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
LlewellynNaicker

New User


Joined: 22 Mar 2005
Posts: 5

PostPosted: Tue Mar 22, 2005 5:08 pm    Post subject: Converting upper case tp lower case ?
Reply with quote

Hi people I am new to this forum but I am a bit stuck icon_sad.gif I am trying to convert a field from upper case to lower case alphabet.

Is there any other way to do it besides "FUNCTION" ??
I am using Vs Cobol II.

Thanx in advance.
Llewellyn icon_smile.gif
Back to top
View user's profile Send private message

sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Mar 22, 2005 6:10 pm    Post subject:
Reply with quote

U can use the following statement in cobol:


INSPECT ALPHA-VALUE CONVERTING
'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
TO 'abcdefghijklmnopqrstuvwxyz'

here ur input-field is say 'ABHSJWLWIQ'.....after above conversion it will become 'abhsjwlwiq'.

Just try this out

Thanks
sunny
Back to top
View user's profile Send private message
sunnyk

New User


Joined: 20 Oct 2004
Posts: 59

PostPosted: Tue Mar 22, 2005 6:19 pm    Post subject:
Reply with quote

Hi,
U CAN ALSO USE:

INSPECT LOWER-VALUE CONVERTING
X'818283848586878889919293949596979899A2A3A4A5A6A7A8A9'
TO X'C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7D8D9E2E3E4E5E6E7E8E9'

This `ll convert lower case to upper case.

INSPECT UPPER-VALUE CONVERTING
X'C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7D8D9E2E3E4E5E6E7E8E9'
To
X'818283848586878889919293949596979899A2A3A4A5A6A7A8A9'

This `ll convert upper case to lower case.

Thanks
sunny
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Tue Mar 22, 2005 8:35 pm    Post subject:
Reply with quote

Hi,

Welcome to forum. You can convert uppercase text into lower case in 2 ways

1. Using INSPECT as follows
INSPECT DATA-4
CONVERTING
"ABCDEFGHIJKLMNOPQRSTUVWXYZ" TO "abcdefghijklmnopqrstuvwxyz"


2. You can use Instrict function LOWER-CASE() as follows...

Move "UPPERCASE DATA" TO VAR1.
MOVE FUNCTION LOWER-CASE(VAR1) TO VAR2.
DISPLAY VAR2.

Bye,
Reddy.
Back to top
View user's profile Send private message
LlewellynNaicker

New User


Joined: 22 Mar 2005
Posts: 5

PostPosted: Wed Mar 23, 2005 6:57 pm    Post subject:
Reply with quote

Thanx a million guys I will try this out. icon_biggrin.gif
Back to top
View user's profile Send private message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Wed Apr 13, 2005 12:23 pm    Post subject: clear this doubt
Reply with quote

hi sunny,


I tried with the solution u had given thru the below given code in procedure division.

lower-value is declared in WS section as pic x(10).
===============================================
move "abc" to lower-value.
display "before=" lower-value.

INSPECT LOWER-VALUE CONVERTING
X'818283848586878889919293949596979899A2A3A4A5A6A7A8A9'
tO X'C1C2C3C4C5C6C7C8C9D1D2D3D4D5D6D7D8D9E2E3E4E5E6E7E8E9'

display "after=" lower-value.
===============================================

but both before and after executing the INSPECT , lower-value is containing "abc" only. why is this?

Is the way i have used the INSPECT correct??

Waiting for your reply

thank you
Back to top
View user's profile Send private message
chayanath

New User


Joined: 07 Mar 2005
Posts: 6
Location: vijayawda

PostPosted: Mon May 23, 2005 9:12 pm    Post subject: Re: Converting upper case tp lower case ?
Reply with quote

hello,
to convert upper-lower case and vice-versa do folowing:

1)Procedure division :
MOVE FUCTION UPPER-CASE("hello") TO DATA1.
THE content of data1 after execution is HELLO
DATA1 be alpha-numeric
Same procedure to convert upper-case to lower-case.
hope this solves ur problem
chayanath
Back to top
View user's profile Send private message
eashwar

New User


Joined: 21 May 2005
Posts: 26
Location: Bangalore

PostPosted: Tue May 24, 2005 2:24 am    Post subject: Re: Converting upper case tp lower case ?
Reply with quote

hi,
this is a mere guess

add 64 to each character.

if you got it then ok
other wise ignore it

because i'm also not very sure abt it
Back to top
View user's profile Send private message
vinodmaanju

New User


Joined: 10 May 2005
Posts: 28
Location: Pune

PostPosted: Mon Jan 09, 2006 11:41 pm    Post subject: Re: Converting upper case tp lower case ?
Reply with quote

USING FUNCTION LOWER-CASE OR UPPER-CASE YOU CAN CHANGE CASE.

EXAMPLE :
WORKING-STORAGE SECTION.
77 A PIC X(5) VALUE 'ABCDE'.
77 B PIC X(5).
PROCEDURE DIVISION.
MOVE FUNCTION LOWER-CASE(A) TO B.
DISPLAY ' B : ' B.
STOP RUN.

OUTPUT WILL BE : abcde
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 RFE: DB2 support for mixed case names. Pedro DB2 0 Tue Jul 04, 2017 1:32 am
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts VALIDATE NULL VALUE IN DB2 CASE STATE... useit DB2 5 Thu Feb 09, 2017 4:34 pm
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm
No new posts Summing on Mixed Case Literals Roy Ware SYNCSORT 3 Tue Jan 03, 2017 10:18 pm

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