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     ? leading zeros on an &var with type N

Read-Only Read-Only Topic
Go
Search
Notify
Tools
? leading zeros on an &var with type N
 Login/Join
 
Expert
posted
If i read in 067, its perfect.
If i read in 67 from the same form, its type N size 03, and i can't zero fill it.
I can't seem to force it to a type A and get leading zeros.
anybody got any tricks?
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Guru
posted Hide Post
Can you give me an example of what you've tried?

My brain works better when I see the detail.
The brain filing system works great, but needs a few more clues for retrieval.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
<Pietro De Santis>
posted
Susannah, an example would be a good idea.

Meanwhile, I've found that concatenating an alpha character and then removing it sometimes resolves these things in Dialog Manager.
 
Report This Post
Guru
posted Hide Post
While I'm not quite sure what you are asking for, here is a snippet of code that preserves the LZ:
-READ_CAL
-SET &CTR01 = 101;
-SET &CTR02 = EDIT (&CTR01,'$99');
-SET &CTR = &CTR02;
-* Convert to amper variables
-REPEAT ARGS_DONE WHILE &CTR LE &HOW_DEEP;
-READ ARGFILE NOCLOSE &DATA.A42.
-SET &PERBEG = EDIT ('&DATA.EVAL','99999999999999999999');
-SET &PEREND = EDIT ('&DATA.EVAL','$$$$$$$$$$$$$$$$$$$$99999999999999999999');
-SET &BRACKET = EDIT ('&DATA.EVAL','$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$99');
-*-TYPE &PERBEG &PEREND &BRACKET
-RUN
-* May have to format these; they are YYYYMMDDHHMMSSmmmmmm
-SET &LO_DATE.&CTR = EDIT (&PERBEG, '9999/99/99 99:99:99.999999');
-SET &HI_DATE.&CTR = EDIT (&PEREND, '9999/99/99 99:99:99.999999');
-* Edit for display using first 20 positions
-SET &CTR01 = 100 + &CTR + 1;
-SET &CTR02 = EDIT (&CTR01,'$99');
-SET &CTR = &CTR02;
-ARGS_DONE
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Expert
posted Hide Post
the problem is blanks. Your example doesnt have any. My example has blanks.
they can't be tested directly when the field comes in as type N.
they need to be BYTVAL'd.
In regular focus, the format /AnL packsout a numeric field with leading zeros when converting to alpha.
I'm looking for the same effect in DM.
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Gold member
posted Hide Post
Hi Susannah,

Try the following:
 <br />-SET &OUT = FTOA(&IN,'(F3L)','A3');
I tested it with the following values for &IN
- '67'
- ' 67'
- '067'
- '000067'
- ' 0067'
All of them resultet in &OUT = '067';

Is this what you're looking for ?

Roland
 
Posts: 54 | Location: Switzerland | Registered: May 13, 2003Report This Post
Expert
posted Hide Post
Brilliant! i've used FTOA before.
Never even thought of it.
Thanks so much, Rolland.
You should see the icky code i've got now as a work around!
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 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     ? leading zeros on an &amp;var with type N

Copyright © 1996-2020 Information Builders