midrange.com code scratchpad
Name:
Anonymous
Scriptlanguage:
Plain Text
Tabwidth:
4
Date:
11/19/2019 03:11:11 pm
IP:
Logged
Description:

Hi,

If i try not to use DS but use these record as a field then get these errors:-

Msg id Sv Number Message text
*RNF7031 00 37 The name or indicator is not referenced.
*RNF7016 20 1 Display Length is greater than maximum allowed.
*RNF5191 30 2 The Result-Field is not a data structure when Factor 2 is a
file name.




Code:
  1.      FUNIX      IF   F 1000        SPECIAL PGMNAME('UNIXCMD')
  2.      F                                     PLIST(UNIXPARM) USROPN
  3.      F*QSYSPRT   O    F 1000        PRINTER
  4.      dencodedExcha...
  5.      dngeToken         s            500    VARYING
  6.  
  7.      DPOS2             S              5U 0
  8.      D cmd             s           5000a
  9.      D mode            s              1A   inz('P')
  10.      D Åcommand        s            512a
  11.      d QCMDEXC         PR                  ExtPgm('QCMDEXC')
  12.      d   command                    500a   const
  13.      d   clength                     15p 5 const
  14.  
  15.      D record          S           1000    varying  inz
  16.      D outrec          s           1000    varying  inz
  17.  
  18.      C     UNIXPARM      PLIST
  19.      C                   PARM                    CMD
  20.      C                   PARM                    MODE
  21.       /free
  22.        RECORD = *BLANKS;
  23.        OUTREC = *BLANKS;
  24.        XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
  25.        INPUT.xml':'doc=file case=any path=+
  26.        TokenExchangeResponse/encodedExchangeToken');
  27.        eval encodedExchangeToken =%trimr(encodedExchangeToken);
  28.        cmd = 'echo ' + '''' +  encodedExchangeToken + ''' ! openssl +
  29.           enc -d -aes-128-ecb -K 363631653237354f494d31554c594c4a +
  30.           -nopad -nosalt -base64 -A';
  31.        open UNIX;
  32.        read UNIX record;
  33.        dow not %eof(UNIX);
  34.        eval record = %trimr(record);
  35.         //Delete the TESTFILE
  36.           Åcommand = 'DLTF FILE(rishi/TESTFILE)';
  37.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  38.           Åcommand = *blanks;
  39.           Åcommand = 'CRTPF FILE(RISHI/TESTFILE) RCDLEN(500)';
  40.           QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
  41.         //Write into file
  42.            EXEC SQL
  43.           INSERT INTO rishi/TESTFILE VALUES (:record);
  44.            dsply %subst(record:1:48);
  45.            read UNIX record;
  46.            enddo;
  47.         close UNIX;
  48.         *inlr = *on;
  49.       /end-free
  50.  
© 2004-2019 by midrange.com generated in 0.007s valid xhtml & css