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:
- H DftActGrp(*No) BndDir('QC2LE')
- FUNIX IF F 1000 SPECIAL PGMNAME('UNIXCMD')
- F PLIST(UNIXPARM) USROPN
- FK1 IF E DISK usropn
- F*QSYSPRT O F 1000 PRINTER
- dencodedExcha...
- dngeToken s 500 VARYING
-
- d len s 10i 0 inz(16)
- DPOS2 S 5U 0
- D cmd s 5000a
- D mode s 1A inz('P')
- DN1 S 2P 0
- D HexEquivalent S 52A
- d cvthc PR ExtProc('cvthc')
- d target 65534A options(*varsize)
- d src_bits 32767A options(*varsize) const
- d tgt_length 10I 0 value
- d QDCXLATE PR ExtPgm('QDCXLATE')
- d len 5p 0 const
- d data 32702a options(*varsize)
- d table 10a const
- D Åcommand s 512a
- d QCMDEXC PR ExtPgm('QCMDEXC')
- d command 500a const
- d clength 15p 5 const
-
- D record ds 1000
- D outrec s 1000 varying inz
- Dreplkey s 100a inz
-
- C UNIXPARM PLIST
- C PARM CMD
- C PARM MODE
- /free
- RECORD = *BLANKS;
- OUTREC = *BLANKS;
- // replkey = '363631653237354f494d31554c594c4a';
- XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
- IN2.xml':'doc=file case=any path=+
- TokenExchangeResponse/encodedExchangeToken');
- eval encodedExchangeToken =%trimr(encodedExchangeToken);
- open K1 ;
- dow not %eof(K1);
- read rec ;
- //Convert from EBCDIC to ASCII
- QDCXLATE(len: key: 'QTCPASC');
-
- EXEC SQL
- select hex(key)into :HexEquivalent from
- sysibm.sysdummy1;
- // cvthc(HexEquivalent: key: %len(key)*2);
- close k1 ;
- enddo ;
- cmd = 'echo ' + '''' + encodedExchangeToken + ''' ! openssl +
- // enc -d -aes-128-ecb -K 363631653237354f494d31554c594c4a +
- enc -d -aes-128-ecb -K ' + %trimr(HexEquivalent) +
- ' -nopad -nosalt -base64 -A';
- open UNIX;
- read UNIX record;
- dow not %eof(UNIX);
- pos2 = %scan(x'10' :record);
- Record = %subst(Record :1 :(Pos2 - 1));
- eval outrec = %trimr(record);
- EVAL N1 = %LEN(OUTREC);
- DSPLY N1;
- //Delete the TESTFILE
- Åcommand = 'DLTF FILE(rishi/TESTFILE)';
- QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
- Åcommand = *blanks;
- Åcommand = 'CRTPF FILE(RISHI/TESTFILE) RCDLEN(' + %char(N1) + ')';
- QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
- //Write into file
- EXEC SQL
- INSERT INTO rishi/TESTFILE VALUES (:outrec);
- // dsply %subst(outrec:1:48);
- read UNIX record;
- enddo;
- close UNIX;
- return;
- /end-free
-
|
|
|