Hi

I created a function ZIPTXT which should "clean" text (change polish national chars to lating chars, and change all special chars to space)

code is:

H NoMain Option(*SrcStmt : *NoDebugIO) D zipTXT pr D gsqTXTF 100 Varying D gsqTXTT 100 Varying D sqlNull1 5i 0 D sqlOutNull 5i 0 D sqlState 5 D sqlFuncNm 517 Varying D sqlSpecName 128 Varying D sqlMsgTxt 70 Varying D sqlScrPad 250 D sqlFinalFlg 5i 0 P zipTXT b Export
D zipTXT pi D gsqTXTF 100 Varying D gsqTXTT 100 Varying D sqlNull1 5i 0 D sqlOutNull 5i 0 D sqlState 5 D sqlFuncNm 517 Varying D sqlSpecName 128 Varying D sqlMsgTxt 70 Varying D sqlScrPad 250 D sqlFinalFlg 5i 0
* Tables for conversion
D POL C 'ąęćśżźńółĄĘĆŚŻŹŃÓŁ' D LAT C 'aecszznolAECSZZNOL' D LOW C 'aąbcćdeęfghijklłmnńoóprsśtuvwxyzźż' D CAP C 'AĄBCĆDEĘFGHIJKLŁMNŃOÓPRSŚTUVWXYZŹŻ' D SPC C '~`!@#$%˘&*()_-+={}\|;:",<>?/' D BLK C ' '
C Movel *blanks TXTI 100 C Movel *blanks TXTO 100 C Movel gsqTXTF TXTI
C POL:LAT XLate TXTI TXTO C Movel *blanks TXTI C Movel TXTO TXTI C Movel *blanks TXTO
C LOW:CAP XLate TXTI TXTO C Movel *blanks TXTI C Movel TXTO TXTI C Movel *blanks TXTO
C SPC:BLK XLate TXTI TXTO
C Movel TXTO gsqTXTT
C SetOn LR C Return
P zipTXT e
Then I created it with command:

1) CRTRPGMOD MODULE(LIB/ZIPTXT) SRCFILE(LIB/SQLSRC) DBGVIEW(*LIST)
2) CRTSRVPGM SRVPGM(LIB/ZIPTXT) EXPORT(*ALL)
3) CREATE FUNCTION LIB/ZIPTEXT (varCHAR(100)) RETURNS varCHAR (100) LANGUAGE RPGLE DETERMINISTIC NO SQL RETURNS NULL ON NULL INPUT NO EXTERNAL ACTION ALLOW PARALLEL FINAL CALL SCRATCHPAD 250 PARAMETER STYLE DB2SQL EXTERNAL NAME 'LIB/ZIPTXT(ZIPTXT)'
When I calling this function it returns blank text with 100-chars length.

What is wrong?


As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.