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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
Issue with CTRAN
 Login/Join
 
<Navin>
posted
Hi

I am trying to replace the single quotes with an escape character.

i Have two issues.

* The resultant string gets trimmed off once the length of the original string is more than 15.
* when the original string length is 3 or less , additional characters are getting apended to it .

Is there any way i can solve the issue.

Thank
Naveen.
WF 7.1.6
 
Report This Post
Expert
posted Hide Post
Can you post your code and the before and after results, please?

That will make it easier for us to help you.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
<Navin>
posted
ya sure ,

read as

'original string'(&tmp)---'length of the original string'(&TL)---'translated string'

'ACCOUNT MNEMONIC'---'16'---'ACCOUNT MNEMONIC ';
'ADD2*'---'05'---'ADD2* ';
'BANK ACCOUNT NUMBER'---'19'---'BANK ACCOUNT NUMB';
'DDA'---'03'---'DDAL ';
'INVESTMENT HORIZON*'---'19'---'INVESTMENT HORIZO';
'MASTER MNEMONIC*'---'16'---'MASTER MNEMONIC* ';
'OWNERS INV EXP*'---'15'---'OWNERS INV EXP* ';

the code i use is ,

-SET &TEMPBUFF.&CT = CTRAN(&TL,&TMP,39,27,A&TL);

TL has the length of the string.
TMP is the original string
TEMPBUFF is an array

Thanks
Naveen.
WF 7.1.6
 
Report This Post
Guru
posted Hide Post
Is the lack of single quotes around the format a typo?
  
-SET &TEMPBUFF.&CT = CTRAN(&TL,&TMP,39,27,'A&TL');


(Prod: WebFOCUS 7.7.03: Win 2008 & AIX hub/Servlet Mode; sub: AS/400 JDE; mostly Self Serve; DBs: Oracle, JDE, SQLServer; various output formats)
 
Posts: 391 | Location: California | Registered: April 14, 2003Report This Post
Expert
posted Hide Post
-SET &TMP1 = 'ACCOUNT MNEMONIC';
-SET &TMP2 = 'ADD2*';
-SET &TMP3 = 'BANK ACCOUNT NUMBER';
-SET &TMP4 = 'DDA';
-SET &TMP5 = 'INVESTMENT HORIZON*';
-SET &TMP6 = 'MASTER MNEMONIC*';
-SET &TMP7 = 'OWNERS INV EXP*';
-SET &TMP8 = 'OWNER''S INV EXP*';

-REPEAT ENDREP1 FOR &CT FROM 1 TO 8 STEP 1

-SET &TEMPBUFF.&CT = CTRAN(&TMP.&CT.LENGTH, &TMP.&CT, 39, 27, 'A&TMP.&CT.LENGTH');

-TYPE
-TYPE &CT : &TMP.&CT - &TEMPBUFF.&CT
-TYPE
-ENDREP1


RESULTS IN:

 
 1 : ACCOUNT MNEMONIC - ACCOUNT MNEMONIC
 2 : ADD2* - ADD2*
 3 : BANK ACCOUNT NUMBER - BANK ACCOUNT NUMBER
 4 : DDA - DDA
 5 : INVESTMENT HORIZON* - INVESTMENT HORIZON*
 6 : MASTER MNEMONIC* - MASTER MNEMONIC*
 7 : OWNERS INV EXP* - OWNERS INV EXP*
 8 : OWNER'S INV EXP* - OWNERS INV EXP*


What "escape character" are you using? Are there really any single quotes in the input? What platform are you running this on?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Master
posted Hide Post
Its the lack of a .EVAL thats the problem

-SET &TEMPBUFF.&CT = CTRAN(&TL,&TMP,39,27,A&TL.EVAL);

I find this better syntax - much less to remember

-* initialise replacement to same length as original
-SET &TMPNEW = &TMP ;
-SET &TEMPBUFF.&CT = CTRAN(&TMPNEW.LENGTH,&TMPNEW,39,27,&TMPNEW);



Server: WF 7.6.2 ( BID/Rcaster) Platform: W2003Server/IIS6/Tomcat/SQL Server repository Adapters: SQL Server 2000/Oracle 9.2
Desktop: Dev Studio 765/XP/Office 2003 Applications: IFS/Jobscope/Maximo
 
Posts: 888 | Location: Airstrip One | Registered: October 06, 2006Report This Post
<Navin>
posted
Thanks hammo1j

EVAL was the one that was missing . . That works fine now . .

Francis,

Actually while posting , the whitespaces at the end of all the translated string got cut off.

Thanks
Naveen.
 
Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders