Re: Help!--ASCII vs MVS / Unpacked Signed Fields
Posted in 1995
Topics: Stored Procedures & SPL, Connectivity: ESQL/C, 4GL & Embedded SQL
We did the following to convert to EBCDIC for a S/36 system : It may be of help .. ------------------------------ email : tilh@sin-co.SG.DHL.COM ------------------------------ # # Desc : Function to convert values to EBCDIC (necessary for negative values) # Version : 1.00 # Author : Ti Lian Hwang # SCCS : "@(#) ebcdic.4gl 1.1 95/03/13 15:20:23 (C) Copyright DHL, SIN-CO" # Date : 30 Jun 1994 # # Amended : # Initials Amend date Version Description of amendment # tlh 30Jun94 1.00 initial release # { # testing programme main define i integer define str char(10) let i = arg_val(1) call ebcdic(i, arg_val(2)) returning str display str end main } FUNCTION ebcdic (value,byte) DEFINE value INTEGER DEFINE byte SMALLINT DEFINE conv, format,str CHAR(20) DEFINE i SMALLINT LET conv = "}JKLMNOPQR" LET format = "" FOR i = 1 TO byte LET format = format CLIPPED, "&" END FOR LET str = value USING format IF value < 0 THEN LET i = str[byte,byte] LET str[byte,byte] = conv[i + 1] END IF RETURN str CLIPPED END FUNCTION