× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



SQL0171 30 4 Position 70 Argument 3 of function ENCRYPT not valid.

On Fri, Sep 20, 2019 at 4:04 PM Rob Berendt <rob@xxxxxxxxx> wrote:

And what is that error level 30 message? There should be some compile
message like:
Msg id Sv Number Message text

*RNF3776 10 1 External program on prototype for main procedure is not
the
same as program being created.


The above was only a sample, I'm looking for your level 30 one.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1
Group Dekko
Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Rishi Seth
Sent: Friday, September 20, 2019 9:59 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE and
query regarding CRC 32

CAUTION: This email originated from outside of the organization. Do not
click links or open attachments unless you recognize the sender and know
the content is safe.


error is 30 level severity errors found in source
15 Source records processed
and still unable to encrypt even using embedded SQL encrypt function as
well yet.

On Fri, Sep 20, 2019 at 3:57 PM Rishi Seth <rishiseth99@xxxxxxxxx> wrote:


now the error is different:-

dec s 50
c/exec sql
c+ Declare c1 scroll cursor for
c+ select encrypt ('abcde','k1', 1)
c+ FROM lib1/FL1
C/END-EXEC
c/exec sql
c+ fetch from c1 into:ec
C/END-EXEC
c/exec sql
c+ open c1
C/END-EXEC
c/exec sql
c+ close c1
c/end-exec

On Fri, Sep 20, 2019 at 3:44 PM Rob Berendt <rob@xxxxxxxxx> wrote:

Ok, so you've proven you do have some rudimentary knowledge on how to
do embedded SQL in RPGLE. That's a good start.

However you lead me to believe you have a deep reluctance to read the
link I previously provided. There is no ENCRYPT function in DB2 for i.
There are only those ENCRYPT* functions listed at:

https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzsca
le.htm

The issue is that it's not even getting to the point of telling you
that the function doesn't exist (yet). It's failing on a little
known obscure error. General practice is that one ALWAYS puts a
blank after a column in a SQL list.
This: ('abcde','k1',1)
Becomes: ('abcde', 'k1', 1)
Why is this the best practice? Because SQL gets confused as to
whether or not you are using the comma as a decimal point or as a
separator.
Notice it didn't fail on the first comma? That was because 'k1' is
obviously not a number following a decimal point. It died on the
second one ',1' because it was thinking this just might a number
after a decimal point. Some countries use the comma as their decimal
point.

You may wonder why it didn't fail (yet) on the ENCRYPT. First
because it just wanted to handle one error at a time. Secondly
because you can always create your own functions, in either RPG or
SQL. In SQL you can use the CREATE FUNCTION. In RPG you create
subprocedures (not subroutines). So it hasn't gotten around to that
error yet.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600
Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of
Rishi Seth
Sent: Friday, September 20, 2019 9:11 AM
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE
and query regarding CRC 32

CAUTION: This email originated from outside of the organization. Do
not click links or open attachments unless you recognize the sender
and know the content is safe.


c/exec sql
c+ Declare c1 scroll cursor for
c+ select encrypt ('abcde','k1',1)
c+ FROM lib1/FL1
C/END-EXEC

Message ID . . . . . . : SQL0104 Severity . . . . . . . : 30

Message type . . . . . : Diagnostic



Message . . . . : Token ,1 was not valid. Valid tokens: ) ,.

Cause . . . . . : A syntax error was detected at token ,1. Token ,1
is
not
a valid token. A partial list of valid tokens is ) ,. This list
assumes

that the statement is correct up to the token. The error may be
earlier in
the statement, but the syntax of the statement appears to be valid
up to

this point.

Recovery . . . : Do one or more of the following and try the request
again:
-- Verify the SQL statement in the area of the token ,1. Correct
the

statement. The error could be a missing comma or quotation mark,
it could
be a misspelled word, or it could be related to the order of clauses.

-- If the error token is <END-OF-STATEMENT>, correct the SQL
statement

because it does not end with a valid clause.




On Fri, Sep 20, 2019 at 1:35 PM Rob Berendt <rob@xxxxxxxxx> wrote:

Let me find you a more applicable link:
https://www.ibm.com/support/knowledgecenter/ssw_ibm_i_74/db2/rbafzs
cal e.htm Look up the various encrypt/decrypt functions there.

First of all, you are trying to use a SQL function, NOT a RPG
function.
So you have to use "imbedded sql".
If you know nothing about imbedded SQL in RPG you are probably
better off asking on the RPG list. They should be able to give you
a couple of RTFM links.

There is probably a way to do the encrypt/decrypt outside of RPG.
One method which comes to mind is to build an index or view over
the file which does the encrypting/decrypting for you before
returning it to RPG.

Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept
1600 Mail to: 2505 Dekko Drive
Garrett, IN 46738
Ship to: Dock 108
6928N 400E
Kendallville, IN 46755
http://www.dekko.com


-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf
Of Rishi Seth
Sent: Thursday, September 19, 2019 11:41 PM
To: Midrange Systems Technical Discussion
<midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: Re: Regarding Decryption of AES128 encrypted data in RPGLE
and query regarding CRC 32

CAUTION: This email originated from outside of the organization. Do
not click links or open attachments unless you recognize the sender
and know the content is safe.


I äm trying to use it as it's advised on below link but so far have
been unable to encrypt key in below program due to error mentioned
previously.


https://www.ibm.com/support/knowledgecenter/en/SSULQD_7.1.0/com.ibm
.nz .sqltk.doc/r_sqlext_encrypt_decrypt.html

Thanks.


On Friday, September 20, 2019, Rishi Seth <rishiseth99@xxxxxxxxx>
wrote:

But i need to encrypt it that is why function is used.

On Friday, September 20, 2019, Sam_L <lennon_s_j@xxxxxxxxxxx>
wrote:

This compiles except for the error "The name or indicator
ENCRYPT is not defined. "

dt1 s 50 inz('abcde')
dt2 s 50
dk s 50
inz('16-9d15-ec98bcc81ec4275OI
M1TI')
d************* I')
C EVAL T2= ENCRYPT(t1:k:1)

C T2 DSPLY
C EVAL *INLR=*ON

Sam


On 9/19/2019 3:19 PM, Rishi Seth wrote:

Hi,

It's RPGLE program now after putting colons it's giving error
of
'**RNF7503
30 1 Expression contains an operand that is not defined.'
this
error
is at below code's line no. 6*


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email:
MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or
change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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

--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L)
mailing list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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


--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx To subscribe,
unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at
https://archive.midrange.com/midrange-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
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-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 ...

Follow-Ups:
Replies:

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

This mailing list archive is Copyright 1997-2024 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.