Page 1 of 1

Trim function in a User Variable Activity

Posted: Wed Aug 08, 2007 11:02 pm
by prajish_ap
Can anyone please tell me what this trim function actually does?

Trim(oconv(date(), 'DMD[2,2]')," ","A")

Posted: Wed Aug 08, 2007 11:13 pm
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.

Posted: Wed Aug 08, 2007 11:27 pm
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.. :)

Posted: Wed Aug 08, 2007 11:44 pm
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>...?

Re: Trim function in a User Variable Activity

Posted: Thu Aug 09, 2007 12:18 am
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.

Re: Trim function in a User Variable Activity

Posted: Thu Aug 09, 2007 12:51 am
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

Posted: Thu Aug 09, 2007 1:44 am
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.

Posted: Thu Aug 09, 2007 5:58 am
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.