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.



Read-Only Read-Only Topic
Go
Search
Notify
Tools
[CLOSED] A22 to D12
 Login/Join
 
Master
posted
Hi

I have a number in A22 format. Im trying to convert it to D12 as I need to round it to thousands etc. Im trying to use ATODBL and max input size is 15 characters. any tip how to do this? thankss..

This message has been edited. Last edited by: Kerry,


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
<JG>
posted
? decimal

 

TABLE FILE CAR
PRINT 
COMPUTE A20_INT/A20         = '12345678901234567890';
COMPUTE D20_INT/D20         = EDIT(A20_INT);
COMPUTE A20_DEC/A20         = '1234567890123456.789';
COMPUTE D20_INT_PART/D20    = EDIT(GETTOK(A20_DEC, 20, 1, '.', 20, 'A20'));
COMPUTE D20_DEC_PART/D20    = EDIT(GETTOK(A20_DEC, 20, -1, '.', 20, 'A20'));
COMPUTE D20_DEC_PART_LEN/I9 = ARGLEN(20, GETTOK(A20_DEC, 20, -1, '.', 20, 'A20'), 'I9'); NOPRINT
COMPUTE D20_DEC_DEC/D20.19  = D20_DEC_PART / (10 ** D20_DEC_PART_LEN);
COMPUTE NEW_FORMAT/A20      = 'D20.' || EDIT(D20_DEC_PART_LEN);
COMPUTE D20_DEC/D20         = (D20_INT_PART + D20_DEC_PART) / 1000  ;
BY COUNTRY
WHERE RECORDLIMIT EQ 1
END 
 
Report This Post
Master
posted Hide Post
2nd step fails for me..!!


8.1.05
HTML,PDF,EXL2K, Active, All
 
Posts: 484 | Registered: February 03, 2009Report This Post
Gold member
posted Hide Post
How about just using Packed format?
DEFINE FILE CAR
MYA/A20 WITH COUNTRY  = '12345678901234567890';
MYP/P20         = EDIT(MYA);
MYPB/P17 = MYP/1000 ;
END
TABLE FILE CAR
PRINT MYA MYP MYPB
IF RECORDLIMIT EQ 5
END
-RUN
 


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
Expert
posted Hide Post
I didn't think EDIT worked above 11 digits ?
, well 10 and a half digits.

And the other question is what format id the A22 number in ?, Is it formatted ?, Are there implied decimal places, or is there a decimal point in the text?


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
Gold member
posted Hide Post
EDIT works fine for left hand side long packed fields: e.g. P22.2. This has been true for mainframe FOCUS for many years, and works now for all platforms. I'm not sure when non-mainframe WEBFOCUS started to support this, so you can just try it on your platform/release. The constant alpha (or field) can basically have any form that is recognized by the expression parser: e.g.

 
DEFINE FILE CAR                              
MYD/D12.2 WITH COUNTRY = -123.456 ;          
MYDB/D12.2 WITH COUNTRY = EDIT('-123.456') ;
MYP/P26.2 WITH COUNTRY = -1234567879012345678.01 ;  
MYPB/P26.2 WITH COUNTRY =  EDIT('-1234567879012345678.01') ;  

END                                          
-RUN                                         
TABLE FILE CAR                               
PRINT MYD MYDB MYP MYPB                               
END                                          


IBI Development
 
Posts: 61 | Registered: November 15, 2005Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic


Copyright © 1996-2020 Information Builders