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] Left pad string with '0' s in DM

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Left pad string with '0' s in DM
 Login/Join
 
Member
posted
I need a way to left pad a string that user entered with 0's in the start to make it a fixed length string.
EG 1234 will become 0000001234


I would like to do it using -SET DM command if possible. In Define File I could use LENGTH and then SUBSTR
SUBSTR('0000000000' ,1,
(10 - LENGTH(&INPUTSTRING));
when i use it in DM it does not like it.

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


Webfocus 7.7.04, Windows, HTML,Excel , Active PDF, Active HTML, Flex Enable
 
Posts: 21 | Registered: February 17, 2011Report This Post
Virtuoso
posted Hide Post
Use the FTOA function (look up the syntax).

A spec of '(F12L)' will move the value into a string of length 12, formatted as you require.

But you must edit the input to ensure it's a valid integer.
 
Posts: 1925 | Location: NYC | In FOCUS since 1983 | Registered: January 11, 2005Report This Post
Member
posted Hide Post
GOt it to work. As I am relatively new to WEBFocus Sorry for asking this question.
-SET &LENGTHSTR = 10 - ARGLEN(25,&Input,'I3');
-SET &TESTVAL =  SUBSTR(10,'0000000000' ,1, &LENGTHSTR ,&LENGTHSTR,  'A10V');
-SET &finalinput = IF &Input EQ '' THEN FOC_NONE ELSE &TESTVAL.EVAL|&Input.EVAL;  


Webfocus 7.7.04, Windows, HTML,Excel , Active PDF, Active HTML, Flex Enable
 
Posts: 21 | Registered: February 17, 2011Report This Post
Member
posted Hide Post
Thanks jgross, Will look at that function too!


Webfocus 7.7.04, Windows, HTML,Excel , Active PDF, Active HTML, Flex Enable
 
Posts: 21 | Registered: February 17, 2011Report 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] Left pad string with '0' s in DM

Copyright © 1996-2020 Information Builders