Focal Point
[solved] Weird alpha value

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

March 16, 2009, 12:18 PM
Hua
[solved] Weird alpha value
Can someone see why this is happening...
the trailing blanks of the TRTP field became ÿ Frowner

Here is the synonym:
FILENAME=LITDES, SUFFIX=DB2     ,
 REMARKS='ledger interface transaction description', $
  SEGMENT=LITDES, SEGTYPE=S0,
    DESCRIPTION='ledger interface transaction description', $
    FIELDNAME=TRTP, ALIAS=TRTP, USAGE=A4, ACTUAL=A4,
      TITLE='Trans,Type', DESCRIPTION='Transaction type', $
    FIELDNAME=APID, ALIAS=APID, USAGE=A1, ACTUAL=A1,
      TITLE='App,Ind', DESCRIPTION='Application indicator', $
    FIELDNAME=TDES, ALIAS=TDES, USAGE=A40, ACTUAL=A40,
      TITLE='Transaction,Description', DESCRIPTION='Transaction description', $
    FIELDNAME=INFC, ALIAS=INFC, USAGE=A1, ACTUAL=A1,
      TITLE='Interface,Code', DESCRIPTION='Interface code', $
  


and here is the fex:

-* File com_rule_lookup.fex
SET HOLDLIST = PRINTONLY
DEFINE FILE LITDES
DSPTEXT/A50=TRTP ||'-' || TDES;
END
TABLE FILE LITDES
PRINT
     DSPTEXT
BY TRTP
WHERE APID EQ 'B';
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE PCHOLD FORMAT XML
END
  


the result(one of)...
<tr linetype="data" linenum="5">
  <td colnum="c0">CIÿÿ</td> 
  <td colnum="c1">CIÿÿ -Cost invoices - all items</td> 
  </tr>
  


The result of DB2 field TRTP should be "CI" or "CI ", not "CIÿÿ" Confused

Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
March 16, 2009, 01:23 PM
Francis Mariani
Hua,

I'm not sure why this is happening, have you tried to comment out the PCHOLD to see if the data is retrieved correctly?

Also, you could code the request like this, no define:

SET HOLDLIST = PRINTONLY
TABLE FILE LITDES
PRINT
COMPUTE DSPTEXT/A50=TRTP ||'-' || TDES;
BY TRTP
WHERE APID EQ 'B';
ON TABLE PCHOLD FORMAT XML
END


By the way, should it be PCHOLD or HOLD?


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
March 16, 2009, 10:28 PM
susannah
Francesco, the PC hold makes this a dropdown list for a launch page.
Hua, rather than go stright to xml, just do a straight dump of the data to see whats up.
maybe your master doesn't match your file
TABLE FILE LITDES
PRINT TRTP
END




In Focus since 1979///7706m/5 ;wintel 2008/64;OAM security; Oracle db, ///MRE/BID
March 17, 2009, 04:05 AM
GamP
I ahve seen this happen before, but then with an MS SQL database.
There it was caused by the database being set up to allow for multiple languages and unicode. We did solve this, but I really can't remember how we did it.
Don't know if this could also be the case in your setup.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
March 17, 2009, 09:44 AM
Hua
Thank you for responding.

I did a simple print, or COMPUTE, the result is the same.

It was fine if I pull the sample data directly in the synonym editor. I also tried use the ODBC driver to dump the data onto excel and it looked fine too.

GamP, LITDES is a physical file DB and no different than other files I have been working on.

Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
March 17, 2009, 12:11 PM
Hua
I just found out that it is data problem. The weird values are actually the *HIVALs in AS400/RPGLE.

I will do a string replace to get rid of them since I know what they look like in WF.

Thanks.

Hua


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
March 17, 2009, 12:27 PM
nubi
golden rule: always always always check your source data.

we all do it but seriously make it the first thing you do next time; will save you a lot of time...

Smiler

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


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor
March 17, 2009, 12:47 PM
Hua
nubi, I am slapping my face now Mad


Hua

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


Developer Studio 7.6.11
AS400 - V5R4
HTML,PDF,XLS
March 18, 2009, 03:30 AM
nubi
well don't slap too hard! we've all done it and its the only way to learn, so the next time you get a problem like this you'll think 'wait a minute, lets check the data first!'

keep going!


Developer Studio 7.64
Win XP
Output: mostly HTML, also Excel and PDF

"Never attribute to malice that which can be adequately explained by stupidity." - Heinlein's Razor