Exforsys

Free Training

Convert all Uppercase to lowercase - How?

This is a discussion on Convert all Uppercase to lowercase - How? within the COBOL forums, part of the Programming Talk category; It is very simple question, Thing is I am new here... Please anyone among you tell me the function/procedure for ...

Go Back   Exforsys > Programming Talk > COBOL

Exforsys.com

  #1 (permalink)  
Old 04-21-2006, 03:10 PM
Junior Member
 
Join Date: Jan 2006
Posts: 7
Matrix_2006 is on a distinguished road
Convert all Uppercase to lowercase - How?

It is very simple question, Thing is I am new here... Please anyone among you tell me the function/procedure for converting uppercase to lowercase in Cobol.

Thanks to you all
Regards,
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 04-21-2006, 08:34 PM
iatbm's Avatar
Member
 
Join Date: Apr 2006
Posts: 51
iatbm is on a distinguished road
I am not Cobol expert but this one is pretty easy i think

Function Upper-case ("string")
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 05-06-2006, 09:14 PM
Member
 
Join Date: Apr 2006
Posts: 51
encoder is on a distinguished road
Here's what I found for your problem, I hope these codes helps.

Quote:
LOCS$O – Convert to Lower Case
This routine converts a buffer from upper case to lower case. It is called with two arguments, InOption and Buffer. InOption is a PIC S9999 USAGE COMP-5 (16-bit integer). Buffer is CHAR(*)VAR. The conversion is as follows:
InOption = 1: Convert all upper case letters to lower case
InOption = 2: Convert all upper case letters except the first one after a period to lower case
InOption = 3: Convert all upper case letters except the one immediately following a blank to lower case
InOption = 4: Convert all upper case letters except the one immediately following a blank or a lower case letter to lower case
InOption = 5: Convert all upper case letters except the one immediately following a non-upper case letter to lower case unless the word begins with "MC"
InOption = 6: Convert all upper case letters except the one immediately following a non-upper-case letter and a non-number
InOption = 7: Convert all upper case letters except the one immediately following a non-upper-case letter unless the next two characters are "ST", "ND", "RD", OR "TH"
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 05-06-2006, 09:21 PM
Member
 
Join Date: May 2006
Posts: 45
Allan is on a distinguished road
Hope this helps

Quote:
01 Item-1 Pic x(30) Value "Hello World!".
01 Item-2 Pic x(30).
. . .
Display Item-1
Display Function Upper-case(Item-1)
Display Function Lower-case(Item-1)
Move Function Upper-case(Item-1) to Item-2
Display Item-2
The code above displays the following messages on the system logical output device:

Quote:
Hello World!
HELLO WORLD!
hello world!
HELLO WORLD!
The DISPLAY statements do not change the actual contents of Item-1, but affect only how the letters are displayed. However, the MOVE statement causes uppercase letters to be moved to the actual contents of Item-2.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 02-19-2008, 05:51 PM
Junior Member
 
Join Date: Feb 2008
Posts: 1
cobolnovice is on a distinguished road
I don't have an answer to this, but an additional question. I'm trying to make part of a word(s) uppercase. For example, I am trying to take a title like 'editor i' and make it 'editor I'. I've tried using the following code, but when I run my program it doesn't do it.

INSPECT TITLE-DESCRIPTION OF WS-AREA REPLACING ALL
' i ' BY ' I '.
INSPECT TITLE-DESCRIPTION OF WS-AREA REPLACING ALL
' ii ' BY ' II '.
INSPECT TITLE-DESCRIPTION OF WS-AREA REPLACING ALL
' iii ' BY ' III '.
INSPECT TITLE-DESCRIPTION OF WS-AREA REPLACING ALL
' iv ' BY ' IV '.

Any suggestions?
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-07-2008, 10:33 AM
Junior Member
 
Join Date: Jul 2007
Posts: 5
eddie13 is on a distinguished road
I use Liant's RMCOBOL and there is a very easy way to convert. I think several versions of COBOL offer the same... Try
INSPECT WS-USER-NAME CONVERTING 'abcdefghijklmnopqrstuvwxyz' TO 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'. It works both ways (UPPER AND LOWER).
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads

Thread Thread Starter Forum Replies Last Post
How to Convert an ER Model to Star Schema? dwuser Dataware Housing Tools 1 10-04-2006 01:57 PM
How to Convert ER Model to Star Schema?? dwuser Data Warehousing 1 04-21-2006 08:09 PM


All times are GMT -4. The time now is 07:08 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0
Copyright 2004 - 2009 Exforsys Inc. All rights reserved.