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     [SOLVED] help with substr (amper variables)

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] help with substr (amper variables)
 Login/Join
 
Master
posted
Can anyone help me get the &XP2 line to work?

-*************************************
-* CONVERT STRING WITH ODD CHARACTERS
-*************************************
-SET &ECHO=ALL;
-*
-TYPE .
-SET &CATEGORY = 'TRAIN/EX';
-TYPE CATEGORY = &CATEGORY
-*
-SET &NL = ARGLEN(&CATEGORY.LENGTH,&CATEGORY,'I2');
-TYPE LENGTH = &NL
-*
-SET &XP = POSIT(&CATEGORY, 6, '/', 1, 'I1');
-TYPE '/' IS FOUND IN POSITION: &XP
-*
-SET &XP1 = SUBSTR(6,&CATEGORY, 1, &XP,&XP-1,'A5');
-TYPE &XP1
-*
-SET &XP2 = SUBSTR(6,&CATEGORY,(&XP+1),(&XP+2), 2,'A2');
-TYPE &XP2
-GOTO OUTT

-SET &XCATEGORY = &XP1 | &XP2;
-*
-TYPE CATEGORY = &XCATEGORY
-*
-*
-OUTT
-EXIT

Thanks Red Face

This message has been edited. Last edited by: Tomsweb,


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report This Post
Master
posted Hide Post
Are you getting any error?


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Master
posted Hide Post
Isn't the length of Category is 8?

Try this,

-SET &ECHO='ALL';

-*************************************
-* CONVERT STRING WITH ODD CHARACTERS
-*************************************
-*
-TYPE .
-SET &CATEGORY = 'TRAIN/EX';
-TYPE CATEGORY = &CATEGORY
-*
-SET &NL = ARGLEN(&CATEGORY.LENGTH,&CATEGORY,'I2');
-TYPE LENGTH = &NL
-*
-SET &XP = POSIT(&CATEGORY, &NL, '/', 1, 'I1');
-TYPE '/' IS FOUND IN POSITION: &XP
-*
-SET &XP1 = SUBSTR(&NL,&CATEGORY, 1, &XP,&XP-1,'A5');
-TYPE &XP1
-*
-SET &XP2 = SUBSTR(&NL,&CATEGORY,(&XP+1),(&XP+2), 2,'A2');
-TYPE &XP2
-GOTO OUTT

-SET &XCATEGORY = &XP1 | &XP2;
-*
-TYPE CATEGORY = &XCATEGORY
-*
-*
-OUTT
-EXIT


WFConsultant

WF 8105M on Win7/Tomcat
 
Posts: 780 | Location: Florida | Registered: January 09, 2005Report This Post
Virtuoso
posted Hide Post
Tom,
Do you just want to get rid of the '/'?
If so, use STRIP
  
-SET &CATEGORY = 'TRAIN/EX';
-SET &CATLEN=&CATEGORY.LENGTH;
-SET &XCATEGORY=STRIP(&CATLEN, &CATEGORY, '/', 'A&CATLEN.EVAL');


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Master
posted Hide Post
quote:
-SET &CATEGORY = 'TRAIN/EX';
-SET &CATLEN=&CATEGORY.LENGTH;
-SET &XCATEGORY=STRIP(&CATLEN, &CATEGORY, '/', 'A&CATLEN.EVAL');


Thanks...I did not think of strip...like it more as it is less coding.


Tomsweb
WebFOCUS 8.1.05M, 8.2.x
APP Studio, Developer Studio, InfoAssist, Dashboards, charts & reports
Apache Tomcat/8.0.36
 
Posts: 573 | Location: Baltimore, MD | Registered: July 06, 2006Report 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     [SOLVED] help with substr (amper variables)

Copyright © 1996-2020 Information Builders