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     [SOLVED] Converting on a Packed Decimal to Alpha and attempting a Substring

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Converting on a Packed Decimal to Alpha and attempting a Substring
 Login/Join
 
Member
posted
I am attempting to take a packed decimal and convert it into an alphanumeric so that I can perform a SUBSTR on it.

I use PTOA to do the conversion and then attempt the SUBSTR but my results come back blank. Can anyone help?

Example:
DEFINE TEST
PGROSS_TEMP/P15=12345677;
PGROSS/A16 = PTOA(PGROSS_TEMP,'(P15)',PGROSS);
PGROSS_FINAL/A3 = SUBSTR(16,PGROSS,1,3,3,'A3');

This message has been edited. Last edited by: Ryan Kolatalo,


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 2 | Registered: November 09, 2011Report This Post
Platinum Member
posted Hide Post
It has to do with what is in the first three character positions of PGROSS. Since the number on PGROSS_TEMP is only 8 characters long, PGROSS is 16 characters long, and PTOA right justifys the value when it stores it into PGROSS, the first three characters in PGROSS are indeed blanks.

Try:
 
PGROSS_FINAL/A3 = SUBSTR(16,PGROSS,8,10,3,'A3');
 

and you will see what I mean.


Robert F. Bowley Jr.
Owner
TaRa Solutions, LLC

In WebFOCUS since 2001
 
Posts: 132 | Location: Gadsden, Al | Registered: July 22, 2005Report This Post
Gold member
posted Hide Post
Try this:

DEFINE FILE CAR
DC/P18.2=1234567890.55;
FMT/A10='(P14.2C)';
DC_ALPHA/A18=PTOA(DC, FMT, DC_ALPHA);
END

TABLE FILE CAR
PRINT
CAR.ORIGIN.COUNTRY
CAR.COMP.CAR
DC_ALPHA
COMPUTE SUBSTR_TEMP/A5 = SUBSTR(18, DC_ALPHA, 1, 5, 5, 'A5');
ON TABLE NOTOTAL
END

As Robert said, the first three characters are blank in your e.g. you dont see any values.


WebFOCUS 7.7.02Windows
Output Formats: Excel, HTML, PDF
 
Posts: 82 | Registered: February 23, 2011Report This Post
Expert
posted Hide Post
use FPRINT command




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
FYI

PTOA/FTOA outputs a right justified string.


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
Member
posted Hide Post
Thanks, it appeared left justified so I didn't even think to look at that. Did a TRIM to remove spaces and it works great now


WebFOCUS 7.6
Windows, All Outputs
 
Posts: 2 | Registered: November 09, 2011Report 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     [SOLVED] Converting on a Packed Decimal to Alpha and attempting a Substring

Copyright © 1996-2020 Information Builders