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] convert alphanumeric to numeric with thousands separator using a set command

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] convert alphanumeric to numeric with thousands separator using a set command
 Login/Join
 
Member
posted
Hi all,

I need help converting alphanumeric variable value from hold file to numeric value (with thousands separator). Can some one please help in accomplishing this using a set command?
My code is as below.



-DEFAULTH &TGT = '';

TABLE FILE GRAPHD
SUM
Target/P17M
ON TABLE HOLD AS TARGETHOLD FORMAT ALPHA
END

-RUN

-READ TARGETHOLD &TGT


-TYPE &TGT



Thanks,



thanks,

This message has been edited. Last edited by: <Kathryn Henning>,


webfocus 8.2
 
Posts: 2 | Registered: July 22, 2015Report This Post
Platinum Member
posted Hide Post
Hi ... I tried your example (using the CAR file) but the -TYPE statement didn't display anything ...

Here is an example of -SET commands using the FPRINT and LJUST functions ... maybe this will help

-SET &TRGT = 123456789;
-SET &TRGT1 = FPRINT('&TRGT.EVAL','P17M','A25');
-SET &TRGT2 = LJUST(25,FPRINT('&TRGT.EVAL','P17M','A25'),'A25');
-*
-TYPE ---------------------------------------------------
-TYPE TRGT ---------------- &TRGT
-TYPE TRGT1 --------------- &TRGT1
-TYPE TRGT2 --------------- &TRGT2
-TYPE ---------------------------------------------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Platinum Member
posted Hide Post
Here's another example using the CAR file and the -READFILE command ... maybe this is something of interest to you ...

Can be used to set several variables ...

-*
DEFINE FILE CAR
TARGET/P17M WITH COUNTRY = 123456789;
TARGET_FPRINT/A25 = FPRINT(TARGET,'P17M','A25');
TARGET_LJUST_FPRINT/A25 = LJUST(25,FPRINT(TARGET,'P17M','A25'),'A25');
END
-*
TABLE FILE CAR
PRINT
COUNTRY
CAR
TARGET
TARGET_FPRINT
TARGET_LJUST_FPRINT
WHERE RECORDLIMIT EQ 1
ON TABLE HOLD AS HLD_VARS
END
-RUN
-READFILE HLD_VARS
-TYPE ---------------------------------------------------
-TYPE COUNTRY ---------------- &COUNTRY
-TYPE CAR -------------------- &CAR
-TYPE TARGET ----------------- &TARGET
-TYPE TARGET_FPRINT ---------- &TARGET_FPRINT
-TYPE TARGET_LJUST_FPRINT ---- &TARGET_LJUST_FPRINT
-TYPE ---------------------------------------------------


WebFocus 8.201M, Windows, App Studio
 
Posts: 227 | Location: Lincoln Nebraska | Registered: August 12, 2008Report This Post
Member
posted Hide Post
Thanks. I used your examples and it worked.


webfocus 8.2
 
Posts: 2 | Registered: July 22, 2015Report This Post
Virtuoso
posted Hide Post
stephenc,

Something like this:

TABLE FILE CAR
SUM
DCOST
ON TABLE HOLD AS COST FORMAT ALPHA
END
-RUN

-READ COST &DCOST.A7.
-SET &COST = FPRINT('&DCOST.EVAL', 'D7', 'A15');
-TYPE &COST


should work if the field you want to show thousands separators either defaults to such or specifies such in the master file description.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report 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] convert alphanumeric to numeric with thousands separator using a set command

Copyright © 1996-2020 Information Builders