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     [CLOSED] What is the function to Left pad the zeros in transformations

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] What is the function to Left pad the zeros in transformations
 Login/Join
 
Member
posted
Hi,

I want to left pad a string based on a string length. I want to use it in transformations. Can I do it?

For ex: 1234 (I need to pad to 12 chars)
Expected Output : 000000001234 (8 zeros need to be padded)

I tried LPAD, LEFTPAD nothing seems to work.

Could you please let me know how can we achieve this?

Thank you in advance.

This message has been edited. Last edited by: FP Mod Chuck,


WebFOCUS 8
Windows, All Outputs
 
Posts: 15 | Registered: March 14, 2017Report This Post
Virtuoso
posted Hide Post
Rboya

What output format are you using? If it is Excel I don't think they will display.


Thank you for using Focal Point!

Chuck Wolff - Focal Point Moderator
WebFOCUS 7x and 8x, Windows, Linux All output Formats
 
Posts: 2127 | Location: Customer Support | Registered: April 12, 2005Report This Post
Member
posted Hide Post
Thanks Chunk for your reply.

I am writing it to a flatfile.

How can we do it?


WebFOCUS 8
Windows, All Outputs
 
Posts: 15 | Registered: March 14, 2017Report This Post
Virtuoso
posted Hide Post
This could be an option where I assume that your input is a text then stays as text
DEFINE FILE CAR
TEXT /A4  = '1234';
PAD  /I12 = EDIT(TEXT);
TPAD /A12 = EDIT(PAD);
END
TABLE FILE CAR
PRINT TPAD
BY COUNTRY
END


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report This Post
Member
posted Hide Post
Thanks for your reply.

I am new to DM.

Trying to use function in transformations and getting below error.

0 NUMBER OF RECORDS IN TABLE= 6 LINES= 6

0 ERROR AT OR NEAR LINE 49 IN PROCEDURE __WCFEX FOCEXEC *
(FOC263) EXTERNAL FUNCTION OR LOAD MODULE NOT FOUND: LPAD
(FOC009) INCOMPLETE REQUEST STATEMENT
BYPASSING TO END OF COMMAND


WebFOCUS 8
Windows, All Outputs
 
Posts: 15 | Registered: March 14, 2017Report This Post
Virtuoso
posted Hide Post
  
DEFINE FILE CAR
SALES_A/A11=LPAD(EDIT(SALES),12,'0');
END
TABLE FILE CAR
PRINT SALES SALES_A
BY COUNTRY
BY CAR
END


WebFOCUS 8206, Unix, Windows
 
Posts: 1853 | Location: New York City | Registered: December 30, 2015Report 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     [CLOSED] What is the function to Left pad the zeros in transformations

Copyright © 1996-2020 Information Builders