Focal Point Banner
Community Center Education Summit Technical Support User Groups
Let's Get Social!

Facebook Twitter LinkedIn YouTube
Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DATA FORMAT FIELD CONVERSION
Go
New
Search
Notify
Tools
Reply
  
[SOLVED] DATA FORMAT FIELD CONVERSION
 Login/Join
 
Platinum Member
posted
Here is the end of some code one of my former colleagues left me, and it is the part I need to change prior to my next stage.

I read that FPRINT converts any type of field except a text field to alphanumeric, and that makes complete sense to me.

 COMPUTE FMEASURE/A100 =
         IF DETAIL  EQ 'D' AND MEASURE LT &small 			THEN '^'    ELSE
		 IF COUNTER EQ  1 AND  MEASURE EQ MIN_VALUE 		THEN '^'	ELSE
		 FPRINT(MEASURE, 'D11', 'A40');     AS '&measure'
 


So, I understand my table will have ^ (carets) and entries such as 1,100, depending on the small cell test.

I want to convert the field's format from alphanumeric to numbers for such instances as 1,100 and MISSING (not zeroes) for the instances marked above by carets.

I need the MISSING feature because I'm going to use the results in a calculation. My calculation is set up with MISSING already, and it works in some other procedures where I do not have this data format issue.

At first, I thought ATODBL would do the trick, but I think the caret makes it a little more challenging.

Then, I thought about something like this:

DEFINE FILE TABLE
MEASURE2/D12C MISSING ON= IF (MEASURE EQ '^') THEN MISSING ELSE MEASURE;
END

At this point, my business use case does not allow me to change the code I posted at the beginning. So, I need to change the format after that.

Thoughts?

This message has been edited. Last edited by: JulieA,


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 186 | Registered: September 18, 2015Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Julie,
I'm not sure I understand your example.

MEASURE2/D12C MISSING ON= IF (MEASURE EQ '^') THEN MISSING ELSE MEASURE;

What is the format of MEASURE?
If you're saying MEASURE EQ '^', that would assume MEASURE is ALPHA.
Then, you're trying to assign an Alpha to Numeric.

I'm taking a guess but do you want to do something like the following:
MEASURE2/D12C MISSING ON= IF (MEASURE EQ '^') THEN MISSING ELSE EDIT(MEASURE);
 
Posts: 228 | Location: New York | Registered: July 27, 2004Reply With QuoteReport This Post
Virtuoso
posted Hide Post
Julie,

MEASURE is already a numeric field, FMEASURE it's the equivalent alpha value where some values are replaced by carets under some conditions.

If I understand properly, to accomplish the same conditions as for FMEASURE but keeping it as a numeric field, the below should work

COMPUTE MEASURE2/D11 MISSING ON = IF DETAIL  EQ 'D' AND MEASURE LT &small    THEN MISSING
                             ELSE IF COUNTER EQ  1  AND MEASURE EQ MIN_VALUE THEN MISSING
                             ELSE MEASURE;

May need to be a DEFINE instead of a COMPUTE


WF versions : Prod 8.2.04M gen 33, Dev 8.2.04M gen 33, OS : Windows, DB : MSSQL, Outputs : HTML, Excel, PDF
In Focus since 2007
 
Posts: 2393 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Reply With QuoteReport This Post
Platinum Member
posted Hide Post
Everyone,

Thank you for your replies. I apologize for not responding sooner. I did not realize I had notifications turned to the OFF setting.

I actually figured out my data conversion issue, so I will close this post.

I have a different question. I will write my question in a new post.


WebFocus 8.2.04
WebFocus 8.2.04

 
Posts: 186 | Registered: September 18, 2015Reply With QuoteReport This Post
  Powered by Social Strata  
 

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     [SOLVED] DATA FORMAT FIELD CONVERSION

Copyright © 1996-2018 Information Builders, leaders in enterprise business intelligence.