Jim is correct. There are so many basic things wrong with the code that I doubt anyone on the list is going to go very far in helping you. I think you need to review the basics again. Before it goes away this is a good place to walk through free format coding.
https://www.ibm.com/developerworks/community/wikis/home?lang=en#!/wiki/We13116a562db_467e_bcd4_882013aec57a/page/Coding%20in%20Free-Form%20RPG%20IV%20-%20a%20beginner's%20tutorial
Just as a quick start, both of the DCL-F's are wrong. You have DCL-DS's but you don't actually create any data structures. You have fixed format code in a **FREE program. You tried to declare one of your files as USROPN, but you never opened the file.
You've been pointed to this before, but I don't think you read it.
http://www.catb.org/esr/faqs/smart-questions.html
-----Original Message-----
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Jim Oberholtzer
Sent: Thursday, October 31, 2019 11:28 AM
To: RPG programming on IBM i <rpg400-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Parsing a field from xml file and passing it to openssl
You do claim to know RPG right?
The error messages show you where to look in your code.
Try it this way: I tried to resolve this compile error with this: "
whateveritis" but I don't understand why it's not working.
Then we see you actually tried to clear the errors before you ask.
Invest some time in yourself to learn......
Jim Oberholtzer
Chief Technical Architect
Agile Technology Architects
On Thu, Oct 31, 2019 at 11:22 AM Rishi Seth <rishiseth99@xxxxxxxxx> wrote:
Hi,
I tested below code which could store encodedExchange field in it and
I want to pass it's value to openssl command but when trying to pass
it it's giving me multiple compilation errors could someone please
tell me how to correct these errors
**free
dcl-s encodedExchangeToken varchar(88);
XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/INPUT.+
xml':'doc=file case=any path=+
TokenExchangeResponse/encodedExchangeToken');
*inLr = *on;
*************
compilattion errors & Source code is attached pasted source code with
this email as well:-
**free
dcl-s encodedExchangeToken varchar(88);
dcl-s string char(45);
DCL-f UNIX usage(*input) special(1000) PGMNAME('UNIXCMD')
PLIST(UNIXPARM) USROPN;
DCL-F QSYSPRT usage(*output);
dcl-s cmd char(5000);
dcl-s mode char(1) inz('P');
dcl-ds record(1000);
dcl-ds outrec(132);
C UNIXPARM PLIST
C PARM CMD
C PARM MODE
XML-INTO encodedExchangeToken %XML('/home/I0RS01HU/INPUT.+
xml':'doc=file case=any path=+
TokenExchangeResponse/encodedExchangeToken');
cmd = 'encodedExchangeToken'! openssl enc -d -aes-+ Q+
128-ecb -d -aes-128-ecb-k 363631653237354f494d31554c594c4+ Q+
a -nopad -nosalt -base64 -A -OUT string; Q+
read UNIX record;
dow not %eof(UNIX);
outrec = record;
write QSYSPRT outrec;
read UNIX record;
enddo;
close UNIX;
*inlr = *on;
**************
[
https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com
CONFIDENTIALITY NOTICE
This document and any accompanying this email transmission contain confidential information, belonging to the sender that is legally privileged. This information is intended only for the use of the individual or entity named above. The authorized recipient of this information is prohibited from disclosing this information to any other party and is required to destroy the information after its stated need has been fulfilled. If you are not the intended recipient, or the employee of agent responsible to deliver it to the intended recipient, you are hereby notified that any disclosure, copying, distribution or action taken in reliance on the contents of these documents is STRICTLY PROHIBITED. If you have received this email in error, please notify the sender immediately to arrange for return or destruction of these documents.
As an Amazon Associate we earn from qualifying purchases.