Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] problem with string
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] problem with string
 Login/Join
 
Silver Member
posted
Hello,
i have this problem:
I have two string:
Name a(35) (this string can cointains one or more word. If cointains more word I must to insert '_' between the word )
Surmane A(35)
I must write only string.

For exemple:
Name = MARIA ROSA
Surname = ROSSI
NEW_STRING = MARIA_ROSA ROSSI

Thanks for any help!!

This message has been edited. Last edited by: Kerry,
 
Posts: 31 | Location: roma | Registered: August 18, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Roby,

You haven't filled in your signature with the version that you are running so I don't know if this function is available to you - one reason why you should fill in your signature!

Use STRREP, if it's available to you, on the Name string and then hard concatenate (||) the result to the result of a soft concatenation (|) of a space and the surname-

NEW_STRING/A71 = STRREP(............) || (' ' | Surname);

Use search (top right) to locate previous posts on STRREP or use the help files in Dev Studio.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5684 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
I don't know the STRREP function.
I use FOCUS 7.2.0.

Can you help me?
Thanks
 
Posts: 31 | Location: roma | Registered: August 18, 2005Reply With QuoteReport This Post
Expert
posted Hide Post
Roby,
quote:
Use search (top right) to locate previous posts on STRREP or use the help files in Dev Studio.
Click "Search the Technical Documentation Library" link in the top right hand area of this page and then in the right hand pair of form inputs choose "FOCUS/WebFOCUS Messages" and then type STRREP in the lower text box. Click GO to get a result set from your search. I'd suggest the fourth item in the list as being the best for your understanding.

Good luck

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5684 | Location: United Kingdom | Registered: April 08, 2004Reply With QuoteReport This Post
Expert
posted Hide Post
for handling the first name,

APP PATH ibisamp
DEFINE FILE EMPLOYEE
LENGTH/I2=ARGLEN(25,JOB_DESC,LENGTH);
NEWJD/A25=STRREP(25,JOB_DESC,1,' ',1,'_',25,NEWJD);
JOB_DESC_OUT/A25=SUBSTR(25,NEWJD,1, LENGTH, LENGTH, JOB_DESC_OUT);
END

 
TABLE FILE EMPLOYEE
BY JOB_DESC BY LENGTH BY NEWJD BY JOB_DESC_OUT
END 

Roma,
i've had ageda with using just the STRREP function , as it will replace all the trailing blanks as well,
so my workaround is to
1) find the actual length of the name using the ARGLEN function
2) do the replace
3) then trim the result back to the beginning length, using the SUBSTRing function.

Now you're ready to concat the LAST_NAME; Proceed as T has demonstrated for you.

As T suggests, the manual 'USING FUNCTIONS' is one of the 4 core manuals, and its priceless in value. Focus has text editing functions that are sine qua non.
-S.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Reply With QuoteReport This Post
Virtuoso
posted Hide Post
You might also look into using the GETTOK option. Note when building strings with concatenation, the length of the target string must be defined of a length at least as long as the sum of the two originating strings.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Reply With QuoteReport This Post
Silver Member
posted Hide Post
Thanks! Big Grin
 
Posts: 31 | Location: roma | Registered: August 18, 2005Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] problem with string

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.