Trim function in a User Variable Activity

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
prajish_ap
Participant
Posts: 11
Joined: Tue Nov 21, 2006 3:08 am
Location: Pune

Trim function in a User Variable Activity

Post by prajish_ap »

Can anyone please tell me what this trim function actually does?

Trim(oconv(date(), 'DMD[2,2]')," ","A")
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Trims 'A' for all " " (spaces) from the string created by OConv. Test your derivation in the Manager with and without the Trim() to see.
-craig

"You can never have too many knives" -- Logan Nine Fingers
prajish_ap
Participant
Posts: 11
Joined: Tue Nov 21, 2006 3:08 am
Location: Pune

Post by prajish_ap »

chulett wrote:Trims 'A' for all " " (spaces) from the string created by OConv. Test your derivation in the Manager with and without the Trim() to see. ...
I actually wanted to know as to what this OConv function does.. I should have been more specific with the question .. sorry about that.. :)
jhmckeever
Premium Member
Premium Member
Posts: 301
Joined: Thu Jul 14, 2005 10:27 am
Location: Melbourne, Australia
Contact:

Post by jhmckeever »

Are you having trouble accessing the online help?
Oconv(expression, conversion [@VM conversion] ...)

expression is a string stored in internal format that you want to convert to an output format. If expression is a null value, null is returned.

conversion is one or more conversion codes specifying how the string is to be formatted. Separate multiple codes with a value mark. If conversion is a null value, it generates a run-time error.
If the help/documentation don't help you could try <a href="search.php">searching</a>...?
<b>John McKeever</b>
Data Migrators
<b><a href="https://www.mettleci.com">MettleCI</a> - DevOps for DataStage</b>
<a href="http://www.datamigrators.com/"><img src="https://www.datamigrators.com/assets/im ... l.png"></a>
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Re: Trim function in a User Variable Activity

Post by ray.wurlod »

prajish_ap wrote:Can anyone please tell me what this trim function actually does?

Trim(oconv(date(), 'DMD[2,2]')," ","A")
Nothing at all in a parallel job.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prajish_ap
Participant
Posts: 11
Joined: Tue Nov 21, 2006 3:08 am
Location: Pune

Re: Trim function in a User Variable Activity

Post by prajish_ap »

ray.wurlod wrote:
prajish_ap wrote:Can anyone please tell me what this trim function actually does?

Trim(oconv(date(), 'DMD[2,2]')," ","A")
Nothing at all in a parallel job. ...

The Developer has used the function in a User Variable Activity Stage in a Sequence Job
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post by ArndW »

Why did you post in the PX forum, then?

Hint - go to the manager, create a new routine and enter the text Ans = Trim(oconv(date(), 'DMD[2,2]')," ","A") and compile then run it. You'll find out what that statement actually does.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

prajish_ap wrote:I actually wanted to know as to what this OConv function does..
Simple enough and the same advice applies. As noted, both the OConv and Date functions are documented so are something easily looked up. And any time you've got something like that you need to check, build a small routine in the Manager and use the 'Test' button to run it and see the actual output in a controlled environment.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply