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] COBOL Signed Display value conversion

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[Solved] COBOL Signed Display value conversion
 Login/Join
 
Member
posted
We are using the IMS IWAY adapter to read an IMS database but the data will not convert for signed numeric fields as we have it coded.

COBOL FD for fields
05 FSCALVAL PIC S9(12)V9999.
05 FSREPVAL PIC S9(12)V9999.

FSCALVAL & FSREPVAL are the same value in the IMS database.

WebFOCUS report code

DEFINE FILE CN778DBD
TESTVAL/D12.4=EDIT( CN778DBD.FSDATART.FSREPVAL ); <---- attempt to format the value
END
TABLE FILE CN778DBD
PRINT
CN778DBD.FSDATART.FSCALVAL
CN778DBD.FSDATART.FSREPVAL
CN778DBD.FSDATART.TESTVAL
WHERE RECORDLIMIT EQ 10

Documentation for translation - http://infocenter.informationb...source%2Ftopic43.htm

COBOL FORMAT ACTUAL USAGE
PICTURE S9(n)V9(m) Zn+m Pn+m+2.m

Synonym attempt #1 for fields
FIELDNAME=FSCALVAL, ALIAS=FSCALVAL, USAGE=P18.4, ACTUAL=Z16, $
FIELDNAME=FSREPVAL, ALIAS=FSREPVAL, USAGE=A16, ACTUAL=A16, $

Result:
(FOC1391) ACTUAL FORMAT Z IS INVALID FOR SQL FILES. USE FORMAT A : FSCALVAL

Synonym attempt #2 for fields
FIELDNAME=FSCALVAL, ALIAS=FSCALVAL, USAGE=P18.4, ACTUAL= A16, $
FIELDNAME=FSREPVAL, ALIAS=FSREPVAL, USAGE=A16, ACTUAL=A16, $

Result:
(FOC1130) FORMAT CONVERSION ERROR FIELD/KEY : FSCALVAL

Synonym attempt #3 for fields
FIELDNAME=FSCALVAL, ALIAS=FSCALVAL, USAGE=P18.4, ACTUAL= P16, $
FIELDNAME=FSREPVAL, ALIAS=FSREPVAL, USAGE=A16, ACTUAL=A16, $

Result:
FSCALVAL FSREPVAL TESTVAL
.0000 000000000174000{ .0000
.0000 000000000566000{ .0000
.0000 000000000606000{ .0000

FSCALVAL and FSREPVAL are the same value. The { is the sign character and the actual values are:

174.0000
566.0000
606.0000

Any idea what we need to do? Thanks!

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


WebFOCUS 8.0.09
ZOS Linux LPAR
All outputs
 
Posts: 12 | Registered: August 11, 2015Report This Post
Master
posted Hide Post
quote:
...USAGE=P18.4, ACTUAL=Z16...

For a zoned decimal number, your first attempt looks pretty good to me.

Why would the error message (FOC1391) think you are using a 'SQL file'?

Is your SUFFIX=IMS in the master file?
 
Posts: 822 | Registered: April 23, 2003Report This Post
Member
posted Hide Post
Was EDA.
FILENAME=CN778DBD, SUFFIX=EDA , $

Changed to IMS

FILENAME=CN778DBD, SUFFIX=IMS , $
SEGMENT=FSDATART, SEGTYPE=S2, $
GROUP=FSDATAKY, ALIAS=FSDATAKY, ELEMENTS=4, $
FIELDNAME=FSCCYYMM, ALIAS=FSCCYYMM, USAGE=A6, ACTUAL=A6, $
(snip)
FIELDNAME=FSCALVAL, ALIAS=FSCALVAL, USAGE=P18.4, ACTUAL=Z16, $
FIELDNAME=FSMANVAL, ALIAS=FSMANVAL, USAGE=A16, ACTUAL=A16, $


Now the error below... no clue where the X is coming from. Spaced the line out and tried three times.

(FOC1201) ERROR LOADING MODULE : IMSX
(FOC1074) INVALID SUFFIX : IMSX

Tried IM and.....
(FOC1201) ERROR LOADING MODULE : IM
(FOC1074) INVALID SUFFIX : IM

Tried IMSX and.....
(FOC1201) ERROR LOADING MODULE : IMSX
(FOC1074) INVALID SUFFIX : IMSX


WebFOCUS 8.0.09
ZOS Linux LPAR
All outputs
 
Posts: 12 | Registered: August 11, 2015Report This Post
Master
posted Hide Post
When we used the IMS Adapter for z/OS, we would set SUFFIX=IMS.

If you are using another way to get to IMS (IWAY), I wouldn't necessarly change the SUFFIX then.

If the issue is that the way your are connecting doesn't support zoned decimal formats in the master, then maybe consider defining them as A16, as you have, and then converting them.

Something like:
DEFINE FILE CAR
 FSMANVAL/A16 WITH COUNTRY = '000000000174000{';
 FIRST15/A15  = SUBSTR(16, FSMANVAL, 1, 15, 15, 'A15'); 
 LAST1/A1     = SUBSTR(16, FSMANVAL, 16, 16, 1, 'A1');
 LASTVAL/A1   = DECODE LAST1 ('{' '0'
                              'A' '1');
 FSMANVALNEW/A16 = FIRST15 | LASTVAL;
 FSMANVALOUT/D16.4 = ATODBL(FSMANVALNEW, '16', FSMANVALOUT) / 10000;
END
TABLE FILE CAR
PRINT
  COUNTRY
  FSMANVAL
  FSMANVALOUT
IF RECORDLIMIT EQ 1
ON TABLE SET ONLINE-FMT STANDARD
END  

  COUNTRY     FSMANVAL                  FSMANVALOUT                             
  -------     --------                  -----------                             
  ENGLAND     000000000174000{             174.0000   

I am only converting the '{' and 'A', you can add the other characters, if you think this is worth trying.
 
Posts: 822 | Registered: April 23, 2003Report This Post
Member
posted Hide Post
Thank you David!

I'll add the other values to the DECODE and detect the negative numbers.


WebFOCUS 8.0.09
ZOS Linux LPAR
All outputs
 
Posts: 12 | Registered: August 11, 2015Report This Post
Member
posted Hide Post
I would mark this as solved but I can't find a way to do so.


WebFOCUS 8.0.09
ZOS Linux LPAR
All outputs
 
Posts: 12 | Registered: August 11, 2015Report This Post
Virtuoso
posted Hide Post
Return to your first post, then Edit it (bottom right corner icon : a folder with a pen)

Then add [SOLVED] at the beginning of the post subject


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: 2409 | Location: Montreal Area, Qc, CA | Registered: September 25, 2013Report 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] COBOL Signed Display value conversion

Copyright © 1996-2020 Information Builders