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
 
STRING manipulation to CAPS first char

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

New User


Joined: 28 Jun 2006
Posts: 1
Location: noida

PostPosted: Wed Jun 28, 2006 4:12 pm    Post subject: STRING manipulation to CAPS first char
Reply with quote

Hi,
I need to change one string,
from: micheal learns to rock
to: Micheal Learns To Rock

means every first character should be in Caps.
Constraints:
1- there could be more than one blank between two characters
2-need to place the words exactly on the same location as they were initially

-Anurag Verma
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Wed Jun 28, 2006 5:10 pm    Post subject:
Reply with quote

You will have to initiate a loop (PERFORM VARYING), keep the last character, and if it blank, change the current one with UPPER-CASE function.

O.
Back to top
View user's profile Send private message
Aji

New User


Joined: 03 Feb 2006
Posts: 53
Location: Mumbai

PostPosted: Thu Jun 29, 2006 1:36 pm    Post subject: Re: STRING manipulation
Reply with quote

Hi
Please check the following method.

working-storage section.
01 a pic x(30).
01 j pic 99 value 1.
01 i pic 99 value 0.
01 b pic x value spaces.
01 m.
02 n occurs 30 times.
03 ws-temp pic x.
procedure division.
p1.
ACCEPT A.
perform p2 varying i from 1 by 1 until i > 30.
display m.
stop run.
p2.
move a(i:1) to b.

if a(i:1) = spaces
compute j = i + 1.

if j = i

inspect b converting "abcdefghijklmnopqrstuvwxyz"
to "ABCDEFGHIJKLMNOPQRSTUVWXYZ".

move b to ws-temp(i).


Regards

Aji Cherian
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 Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am
No new posts Find a string in PS file opened in br... mukkas CLIST & REXX 3 Sat Feb 24, 2018 2:15 pm
No new posts line 52: Name or string > 250 char... Ashishpanpaliya CLIST & REXX 5 Sat Oct 14, 2017 2:29 am
No new posts Search for a string in many PDS KARTHIGADEVI CLIST & REXX 5 Fri Sep 08, 2017 2:32 pm
No new posts How to change a string containing the... chong.zhou TSO/ISPF 6 Tue Aug 29, 2017 4:54 pm

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