Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
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
Go
New
Search
Notify
Tools
Reply
  
[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, 2017Reply With QuoteReport 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: 1506 | Location: Customer Support | Registered: April 12, 2005Reply With QuoteReport 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, 2017Reply With QuoteReport 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.0.1M gen 240, Dev 8.2.04 gen 48, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2105 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport 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, 2017Reply With QuoteReport 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 8204, Unix, Windows
 
Posts: 1617 | Location: New York City | Registered: December 30, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

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-2018 Information Builders, leaders in enterprise business intelligence.