Passing job parameter to Convert function

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
wgrondin
Premium Member
Premium Member
Posts: 1
Joined: Wed Jan 25, 2012 10:13 am
Contact:

Passing job parameter to Convert function

Post by wgrondin »

Hello all. I currently have a job that removes all except spcified characters from an input file. The characters are to retain are specified in the following format - Char(32) : Char(33) ... and so on. The list is about 100 characters, and I am trying to pass this in to the Convert function using a job parameter by entering the text "Char(32) : Char(33)" i the parameter value.
When I use the parameter, however, the characters "C", "h", "a", "r", "(", "3", "2", ")", " ", ":" are what get read in by the Convert function.
When I hard code the Char(nn) function into the transformer, then it works as intended.
Has anyone faced this issue before and resolved it? I want to be able to change the characters retained by changing the parameter, rather than having to hard code them into the job. Thanks for your help!
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Parameters don't work that way - they are used to pass data into a job. When you pass in function names (as you've seen) they just become strings of data as there isn't a second level of 'resolution'. It is the same reason a parameter cannot reference another parameter.

Off the top of my head, you'll have to hard-code the list in the job. I'm not seeing an alternative at the moment if you really need to use that function... but others might.
Last edited by chulett on Tue Aug 27, 2013 4:34 pm, edited 1 time in total.
-craig

"You can never have too many knives" -- Logan Nine Fingers
ray.wurlod
Participant
Posts: 54595
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Is it possible to build your string in a stage variable instead? If it has to be dynamic, perhaps the beginning and end of the range of codepoint values could be passed as parameters (assuming a contiguous range of characters).
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Post Reply