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     converting alpa w/padded zeroes to Decimal

Read-Only Read-Only Topic
Go
Search
Notify
Tools
converting alpa w/padded zeroes to Decimal
 Login/Join
 
Silver Member
posted
Hi,
My current method is not always producing data can one of you experts improve on this code?

-IF POS EQ '000000000000' THEN GOTO SKPOS;
POS5/A12=TRIM('L', POS, 12, '0', 1, 'A12');
POS4/A12=IF POS5 EQ ' ' THEN '0' ELSE POS5;
POS2/A11=EDIT(POS4,'999999999$');
POS3/D12C=EDIT(POS4);
-GOTO SKPP2
-SKPOS
POS3/D12C=0;
-SKPP2

Data looks like is in A12 and may be
000000000000 or
000000000120
may contain negatives?

thanks
Ken


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
 
Posts: 35 | Location: DFW Texas | Registered: May 30, 2008Report This Post
Virtuoso
posted Hide Post
Ken,

How about using the ATODBL function?
POS3/D12=ATODBL(POS, 12, 'D12');


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Silver Member
posted Hide Post
I did try the ATODBL but for some reason it returns zero for values padded with zeros

Basically I just need to convert A12 data to D12C data and the numbers are padded with zeros; it seems simple....but thats the bad ones


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
 
Posts: 35 | Location: DFW Texas | Registered: May 30, 2008Report This Post
Virtuoso
posted Hide Post
Ken,

This worked very well for me:
  
-* File Ken1.fex
DEFINE FILE CAR
APOS/A12=DECODE SEATS (2 '000000000000' 4 '000000001234' 5 '-00000000012');
DPOS/D12=ATODBL(APOS, '12', 'D12');
END
TABLE FILE CAR
PRINT APOS DPOS
BY SEATS
END


Daniel
In Focus since 1982
wf 8.202M/Win10/IIS/SSA - WrapApp Front End for WF

 
Posts: 1980 | Location: Tel Aviv, Israel | Registered: March 23, 2006Report This Post
Expert
posted Hide Post
If all else fails, changing the master file description will do it.

e.g.
FILEDEF TESTDATA DISK testdata.ftm
-RUN
-WRITE TESTDATA 000000025
-WRITE TESTDATA 000000020
-WRITE TESTDATA 000000015
-WRITE TESTDATA 000000010
-WRITE TESTDATA 000000005

EX -LINES 4 EDAPUT MASTER,testdata,CV,FILE
FILENAME=TESTDATA , SUFFIX=FIX,$
SEGNAME=TESTDATA ,
FIELD=TESTDATA ,ALIAS=,I10  ,A10  ,$


TABLE FILE TESTDATA
PRINT *
END


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Silver Member
posted Hide Post
Danny,
thanks it does work with the single quotes around the length field; I did not catch that at first
problem solved


8105 Tomcat and AIX reporting server
input: Teradata, SQL, DB2, Essbase, Oracle, text
output:html, excel, PDF,
 
Posts: 35 | Location: DFW Texas | Registered: May 30, 2008Report This Post
Expert
posted Hide Post
Ken...what about the easy way
just use the EDIT command.
If you're sure that the /A field will only contain integers, then this'll work all day long.
Even if its got negative sign in front

DEFINE FILE CAR
OLD/A12 WITH COUNTRY='000000123456';
NEW/D12=EDIT(OLD);
END
TABLE FILE CAR
PRINT NEW OLD COUNTRY
END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003Report This Post
Expert
posted Hide Post
quote:
what about the easy way
just use the EDIT command


Susannah, brilliant, sometimes we think complex when there is a simple way.


Waz...

Prod:WebFOCUS 7.6.10/8.1.04Upgrade:WebFOCUS 8.2.07OS:LinuxOutputs:HTML, PDF, Excel, PPT
In Focus since 1984
Pity the lost knowledge of an old programmer!

 
Posts: 6347 | Location: 33°49'23.0"S, 151°11'41.0"E | Registered: October 31, 2006Report This Post
Expert
posted Hide Post
Big Grin
yep, if you want the lazy man's way to do it...
come ask me!




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
 
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     converting alpa w/padded zeroes to Decimal

Copyright © 1996-2020 Information Builders