Cannot get encrypted password from parameter set

A forum for discussing DataStage<sup>®</sup> basics. If you're not sure where your question goes, start here.

Moderators: chulett, rschirm, roy

Post Reply
SIHM
Premium Member
Premium Member
Posts: 52
Joined: Fri Oct 18, 2013 3:56 am

Cannot get encrypted password from parameter set

Post by SIHM »

I want to write a generic routine to get the encrypted password from a parameterset. However when I get the encrypted password it returns a value of -16 using the following functions

paramList = DSGetJobInfo(JobHandle , DSJ.PARAMLIST);
param = Field(paramList, ',', P);
paramVal = DSGetParamInfo(JobHandle, param, DSJ.PARAMDEFAULT);

The only other alternative I can think of is to read the parameterset file directly as a file. However in order to do this I need to know where the parameterset directory is and obviously which environment and project I am working on. Is there a way of determining the parameterset directory in real time ?

Does anyone else have any potential solutions or workarounds for this.

Thanks
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Did you look up what that -16 means?

$DSHOME/include/dsapi.h
-craig

"You can never have too many knives" -- Logan Nine Fingers
SIHM
Premium Member
Premium Member
Posts: 52
Joined: Fri Oct 18, 2013 3:56 am

Post by SIHM »

Code: Select all

-16 =  Cannot get values, Default values or Design Default values for any job except the current job (Job Handle == DSJ.ME)
So it appears that I can only get to the password whilst running a job and not from a routine.

I don't actually want to decrypt the password (not that its possible anyway), just get its value. It doesn't seem like an unreasonable demand.

The only way I can think of is to write a routine which calls a job which returns $UserStatus.

So are there any other ways to get hold of the value or the path to the parametersets ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Funny, just found a post of mine from 8 years ago where I ran across the exact same error. However, don't recall whatever became of the answer. Perhaps try DSJ.PARAMVALUE instead?
-craig

"You can never have too many knives" -- Logan Nine Fingers
SIHM
Premium Member
Premium Member
Posts: 52
Joined: Fri Oct 18, 2013 3:56 am

Post by SIHM »

I have tried DSJ.PARAMVALUE and DSJ.PARAMDEFAULT

Parametersets weren't around 8 years ago were they ?
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Nope. However this is a generic parameter error, nothing specific to a 'set'. Hopefully someone else can help.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Mike
Premium Member
Premium Member
Posts: 1021
Joined: Sun Mar 03, 2002 6:01 pm
Location: Tampa, FL

Post by Mike »

You won't find it in the file system unless you've got a value set. Each parameter set has a directory in the ParameterSets directory in your project directory.

What's the end game? I can't think of any reason for getting the encrypted password value without the intention of decrypting it?

You could parse it out of a job log.

I think Kim Duke has some trick for displaying parameter values.

Mike
SIHM
Premium Member
Premium Member
Posts: 52
Joined: Fri Oct 18, 2013 3:56 am

Post by SIHM »

We are writing a routine which will interrogate a series of tables in databases in order to get data volume information.

Given that it is a generic routine, we have to be able to pass the name of parameter set to the routine in order to connect to the tables.

I am aware of the routine to display parametersets but it will never display the password because of the -16 error previously mentioned.
MrBlack
Participant
Posts: 125
Joined: Wed Aug 08, 2012 8:57 am

Post by MrBlack »

If you're writing a routine to query tables to get their volume data information, why not just write a server job and use the database stages to execute the custom query and then send the rows to an audit table or whatever? You can write a generic server job that you pass in all the parameters you'd need to make it generic.
Post Reply