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 concatenation

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

New User


Joined: 27 Aug 2008
Posts: 8
Location: Chennai

PostPosted: Fri Mar 26, 2010 5:37 pm    Post subject: String concatenation
Reply with quote

I have i/p in the following format:

MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT

I want o/p should be:

DARNELLA J MCCLANEY
ANGELA S TROMBLEY
SMITT KETTY

can anyone help on this issue?
Back to top
View user's profile Send private message

Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8165
Location: East Dubuque, Illinois, USA

PostPosted: Fri Mar 26, 2010 5:41 pm    Post subject:
Reply with quote

This is a HELP forum, not a DO-YOUR-CODE-FOR-YOU forum. What have you done so far and what is not working about it?
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Mar 26, 2010 5:49 pm    Post subject:
Reply with quote

What's the logic behind the extra 'T' in the sample,
Quote:
KETTY SMIT
Quote:
SMITT KETTY
icon_razz.gif icon_razz.gif
Back to top
View user's profile Send private message
Ranjithkumar

New User


Joined: 10 Sep 2008
Posts: 94
Location: India

PostPosted: Fri Mar 26, 2010 6:03 pm    Post subject: Reply to: String concatenation
Reply with quote

@harunnisa:

1. Replace all balnks by ',' using INSPECT.
2. UNSTRING the value into three variables (L-NAME,F-NAME,M-NAME) delimitted by ','.
3. Use the variables to STRING as per your requirement.

It will work only if the order in input is L-NAME,F-NAME M-NAME and L-NAME and F-NAME should not be blank.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Fri Mar 26, 2010 9:26 pm    Post subject:
Reply with quote

Hello,

Quote:
It will work only if the order in input is L-NAME,F-NAME M-NAME and L-NAME and F-NAME should not be blank.
You have made a "rule" that conflicts with the sample "input" shown. . .

When posting a "solution", it needs to meet the requirement, not just something similar. . .

This is like having your mechanic tell you "I couldn't fix your brakes so i made your horn louder" - compliments of our Admin icon_smile.gif
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2150
Location: At my coffee table

PostPosted: Fri Mar 26, 2010 9:48 pm    Post subject:
Reply with quote

Quote:
MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT

Ignoring the lack of the extra 'T' and the missing ',' in the last name as just typos, unstring delimited by the comma into last-name and first-middle-name and then string them back together.....
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Fri Mar 26, 2010 9:57 pm    Post subject:
Reply with quote

Standardized entry of names in a fixed order with commas, and periods is often promised by designers and user representatives but seldom delivered in reality.
Back to top
View user's profile Send private message
Binop B

Active User


Joined: 18 Jun 2009
Posts: 407
Location: Nashville, TN

PostPosted: Fri Mar 26, 2010 10:00 pm    Post subject:
Reply with quote

CICS Guy wrote:
Quote:
MCCLANEY, DARNELLA J
TROMBLEY, ANGELA S.
KETTY SMIT

Ignoring the lack of the extra 'T' and the missing ',' in the last name as just typos, unstring delimited by the comma into last-name and first-middle-name and then string them back together.....
Since the owner has not replied to any of our queries i think all we can do is guess... icon_biggrin.gif

Basically i think that the three samples provided are three differnet ways the input might come. One with ',' after LAST NAME, another with a '.' in the last of the input, the third with no ',' or '.'. ... icon_razz.gif icon_razz.gif
Back to top
View user's profile Send private message
A_programmers

New User


Joined: 24 Mar 2010
Posts: 6
Location: USA

PostPosted: Thu Apr 08, 2010 3:44 pm    Post subject: Reply to: String concatenation
Reply with quote

1) Convert all commas to spaces.
2) Extract first word using unstring delimited by space.
3) Append at the end of remaining string.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Apr 08, 2010 5:09 pm    Post subject: Re: Reply to: String concatenation
Reply with quote

A_programmers wrote:
1) Convert all commas to spaces.
2) Extract first word using unstring delimited by space.
3) Append at the end of remaining string.


What about people with a multi-part first, middle, or last name?
Or people with no middle name?
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 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
No new posts String after '.' (period) is not copy... balaji81_k SYNCSORT 6 Wed Aug 23, 2017 9:35 pm
No new posts Can we limit length in concatenation ... balaji81_k DB2 7 Tue Aug 22, 2017 2:50 am

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