Focal Point
[SOLVED]Data Field with Signs

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/585102372

October 21, 2009, 01:51 PM
moyer1dl
[SOLVED]Data Field with Signs
Hello,

We have a field that we are pulling from a Mainframe file that is using weird characters for negative or positive signs.

How do I convert that to work nice with Webfocus.

Example

{-0
}-0

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


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
October 21, 2009, 02:06 PM
Francis Mariani
Please tell us what the definition of the columns are and what you want to transform the values to.

Are these character columns?

{-0 -> +999
}-0 -> -999

Are these weird characters due to an incorrect column definition?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 02:27 PM
susannah
{:-) Wears a toupee
{:-0 Wears a toupee and is shocked you detected it




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 21, 2009, 02:28 PM
moyer1dl
The file that we are trying to report off of is an extract produced by a COBOL program. We have been told by our COBOL programmers that these signs are correct and we need to convert them.

Cobol Defines the field as

S9(12)V99

We want it to display as a simple cash amount with two decimal places.


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
October 21, 2009, 02:34 PM
Francis Mariani
I can't imagine how a COBOL program outputs {-0 as a S9(12)V99 field.

In the Master I'd define the field as 2 alpha fields and then add a DEFINE checking for the value in the sign field and multiply the number field by -1 if it's supposed to be negative.

This is easy-peasy...

Susannah!


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 02:47 PM
jimster06
Good grief - this is Zoned Decimal(for those of us who remeber '11' punches or '12' punches!!!). Look at BCD in Wikipedia to see how the sign is expressed in the high-order four bits.
HTH

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


jimster06
DevStu WF 7.6.11
W7
HTML, PDF, EXL2K
October 21, 2009, 03:13 PM
moyer1dl
I think we found a solution.

In the master we used a combination of

Ex USAGE=P15.2, ACTUAL=Z14,


IBM Main Frame: MVS, FIX, VSAM

Windows SQL

WF 7.7
October 21, 2009, 03:17 PM
Francis Mariani
Jim, you mean GI glasses?

How was the Master generated? I can't reveal how long it's been since I last worked with a VSAM file, but shouldn't this type of field be taken care of without any problems, is the field defined properly in the Master?

Is this of any help:
FIELD=SEQ_NO ,E70   ,I5    ,Z5 ,$

I think this is a zoned-decimal field. A DEFINE field taking this and dividing by 100 to enable the decimal places should work.

Or am I talking through my toupee?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 03:18 PM
Francis Mariani
There you go then.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
October 21, 2009, 08:07 PM
susannah
zoned decimal.
ouch.
something deep, very deep, in my gray matter just exploded.




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
October 22, 2009, 01:48 AM
Tony A
quote:
my gray matter just exploded
Well, hopefully your toupee managed to keep most of it in? If not, can you reach the rest of it on the ceiling?

Zoned decimal - just had a Homer shiver moment Frowner