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:
- FUNIX IF F 1000 SPECIAL PGMNAME('UNIXCMD')
- F PLIST(UNIXPARM) USROPN
- F*QSYSPRT O F 1000 PRINTER
- dencodedExcha...
- dngeToken s 500 VARYING
-
- DPOS2 S 5U 0
- D cmd s 5000a
- D mode s 1A inz('P')
- D Åcommand s 512a
- d QCMDEXC PR ExtPgm('QCMDEXC')
- d command 500a const
- d clength 15p 5 const
-
- D record S 1000 varying inz
- D outrec s 1000 varying inz
-
- C UNIXPARM PLIST
- C PARM CMD
- C PARM MODE
- /free
- RECORD = *BLANKS;
- OUTREC = *BLANKS;
- XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
- INPUT.xml':'doc=file case=any path=+
- TokenExchangeResponse/encodedExchangeToken');
- eval encodedExchangeToken =%trimr(encodedExchangeToken);
- cmd = 'echo ' + '''' + encodedExchangeToken + ''' ! openssl +
- enc -d -aes-128-ecb -K 363631653237354f494d31554c594c4a +
- -nopad -nosalt -base64 -A';
- open UNIX;
- read UNIX record;
- dow not %eof(UNIX);
- eval record = %trimr(record);
- //Delete the TESTFILE
- Åcommand = 'DLTF FILE(rishi/TESTFILE)';
- QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
- Åcommand = *blanks;
- Åcommand = 'CRTPF FILE(RISHI/TESTFILE) RCDLEN(500)';
- QCMDEXC(%trim(Åcommand): %len(%trim(Åcommand)));
- //Write into file
- EXEC SQL
- INSERT INTO rishi/TESTFILE VALUES (:record);
- dsply %subst(record:1:48);
- read UNIX record;
- enddo;
- close UNIX;
- *inlr = *on;
- /end-free
-
|
|
|