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     Defining a field that could be alpha or numeric

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Defining a field that could be alpha or numeric
 Login/Join
 
Member
posted
One of my files was recently changed. The older data has an A25 field. The newer data has it broken up into 3 fields of A13, Packed 6 and Packed 6. How do I define the field(s) when it/they could be either of these?
 
Posts: 20 | Location: Syracuse NY | Registered: August 26, 2005Report This Post
Expert
posted Hide Post
syracuse, ah this is where focus shines, de-garbaging really messy input.
A: If your orginal A25 field contained those 2 numeric parts in fixed locations, then you can change your master
from
OLDFIELD,,A25,$
to
NEWFIELD,,A13,$
NEWNUMBER1,,P6,$
NEWNUMBER2,,P6,$
B: lets assume its not.
you have 2 routes to go: 1) keep the old layout and do alot of new defines?
2) set up the new layout (with one small difference), and reconstruct the old layout where needed.
I like #2.
NEWFIELD,,A13,$
THING1,,A6,$
THING2,,A6,$
--notice that the number fields are Alpha...
in the master. that's important, we don't know whats in there really.
Now, lets find out. Focus has this nice way of not bombing if you try to make a number out of something that isn't..it just gives you a nice zero.
In the master file, add some DEFINES
DEFINE NEWNUMBER1/I6 = EDIT(THING1);$
DEFINE NEWNUMBER2/I6= EDIT(THING2);$
....(whatever numeric form you need)
DEFINE temptext/A25=IF NEWNUMBER1 IS 0 AND NEWNUMBER2 IS 0 THEN NEWFIELD ELSE
NEWFIELD | THING1 | THING2 ;$
... that just reconstructed the old A25 out of whatever was in the field to begin with.
...now if you really only want the first 13 charactes of the new text field, so be it:
NEWTEXT/A13=EDIT(temptext,'9999999999999');
...or use the SUBSTR function, if you prefer.
Do all this DEFINEing in the .MFD and you're good to go. Prove it to yourself with
DEFINE FILE CAR
 
FRED/A5 WITH MODEL ='FRED';
IFRED/I5=EDIT(FRED);
ILUCY/P9 WITH MODEL=12345;
ALUCY/A9=EDIT(ILUCY);
END
 
TABLE FILE CAR
SUM FRED IFRED ILUCY ALUCY
BY COUNTRY
END

Its stopped snowing..i can drive home now.
g'nite syracuse.




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
Member
posted Hide Post
It's freeeeezing up here in the center of the state - the North Country even made the weather channel - I pity the reporter.
Thanks for the info. That works OK given that we are changing all future store names from A25 to A13. But since 0 is a valid number for both of the new P6 fields, if I had wanted to truly check to see if the new fields are packed, is there a way to do it like in COBOL? Because I may have wanted to keep the A25 if they weren't packed. If I assume 0 indicates an alpha and concatenate all 3 fields together, 0 could really be a valid numeric and my store name ends up with unprintable characters in it (namely the packed fields).
 
Posts: 20 | Location: Syracuse NY | Registered: August 26, 2005Report This Post
Guru
posted Hide Post
Check out the function CHKPCK


ttfn, kp


Access to most releases from R52x, on multiple platforms.
 
Posts: 346 | Location: Melbourne Australia | Registered: April 15, 2003Report This Post
Member
posted Hide Post
quote:
Check out the function CHKPCK

I didn't get a chance to check this out since the file was revamped and all records are now A13, P6, P6 - I don't have records of A25 mixed in. Sounds like a good function for other uses though. Thanks!
 
Posts: 20 | Location: Syracuse NY | Registered: August 26, 2005Report This Post
Virtuoso
posted Hide Post
Well, it must have been very cold up there...15 months between the question and the response...

glad it works.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

 
Posts: 2387 | Location: Amsterdam, the Netherlands | Registered: December 03, 2006Report 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     Defining a field that could be alpha or numeric

Copyright © 1996-2020 Information Builders