Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to Replace a character with a SPACE in a given string.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
How to Replace a character with a SPACE in a given string.
 Login/Join
 
Gold member
posted
Hi All,

I would like to replace a character with a space in a given string .

-SET &PRINTCLAUSE='E01~E02~E03' ;

I tried something like,

-SET &PRINTCLAUSE= STRREP(&PRINTCLAUSE.LENGTH, &PRINTCLAUSE, 4, '~', 1, ' ', &PRINTCLAUSE.LENGTH, 'A&PRINTCLAUSE.LENGTH');

But it didn't do it for me.

I have to get a string like

'E01 E02 E03'

I need this to pass as column positions for my holdfile to dynamically print the columns.

TABLE FILE SQLOUT
PRINT
&PRINTCLAUSE
END

Thanks and regards,
Johney.


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
Platinum Member
posted Hide Post
If your data is ASCII:

-SET &PRINTCLAUSE = CTRAN(&PRINTCLAUSE.LENGTH,&PRINTCLAUSE,126,32,'A&PRINTCLAUSE.LENGTH');

If it is EBCDIC:

-SET &PRINTCLAUSE = CTRAN(&PRINTCLAUSE.LENGTH,&PRINTCLAUSE,161,64,'A&PRINTCLAUSE.LENGTH');


dwf
 
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005Report This Post
Virtuoso
posted Hide Post
I suppose your E01 and E02 and E03 are fields from a database or the results of a fex.

If you do a -SET command the fields you want to concatenate should be amper values.

This should work

-DEFAULT &F1='12345';
-DEFAULT &F2='abcde';
-DEFAULT &F3='x3x5xx';
-SET &PRINTCLAUSE='&F1'||'&F2'||'&F3';
-TYPE &PRINTCLAUSE


If you run a report and put this &PRINTCLAUSE in the header or as the name of a column it should give the result.

But I think you want to get these fields from an other table you run something like this

TABLE FILE CAR
PRINT COUNTRY 
MODEL
BODY
WHERE COUNTRY EQ 'ENGLAND';
ON TABLE HOLD AS HHEAD FORMAT ALPHA
END
-RUN
-READ HHEAD &E01.A15. &E02.A20. &E03.A20.
etc


Now the &printclause should hold the first 45 characters from the selection and you can use them in your header.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report This Post
Gold member
posted Hide Post
Thank you all,

dwf's solution did the trick for me.Thank you .

Regards,
Johney.


Version 7.6.11
Webfocus installed in AIX 5.3,
desktop PC: Windows-XP based
Output: Excel, HTML, PDF
 
Posts: 83 | Registered: October 19, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     How to Replace a character with a SPACE in a given string.

Copyright © 1996-2020 Information Builders