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     Problem converting Alphanumeric to number

Read-Only Read-Only Topic
Go
Search
Notify
Tools
Problem converting Alphanumeric to number
 Login/Join
 
Gold member
posted
Hi,

I have looked at the Function documentation and I saw that I can convert from alphanumeric to numeric with EDIT command.

Here is my Code:
  

-SET &&SDTIN/I8 = EDIT(&DATAINIZ,'$$$$$$99999999');

 


where &DATAINIZ is 0000082007102.

The exception is:
(FOC318) A FIELD FORMAT IS NOT ALLOWED IN -SET: &&SDTIN/I8 = ED

Why the conversion does not works?


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
 
Posts: 72 | Registered: January 14, 2008Report This Post
Guru
posted Hide Post
Note the disparate legths between 0000082007102 and $$$$$$99999999.

You might be trying to convert a blank to an integer.


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Gold member
posted Hide Post
Sorry the &DATAINIZ value is 00000082007102


WebFOCUS 7.6
Windows 2000
Output: HTML, PDF
 
Posts: 72 | Registered: January 14, 2008Report This Post
Virtuoso
posted Hide Post
quote:
FOC318) A FIELD FORMAT IS NOT ALLOWED IN -SET: &&SDTIN/I8 = ED


I think the error message is telling you, you can't use EDIT with -SET.

I'm sure the dialog manager experts, of which I am not, will have examples for you.


Leah
 
Posts: 1317 | Location: Council Bluffs, IA | Registered: May 24, 2004Report This Post
Guru
posted Hide Post
Good catch Leah.

One can not specify a format with a -SET in DM.

Regards


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
 
Posts: 252 | Location: USA | Registered: April 15, 2003Report This Post
Guru
posted Hide Post
Change

SET &&SDTIN/I8 = EDIT(&DATAINIZ,'$$$$$$99999999');



to

SET &&SDTIN = EDIT(&DATAINIZ,'$$$$$$99999999'); 


Glenda

In FOCUS Since 1990
Production 8.2 Windows
 
Posts: 301 | Location: Galveston, Texas | Registered: July 07, 2004Report This Post
Expert
posted Hide Post
Remember that EDIT has 2 abilities. One is to do simple substring and the other is to convert an alpha string to integer. The latter makes no sense in DM as variables are numbers by default.

You can use EDIT in DM to do substringing as L_G is actually trying to do. Do what Glenda has suggested by removing the format only put a dash (-) in front of the SET.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
 
Posts: 2723 | Location: Ann Arbor, MI | Registered: April 05, 2006Report This Post
Expert
posted Hide Post
If you just wanted the alpha equivalent without the leading zeroes (I know you are cutting off the '8' as well) then you could use PTOA -
-SET &SDTIN = PTOA(0000082007102, '(P13)', 'A13');
-TYPE &SDTIN

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Virtuoso
posted Hide Post
Jimster has the answer (and Glenda the solution.) Here's the explanation: &vars referenced in the -SET statements don't really know that they are alpha or numeric. I know there are lots of different syntax used to make it appear that way (like the .A8.) and i'm sure there are exceptions (like dates) but for the most part, you can use them interchangeably in numeric or string functions AS LONG AS THE VALUE MATCHES THE FUNCTION'S SYNTAX.

If you tell WF to use an &var as a string (like in your example with an EDIT mask) it will. If you tell it to add one (-SET &SDTIN=&SDTIN + 1; ) it will (if the value contains no alpha characters.) No need to specify the format, and as you saw, it throws an error if you try that.

For example, if &VAR1 is equal to 12345, in a WHERE (or DEFINE or -SET) you could use
WHERE FIELDNAME EQ &VAR1 or
WHERE FIELDNAME EQ '&VAR1'
but if the value were 'Some Value' you would get an error with the first example.

Long answer to a short question, but I hope that helps.


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, 2007Report 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     Problem converting Alphanumeric to number

Copyright © 1996-2020 Information Builders