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.
DEFINE FILE CAR
P_RETAIL_COST/P13.2 = RETAIL_COST ;
END
TABLEF FILE CAR
PRINT COUNTRY CAR MODEL P_RETAIL_COST
WHERE RECORDLIMIT EQ 1
ON TABLE SAVE AS CARSAVE
END
-RUN
ALPHANUMERIC RECORD NAMED CARSAVE
0 FIELDNAME ALIAS FORMAT LENGTH
COUNTRY COUNTRY A10 10
CAR CARS A16 16
MODEL MODEL A24 24
P_RETAIL_COST P13.2 13
TOTAL 63
1
0 NUMBER OF RECORDS IN TABLE= 1 LINES= 1
0
-READ CARSAVE &COUNTRY.10 &CAR.16 &MODEL.24 &PRCOST.13
-TYPE COUNTRY=&COUNTRY CAR=&CAR MODEL=&MODEL COST=&PRCOST
COUNTRY=ENGLAND CAR=JAGUAR MODEL=V12XKE AUTO COST= 8878.00
WebFOCUS 7.7.05
Posts: 1213 | Location: Seattle, Washington - USA | Registered: October 22, 2007
Can we read Packed decimal and convert it to numeric.. As the packed decimal is amount which shud be numeric.. but the declaration done is in packed decimal i.e p13.2 which is not readable. Hence is there a way where we can read PD and convert it in to numeric or alphanumeric.. I tried an option by changing file format from P13.2 to A14 and read as Read value &X.A14 but it did not work..
&variables are either numeric or alpha. The format of P13.2 is not a valid format for reading into a variable. Dan's example above should give you what you need. If nothing else, you can read it as an alpha string and use EDIT to convert to a (decimal) number.
Regards,
Darin
In FOCUS since 1991 WF Server: 7.7.04 on Linux and Z/OS, ReportCaster, Self-Service, MRE, Java, Flex Data: DB2/UDB, Adabas, SQL Server Output: HTML,PDF,EXL2K/07, PS, AHTML, Flex WF Client: 77 on Linux w/Tomcat
Posts: 2298 | Location: Salt Lake City, Utah | Registered: February 02, 2007
At the risk of overstating the basics: &vars are either alpha or numeric, period end of story. but a numeric can contain decimals. that nifty little improvement came along several releases ago. you can't apply a format to an &var... So, eg, you can read an exchange rate from some source somewhere and have it exist as an &var with decimal postions -SET &EXRATE = 1.6904 ; so that in your fex DEFINE DOLLARS/D12.2= STERLING * &EXRATE ;
In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
Posts: 3811 | Location: Manhattan | Registered: October 28, 2003
Thanks all for valuable replies. I can use PTOA or edit the fields read. but the problem occurs when i try reading it. i.e Read value &X.p13.2 It says not a proper read. Then i changed it to Read value &X.A14 After changing when i move the fields it throws an error. A/A14 = edit(X,'$9999999999999').
Thanks for your replies and suggestions. I got the solution for the above. It wasnt possible without your inputs. I read the fields by Alphanumeric and used the same fields for further condition check, rather copying it to local variables. Thanks again.