Number three below is probably the biggest culprit. I'll give you the rest as stuff you messed up on in copy/paste to obfuscate the code.
One, You never defined the variable TEXT.
Two, you forgot a semicolon at the end of
Text = 'Whatever Text'
Three you forgot the colon in front of Text and PassWord in Encrypt_AES(Text, PassWord).
Four you forgot the semicolon at the end of inz('yourPassWord')
Change this:
DCL-S Encrypted VarChar(256);
DCL-S Password VarChar(15) inz('yourPassWord')
Text = 'Whatever Text'
Exec SQL Set :Encrypted = Encrypt_AES(Text, PassWord);
EVAL *INLR=*ON;
To:
**free
DCL-S Encrypted VarChar(52); // I only changed this to 52 to test using DSPLY
DCL-S Password VarChar(15) inz('yourPassWord');
DCL-S Text VarChar(80);
Text = 'Whatever Text';
Exec SQL Set :Encrypted = Encrypt_AES(:Text, :PassWord);
Dsply SQLCODE;
Dsply Encrypted;
*inlr = *on;
Rob Berendt
As an Amazon Associate we earn from qualifying purchases.
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.