midrange.com code scratchpad
Name:
it's giving below error
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
12/01/2019 07:53:50 pm
IP:
Logged
Description:

Message . . . . : The target for a numeric operation is too small to hold
the result (C G D F).
Cause . . . . . : RPG procedure SQ8 in program RISHI/SQ8 at statement 152
performed an arithmetic operation which resulted in a value that is too
large to fit in the target. If this is a numeric expression, the overflow
could be the result of the calculation of some intermediate result.
Recovery . . . : Contact the person responsible for program maintenance to
determine the cause of the problem.
Possible choices for replying to message . . . . . . . . . . . . . . . :
D -- Obtain RPG formatted dump.
S -- Obtain system dump.
F -- Obtain full formatted dump.
More...
Code:
  1.      H DftActGrp(*No) BndDir('QC2LE')
  2.      FUNIX      IF   F 1000        SPECIAL PGMNAME('UNIXCMD')
  3.      F                                     PLIST(UNIXPARM) USROPN
  4.      FK1        IF   E             DISK    usropn
  5.      F*QSYSPRT   O    F 1000        PRINTER
  6.      dencodedExcha...
  7.      dngeToken         s            500    VARYING
  8.  
  9.      d len             s             10i 0 inz(16)
  10.      DPOS2             S              5U 0
  11.      D cmd             s           5000a
  12.      D mode            s              1A   inz('P')
  13.      DN1               S              2P 0
  14.      D HexEquivalent   S             52A
  15.      d cvthc           PR                  ExtProc('cvthc')
  16.      d   target                   65534A   options(*varsize)
  17.      d   src_bits                 32767A   options(*varsize) const
  18.      d   tgt_length                  10I 0 value
  19.      d QDCXLATE        PR                  ExtPgm('QDCXLATE')
  20.      d   len                          5p 0 const
  21.      d   data                     32702a   options(*varsize)
  22.      d   table                       10a   const
  23.      D Åcommand        s            512a
  24.      d QCMDEXC         PR                  ExtPgm('QCMDEXC')
  25.      d   command                    500a   const
  26.      d   clength                     15p 5 const
  27.  
  28.      D record          ds          1000
  29.      D outrec          s           1000    varying  inz
  30.      Dreplkey          s            100a   inz
  31.  
  32.      C     UNIXPARM      PLIST
  33.      C                   PARM                    CMD
  34.      C                   PARM                    MODE
  35.       /free
  36.        RECORD = *BLANKS;
  37.        OUTREC = *BLANKS;
  38.        // replkey = '363631653237354f494d31554c594c4a';
  39.        XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
  40.        IN2.xml':'doc=file case=any path=+
  41.        TokenExchangeResponse/encodedExchangeToken');
  42.        eval encodedExchangeToken =%trimr(encodedExchangeToken);
  43.        open K1  ;
  44.        dow not %eof(K1);
  45.        read rec ;
  46.         //Convert from EBCDIC to ASCII
  47.               QDCXLATE(len: key: 'QTCPASC');
  48.  
  49.            EXEC SQL
  50.           select  hex(key)into :HexEquivalent from
  51.            sysibm.sysdummy1;
  52.           //   cvthc(HexEquivalent: key: %len(key)*2);
  53.         close k1 ;
  54.         enddo ;
  55.        cmd = 'echo ' + '''' +  encodedExchangeToken + ''' ! openssl +
  56.        // enc -d -aes-128-ecb -K 363631653237354f494d31554c594c4a +
  57.           enc -d -aes-128-ecb -K ' + %trimr(HexEquivalent) +
  58.           ' -nopad -nosalt -base64 -A';
  59.        open UNIX;
  60.        read UNIX record;
  61.        dow not %eof(UNIX);
  62.        pos2 = %scan(x'10' :record);
  63.        Record = %subst(Record :1 :(Pos2 - 1));
  64.        eval outrec = %trimr(record);
  65.        EVAL N1  = %LEN(OUTREC);
  66.         DSPLY N1;
  67.         //Delete the TESTFILE
  68.           Åcommand = 'DLTF FILE(rishi/TESTFILE)';
  69.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  70.           Åcommand = *blanks;
  71.           Åcommand = 'CRTPF FILE(RISHI/TESTFILE) RCDLEN(' + %char(N1) + ')';
  72.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  73.         //Write into file
  74.            EXEC SQL
  75.           INSERT INTO rishi/TESTFILE VALUES (:outrec);
  76.       //   dsply %subst(outrec:1:48);
  77.            read UNIX record;
  78.            enddo;
  79.         close UNIX;
  80.         return;
  81.       /end-free
  82.  
© 2004-2019 by midrange.com generated in 0.008s valid xhtml & css