Page 1 of 1

DSSetParam basic function with an encrypted parameter

Posted: Thu Jun 07, 2018 9:39 am
by Griffin07
Hi Folks, anyone know how to get the DSSetParam basic function to work to set an encrypted parameter. I have a generic job that I pass the DB name, logon and password to. The password is encrypted using a java routine so that it does not show up in any of the logs of files anywhere, I am then decrypting it in a routine and want to set the job parameters and run the job in the routine but the setting of the password keeps throwing the -4 error. The value I am passing to the DSSetParam is decrypted correctly to a basic string value.

thakns

Posted: Thu Jun 07, 2018 1:56 pm
by chulett
... let's get you into your own post.

Done.

Posted: Thu Jun 07, 2018 2:35 pm
by Griffin07
thanks, hoping someone knows how I can get around this error. I am in v9.1

Posted: Thu Jun 07, 2018 3:34 pm
by ray.wurlod
Make sure that your encryption algorithm generates only printable characters. Decrypt in a routine invoked from a Routine activity, and pass the password parameter en clair into the Job activity. It will be displayed as a row of asterisks in the job log.

Posted: Thu Jun 07, 2018 4:37 pm
by Griffin07
Hi, the original encryption is doing just printable chars and the decryption java is being invoked thru the DSExecute command

javaExec = JavaCmd1 : " " : EncVal1
call DSExecute ('UNIX', javaExec, Src_DecryptedVal, retcode)

and I have verified that the value coming back in Src_DecryptedVal is the correct unencrypted value and then I am using the DSSetParam to set it

JobError = DSSetParam(hJob1, "DB_SRC_Password", Src_DecryptedVal)

Posted: Thu Jun 07, 2018 5:26 pm
by Griffin07
my friend, you were right, there was an @FM stuck in three and that messed me up, it is now working, thanks so much :)

Posted: Thu Jun 07, 2018 6:04 pm
by chulett
Ah... seems like it's always those darn Field Marks when you see the -4. :(