Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to do the below String handling function

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: How to do the below String handling function
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: 3158
Location: Tucson AZ

PostPosted: Fri Aug 24, 2007 3:01 am    Post subject:
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

Site Director


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

PostPosted: Fri Aug 24, 2007 3:22 am    Post subject:
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    Post subject:
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: 2150
Location: At my coffee table

PostPosted: Fri Aug 24, 2007 11:26 pm    Post subject:
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

Site Director


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

PostPosted: Sat Aug 25, 2007 1:05 am    Post subject:
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    Post subject:
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    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
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
This topic is locked: you cannot edit posts or make replies. Checking wether a string starts from ... sundaram.naveen CLIST & REXX 9 Thu Oct 06, 2016 11:56 am
No new posts Strange EXEC function call in z/VM Willy Jensen CLIST & REXX 3 Wed Oct 05, 2016 2:07 pm
No new posts Replace function abdulrafi COBOL Programming 13 Mon Sep 12, 2016 10:12 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us