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 from P7 to A7 in FOCUS.

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Converting from P7 to A7 in FOCUS.
 Login/Join
 
Platinum Member
posted
Hi,

I have field that is defined as P7 in the metadata.

FIELDNAME=CPDK_INV_NUMBER, USAGE=P7, ACTUAL=P4, $
I am trying to convert it into an alphanumeric field of length A7 and I am using the following defined field.

DEFINE CPDK_INV_NUM_ALPHA/A7 = FTOA(CPDK_INV_NUMBER,'P7',CPDK_INV_NUM_ALPHA);,$

It gives me blank in the field any ideas?.

Thanks.
 
Posts: 176 | Location: Desplaines | Registered: August 05, 2004Report This Post
Platinum Member
posted Hide Post
Try this:

DEFINE
CPDK_INV_NUM_INT/I7 = CPDK_INV_NUMBER;
CPDK_INV_NUM_ALPHA/A7 = EDIT(CPDK_INV_NUM_INT);
 
Posts: 135 | Location: Portland, OR | Registered: March 23, 2005Report This Post
Guru
posted Hide Post
Take a look at PTOA . It is a legitimate function and the arguments are analogous to FTOA.
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
<Joseph Coule>
posted
EDIT should work directly on a packed number. Try this:

DEFINE CPDK_INV_NUM_ALPHA/A7 = EDIT(CPDK_INV_NUMBER);,$

JC
 
Report This Post
Guru
posted Hide Post
Here's the syntax from IB

DEFINE FILE EMPDATA
P_SAL/P12=SALARY;
END
TABLE FILE EMPDATA
PRINT P_SAL SALARY
COMPUTE A_SAL/A14=PTOA(P_SAL,'(P12L)',A_SAL);
END

Note: the L in P12L will produce leading zeros, remove if not desired
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Platinum Member
posted Hide Post
Thanks all. All of your suggesstions worked. But I liked Joseph's better as it is simple.
 
Posts: 176 | Location: Desplaines | Registered: August 05, 2004Report This Post
Expert
posted Hide Post
Dear New2,
as jimster says, PTOA is the correct way and the only way if your field is really packed decimal. However there are times, especially in legacy systems, where a field says its packed, but its not really. (due to the tool that makes the mfd) EDIT works then, but only then. When, for instance, UPC's change to really long numbers,(coming soon), PTOA is gonna be the ONLY way to handle them. Just fyi.
 
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 from P7 to A7 in FOCUS.

Copyright © 1996-2020 Information Builders