I have a Logical view which works fine but I cannot display the data in the Report tool because its CCSID is HEX. If I could create it to PF as it is known on AS/400 DB2 i then I could CHGPF on the CCSID (which CHGLF does not have.)

Can this be done? This is on IBM I DB2

This is the code:

CREATE VIEW astlib.acbalmpk AS (
   (SELECT  LMLTPC, COALESCE(IRLOC1,'') as IRLOC1,
    COALESCE(IRLOC2,'') as IRLOC2,
    COALESCE(IRLOC3,'') as IRLOC3,
    IRPRT#,
    IRQOH#,
    IRWHS#,
    '' as IEPRT#,
    '.00' as IEQOH#,
    '' as IELOC1,
    '' as IELOC2,
    '' as IELOC3,
    '' as IERIDC,
    '' as IEWHS#
FROM
   (SELECT LMLTPC, LMLOC1, LMLOC2, LMLOC3
    FROM ASTDTA.ICLOCMLM
    WHERE LMLTPC IN ('PAL', 'RAK'))t1
   LEFT OUTER JOIN
   (SELECT IRLOC1, IRLOC2, IRLOC3, IRPRT#, IRQOH#, IRWHS#
    FROM ASTDTA.ICBLDTIR) t2
   ON LMLOC1=IRLOC1 AND LMLOC2=IRLOC2 AND LMLOC3=IRLOC3)
UNION ALL
   (SELECT ' ' as LMLTPC,
    ' ' as IRLOC1,
    ' ' as IRLOC2,
    ' ' as IRLOC3,
    '' as IRPRT#,
    '.00' as IRQOH#,
    '' as IRWHS#,
    IEPRT#,
    IEQOH#,
    IELOC1,
    IELOC2,
    IELOC3,
    IERIDC,
    IEWHS#
 FROM ASTDTA.ICBALMIE)
)
有帮助吗?

解决方案

Fix the CCSID of the job or Fix the CCSID of the underlying table or Fix the CCSID of the system or Configure the ODBC driver to translate CCSID 65535 or Write a stored procedure that returns data in the proper CCSID

As for this particular workaround, use CAST to make each column the proper CCSID.

SELECT cast (LMLTPC as char (30) CCSID 37) as LMLTPC...
许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top