midrange.com code scratchpad
Name:
Anonymous
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
11/25/2019 09:00:34 pm
IP:
Logged
Description:
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/RP4
M e s s a g e S u m m a r y
Msg id Sv Number Message text
*RNF3530 00 1 Data structure has no valid subfields.
*RNF7031 00 37 The name or indicator is not referenced.
*RNF7086 00 1 RPG handles blocking for the file. INFDS is updated only wh
blocks of data are transferred.
*RNF7421 30 1 Operands are not compatible with the type of operator.
* * * * * E N D O F M E S S A G E S U M M A R Y * * * * *
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
  5.      F*QSYSPRT   O    F 1000        PRINTER
  6.      dencodedExcha...
  7.      dngeToken         s            500    VARYING
  8.  
  9.      DPOS2             S              5U 0
  10.      D cmd             s           5000a
  11.      D mode            s              1A   inz('P')
  12.      DN1               S              2P 0
  13.      D HexEquivalent   S             52A
  14.      D ToHex           PR                  EXTPROC('cvthc')
  15.      D  HexResult                 65534A   OPTIONS(*VARSIZE)
  16.      D  CharInp                   32767A   OPTIONS(*VARSIZE)
  17.      D  CharNibbles                  10I 0 VALUE
  18.      D Åcommand        s            512a
  19.      d QCMDEXC         PR                  ExtPgm('QCMDEXC')
  20.      d   command                    500a   const
  21.      d   clength                     15p 5 const
  22.  
  23.      D record          ds          1000
  24.      D outrec          s           1000    varying  inz
  25.      Dreplkey          s            100a   inz
  26.  
  27.      C     UNIXPARM      PLIST
  28.      C                   PARM                    CMD
  29.      C                   PARM                    MODE
  30.       /free
  31.        RECORD = *BLANKS;
  32.        OUTREC = *BLANKS;
  33.        // replkey = '363631653237354f494d31554c594c4a';
  34.        XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
  35.        IN2.xml':'doc=file case=any path=+
  36.        TokenExchangeResponse/encodedExchangeToken');
  37.        eval encodedExchangeToken =%trimr(encodedExchangeToken);
  38.        read rec ;
  39.          callp   ToHex(HexEquivalent:+
  40.                           KEY: %len(KEY)*2);
  41.        cmd = 'echo ' + '''' +  encodedExchangeToken + ''' ! openssl +
  42.        // enc -d -aes-128-ecb -K 363631653237354f494d31554c594c4a +
  43.           enc -d -aes-128-ecb -K ' + %trimr(HexEquivalent) +
  44.           ' -nopad -nosalt -base64 -A';
  45.        open UNIX;
  46.        read UNIX record;
  47.        dow not %eof(UNIX);
  48.        pos2 = %scan(x'10' :record);
  49.        Record = %subst(Record :1 :(Pos2 - 1));
  50.        eval outrec = %trimr(record);
  51.        EVAL N1  = %LEN(OUTREC);
  52.         DSPLY N1;
  53.         //Delete the TESTFILE
  54.           Åcommand = 'DLTF FILE(rishi/TESTFILE)';
  55.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  56.           Åcommand = *blanks;
  57.           Åcommand = 'CRTPF FILE(RISHI/TESTFILE) RCDLEN(' + %char(N1) + ')';
  58.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  59.         //Write into file
  60.            EXEC SQL
  61.           INSERT INTO rishi/TESTFILE VALUES (:outrec);
  62.       //   dsply %subst(outrec:1:48);
  63.            read UNIX record;
  64.            enddo;
  65.         close UNIX;
  66.         return;
  67.       /end-free
  68.  
© 2004-2019 by midrange.com generated in 0.005s valid xhtml & css