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     Padding Alpha with zeros

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Padding Alpha with zeros
 Login/Join
 
Member
posted
Help!

I'm trying to take an A4 filed from my SQLServer data base that sometimes has less than 4 values and pad it with leading zeros, i.e. a School_ID value of 13 becomes 0013. I've looked at the EDIT function, but I must be missing something as this doesn't do what I want.

Thanks!
Chuck Mason
 
Posts: 12 | Registered: May 05, 2004Report This Post
Gold member
posted Hide Post
Hi Chuck,

I guess the following should give you the desired result. Put it in a DEFINE or a COMPUTE:
 <br />SCHOOL_ID_I/I4 = EDIT(SCHOOL_ID);<br />SCHOOL_ID_A/A4 = EDIT(SCHOOL_ID_I);<br /> 
Hope I am right and it helps Wink
 
Posts: 54 | Location: Switzerland | Registered: May 13, 2003Report This Post
Expert
posted Hide Post
format A2L packs with leading zeros, that's what the L indicates.
although of late i've seen it work, as Roland says, even without the L.
which makes A w/leading blanks a puzzle now.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Member
posted Hide Post
Roland -

Thanks for the post! I tried that, but it doesn't add leading zeros. My 13 stayed 13. I need the field to go from '13' to '0013'
 
Posts: 12 | Registered: May 05, 2004Report This Post
Member
posted Hide Post
Susannah -

Let me try that one...Thanks!
 
Posts: 12 | Registered: May 05, 2004Report This Post
<Pietro De Santis>
posted
Try the L for leading zeros.

DEFINE FILE CAR
XTEST/A6 WITH SALES = '23';
YTEST/I6L = EDIT(XTEST);
ZTEST/A6 = EDIT(YTEST);
END
TABLE FILE CAR
PRINT
YTEST ZTEST

ON TABLE SET PAGE NOLEAD
ON TABLE SET STYLESHEET *
TYPE=REPORT, GRID=OFF,
FONT='VERDANA', SIZE=8, $
ENDSTYLE
END
 
Report This Post
Gold member
posted Hide Post
Chuck,

I am surprised it didn't work. I tried it myself on WF526 and it worked perfectly:

DEFINE FILE CAR
X/A4 WITH COUNTRY = '13';
X_I/I4 = EDIT(X);
X_A/A4 = EDIT(X_I);
END
TABLE FILE CAR
PRINT X X_I X_A
BY COUNTRY
END

This gives me '0013' in X_A. EDIT is always adding leading zeros while converting from numeric to alpha, as far as I can remember.

This message has been edited. Last edited by: <Mabel>,
 
Posts: 54 | Location: Switzerland | Registered: May 13, 2003Report 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     Padding Alpha with zeros

Copyright © 1996-2020 Information Builders