×

Good News Everybody!

The new search engine is LIVE!

Please report any problems to david (at) midrange.com.




Check out the ILE RPG Reference. It gives the modern equivalent to the legacy op codes.
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_73/rzasd/rzasdprintthis.htm

For this, see page 662.




-----Original Message-----
From: Rishi Seth [mailto:rishiseth99@xxxxxxxxx]
Sent: Tuesday, November 05, 2019 9:53 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: QCMDEXC Use

sorry correct link is this :- https://code.midrange.com/7079481bf1.html

On Tue, Nov 5, 2019 at 4:46 PM Rishi Seth <rishiseth99@xxxxxxxxx> wrote:

spool file error :- *https://code.midrange.com/index.php
<https://code.midrange.com/index.php>*

On Tue, Nov 5, 2019 at 4:32 PM Rishi Seth <rishiseth99@xxxxxxxxx> wrote:

But how to code the same in free format?

5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 1

Command . . . . . . . . . . . . : CRTBNDRPG
Issued by . . . . . . . . . . : I0RS01HU
Program . . . . . . . . . . . . : EX10
Library . . . . . . . . . . . : RISHI
Text 'description' . . . . . . . : *SRCMBRTXT

Source Member . . . . . . . . . : EX10
Source File . . . . . . . . . . : RS1
Library . . . . . . . . . . . : RISHI
CCSID . . . . . . . . . . . . : 870
Text 'description' . . . . . . . :
Last Change . . . . . . . . . . : 19-11-05 13:32:19

Generation severity level . . . : 10
Default activation group . . . . : *YES
Compiler options . . . . . . . . : *XREF *GEN *NOSECLVL
*SHOWCPY
*EXPDDS *EXT *NOSHOWSKP
*NOSRCSTMT
*DEBUGIO *UNREF *NOEVENTF
Debugging views . . . . . . . . : *SOURCE
Debug encryption key . . . . . . : *NONE
Output . . . . . . . . . . . . . : *PRINT
Optimization level . . . . . . . : *NONE
Source listing indentation . . . : *NONE
Type conversion options . . . . : *NONE
Sort sequence . . . . . . . . . : *HEX
Language identifier . . . . . . : *JOBRUN
Replace program . . . . . . . . : *YES
User profile . . . . . . . . . . : *USER
Authority . . . . . . . . . . . : *LIBCRTAUT
Truncate numeric . . . . . . . . : *YES
Fix numeric . . . . . . . . . . : *NONE
Target release . . . . . . . . . : *PRV
Allow null values . . . . . . . : *NO
Define condition names . . . . . : *NONE
Enable performance collection . : *PEP
Profiling data . . . . . . . . . : *NOCOL
Licensed Internal Code options . :
Generate program interface . . . : *NO
Include directory . . . . . . . :
Preprocessor options . . . . . . : *NONE

' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 3

Line <---------------------- Source Specifications
----------------------------><---- Comments ----> Do Page Change
---------------------------->Src Seq
Number
....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10
Num Line Date Id Number

S o u r c e L i s t i n g



1 FUNIX IF F 1000 SPECIAL PGMNAME('UNIXCMD')
000000 000100
2 F PLIST(UNIXPARM) usropn
191101 000200
3 FQSYSPRT O F 132 PRINTER
000000 000300


4 dencodedExcha...
191101 000400
5 dngeToken s 88
191104 000500
6 D cmd s 5000a
191104 000600
7 D mode s 1A inz('P')
000000 000700
8 dcname s 256
191105 000800
9 dclen s 15p 5
191105 000900
10 D record ds 1000
191104 001000
======> aaaaaa
*RNF3530 00 a 001000 Data structure RECORD has no valid subfields.
11 D outrec ds 132
000000 001100
12
000000 001200
*RNF3530 00 11 001100 Data structure OUTREC has no valid subfields.
*RNF2318 00 3 000300 Overflow indicator *INOA is assigned to
PRINTER file
QSYSPRT.


13 C UNIXPARM PLIST
000000 001300
14 C PARM CMD
000000 001400
15 C PARM MODE
000000 001500
16 /free
000000 001600
17 XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
191101 001700
18 /INPUT.xml':'doc=file case=any path=+
191101 001800
19 TokenExchangeResponse/encodedExchangeToken');
191101 001900
20 eval cname = 'chgjob ccsid(37)';
191105 002000
21 eval clen = %len(%trim(cname));
191105 002100
22 call 'QCMDEXC';
191105 002200
======> aaaaaaaaa
*RNF5347 30 a 002200 An assignment operator is expected with the
EVAL operation.

' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 3

Line <---------------------- Source Specifications
----------------------------><---- Comments ----> Do Page Change
---------------------------->Src Seq
Number
....1....+....2....+....3....+....4....+....5....+....6....+....7....+....8....+....9....+...10
Num Line Date Id Number
23 PARM CNAME;
191105 002300
======> aaaaa
*RNF5347 30 a 002300 An assignment operator is expected with the
EVAL operation.
24 PARM CLEN;
191105 002400
======> aaaa
*RNF5347 30 a 002400 An assignment operator is expected with the
EVAL operation.
25 cmd = 'echo encodedExchangeToken ¦ openssl +
191105 002500
26 enc -d -aes-128-ecb -K +
191105 002600
27 363631653237354f494d31554c594c4a -nopad -nosalt +
191105 002700
28 -base64 -A -out record';
191105 002800
29 open UNIX;
191102 002900
30 read UNIX record;
000000 003000
31 dow not %eof(UNIX);
B01 000000 003100
32 outrec = record;
01 000000 003200
33 write QSYSPRT outrec;
01 000000 003300
34 read UNIX record;
01 000000 003400
35 enddo;
E01 000000 003500
36
000000 003600
37 close UNIX;
000000 003700
38 *inlr = *on;
000000 003800
39 /end-free
000000 003900

* * * * * E N D O F S O U R C E * * * * *
















' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 4

A d d i t i o n a l D i a g n o s t i c M e s s a g e s

Msg id Sv Number Seq Message text
*RNF7030 30 22 002200 The name or indicator CALL is not defined.
*RNF7030 30 23 002300 The name or indicator PARM is not defined.

* * * * * E N D O F A D D I T I O N A L D I A G N O S T I C M
E S S A G E S * * * * *


































' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 5

C r o s s R e f e r e n c e

File and Record References:

File Device References (D=Defined)
Record
QSYSPRT PRINTER 3D 33
UNIX SPECIAL 1D 29 30
31
34 37

Global Field References:

Field Attributes References (D=Defined
M=Modified)
*INLR N(1) 38M
*RNF7030 CALL **UNDEF** 22M
CLEN P(15,5) 9D 21M
CMD A(5000) 6D 14M 25M
CNAME A(256) 8D 20M 21
ENCODEDEXCHANGETOKEN...
A(88) 4D 17M
MODE A(1) 7D 15M
OUTREC DS(132) 11D 32M 33
*RNF7030 PARM **UNDEF** 23M 24M
RECORD DS(1000) 10D 30M 32
34M
UNIXPARM PLIST 2 13D

Indicator References:

Indicator References (D=Defined
M=Modified)
LR 38M

* * * * * E N D O F C R O S S R E F E R E N C E * * * * *









' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 6

E x t e r n a l R e f e r e n c e s

Statically bound procedures:
Procedure References
No references in the source.

Imported fields:
Field Attributes Defined
No references in the source.

Exported fields:
Field Attributes Defined
No references in the source.

* * * * * E N D O F E X T E R N A L R E F E R E N C E S * *
* * *


























' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 7

M e s s a g e S u m m a r y

Msg id Sv Number Message text
*RNF2318 00 1 No overflow indicator is specified; indicator assigned
and
automatic skip to 06 generated.
*RNF3530 00 2 Data structure has no valid subfields.
*RNF5347 30 3 An assignment operator is expected with the EVAL
operation.
*RNF7030 30 2 The name or indicator is not defined.

* * * * * E N D O F M E S S A G E S U M M A R Y * * * * *































' ' ' ' IT
5770WDS V7R3M0 160422 RN IBM ILE RPG RISHI/EX10
' ' 19-11-05 16:24:12 Page 8

F i n a l S u m m a r y

Message Totals:

Information (00) . . . . . . . : 3
Warning (10) . . . . . . . : 0
Error (20) . . . . . . . : 0
Severe Error (30+) . . . . . . : 5
--------------------------------- -------
Total . . . . . . . . . . . . . : 8


Source Totals:

Records . . . . . . . . . . . . : 39
Specifications . . . . . . . . : 35
Data records . . . . . . . . . : 0
Comments . . . . . . . . . . . : 0

* * * * * E N D O F F I N A L S U M M A R Y * * * * *
Compilation stopped. Severity 30 errors found in program.
* * * * * E N D O F C O M P I L A T I O N * * * * *



















' ' ' ' IT

On Tue, Nov 5, 2019 at 4:29 PM Eiresoft Software Solutions <
scourtney@xxxxxxxxxxx> wrote:

Hi,

QCMDEXC

D-Spec

D Cmd PR ExtPgm('QCMDEXC')
D command 256A const
D length 15P 5 const
*---------------------------------------------------
Dcmdtxt S 256A INZ(' ')

In your pgogram :

C eval cmdtxt = 'command here...'
C callp(e) Cmd(cmdtxt : %len(%trim(cmdtxt))
C if %error
C* Error handling here.....
C ENDIF

regards

Sean

Am 2019-11-05 13:34, schrieb Rishi Seth:
Hi,

I am trying to use QCMDEXC in my below RPGLE program but it's
giving me compilation errors:-
FUNIX IF F 1000 SPECIAL PGMNAME('UNIXCMD')
F PLIST(UNIXPARM) usropn
FQSYSPRT O F 132 PRINTER
dencodedExcha...
dngeToken s 88
D cmd s 5000a
D mode s 1A inz('P')
dcname s 256
dclen s 15p 5
D record ds 1000
D outrec ds 132

C UNIXPARM PLIST
C PARM CMD
C PARM MODE
/free
XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/+
/INPUT.xml':'doc=file case=any path=+
TokenExchangeResponse/encodedExchangeToken');
eval cname = 'chgjob ccsid(37)';
eval clen = %len(%trim(cname));
call 'QCMDEXC';
PARM CNAME;
PARM CLEN;
cmd = 'echo encodedExchangeToken ö openssl +
enc -d -aes-128-ecb -K +
363631653237354f494d31554c594c4a -nopad -nosalt +
-base64 -A -out record';
open UNIX;
read UNIX record;
dow not %eof(UNIX);
outrec = record;
write QSYSPRT outrec;
read UNIX record;
enddo;

close UNIX;
*inlr = *on;
/end-free

--
mit freundlichen Grüßen,

Sean Courtney
Eiresoft Software Solutions

Fon : +49 (0) 8271 814229
Fax : +49 (0) 8271 814230
Mobil: +49 (0) 172 8560663

Email: scourtney@xxxxxxxxxxx
--
This is the RPG programming on IBM i (RPG400-L) mailing list To post
a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/rpg400-l.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our
affiliate
link: https://amazon.midrange.com




As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2026 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.