IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to do the below String handling function


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
glsudhir

New User


Joined: 08 May 2006
Posts: 3

PostPosted: Fri Aug 24, 2007 2:01 am
Reply with quote

Hi,

I have the following requirement, any suggestions would be greatly appreciated.

Case 1:

NAME1 - <TOWN OF LANGLADE>
NAME2 - <FIRE DEPARTMENT>
NAME3 - <TOWN OF LANGLADE FIRE DEPARTMENT CLAUDIA CLERK>

Case 2:

NAME1 - <TOWN OF LANGLADE>
NAME2 - <FIRE DEPARTMENT>
NAME3 - <TOWN OF LANGLADE FIRE DEPARTMENT CLAUDIA CLERK>

Case 3:

NAME1 - <TOWN OF LANGLADE>
NAME2 - <FIRE DEPARTMENT>
NAME3 - <TOWN OF LANGLADE FIRE DEPARTMENT CLAUDIA CLERK>

My requirement is to exclude the values of NAME1 & NAME2 from NAME3 and get the string "CLAUDIA CLERK" only.

Note : 1)NAME3 may have NAME1 & NAME2 values only. In this case the output should be spaces
2)NAME3 may have either of NAME1 or NAME2.
3)NAME3 may have more than one space between the NAME1 and NAME2 values.
4)NAME3 may have more than one space between the NAME2 and the required string.


Thanks In Advance,
Dheeraj
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Fri Aug 24, 2007 3:01 am
Reply with quote

Wouldn't that just be something like
unstring name3 delimited by name1 or name2 or spaces into final-area?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Fri Aug 24, 2007 3:22 am
Reply with quote

Hello,

There is only one case visable (i only see one set of data erpeated 3 times - unless there are embedded spaces that the system automagically deleted)? If you need to show embedded blanks, using the "Code" tab near the top of the Reply panel will keep multiple spaces intact.

What is the rule if name1 and name 2 "overlap"? What if name1, name2, or both is "empty"?

How many "nodes" might any of the names contain? Is there a limit? The example shows 3 & 2.

I believe you will need a bit more code than just an unstring. . .

If you post all of the rules, we may have suggestions.
Back to top
View user's profile Send private message
glsudhir

New User


Joined: 08 May 2006
Posts: 3

PostPosted: Fri Aug 24, 2007 10:27 pm
Reply with quote

Hello Dick,

What is the rule if name1 and name 2 "overlap"? What if name1, name2, or both is "empty"?
Comment: No overlapping and will exist atleast one Name field

How many "nodes" might any of the names contain? Is there a limit? The example shows 3 & 2.
Comment: yes, it may have 3 or 2 or 1.

Thanks in Advance,
Dheeraj[/code]
Back to top
View user's profile Send private message
CICS Guy

Senior Member


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

PostPosted: Fri Aug 24, 2007 11:26 pm
Reply with quote

Like William said,
unstring name3 delimited by name1 or name2 or spaces into final-area
should work, maybe multiple with multiple final-areas...
Give it a try, experiment with the CLAUDIA CLERK in different positions......
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


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

PostPosted: Sat Aug 25, 2007 1:05 am
Reply with quote

Hello,

If name1 or name2 has a different number of embedded spaces between nodes than there are embedded spaces between the correcponding nodes in name3, i believe the unstring will not work as wanted.

As CG suggests, and as William suggested, give it a try.

We'll be here when there are questions.
Back to top
View user's profile Send private message
glsudhir

New User


Joined: 08 May 2006
Posts: 3

PostPosted: Sat Aug 25, 2007 1:19 am
Reply with quote

Thank you guys, I'll give a try and appreciated all, for your support and help.

Dheeraj
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
No new posts Sortjoin and Search for a String and ... DFSORT/ICETOOL 1
No new posts Calling an Open C library function in... CICS 1
No new posts DATE2 function SYNCSORT 15
Search our Forums:

Back to Top