View previous topic :: View next topic
|
Author |
Message |
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
I need to tune below line. Which statement it will give performance ( I need to reduce CPU time)
STRING WS-FIRST-NAME DELIMITED BY SPACE
INTO FIRST-NAME
Now its taking more so I need solution
Instead of STRING STATMENT.. I need convert to INSPECT statement same logic..
How need to do?
Then I want which statement will give performance for reduce CPU time
Please advise on this |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8700 Location: Dubuque, Iowa, USA
|
|
|
|
First, how do you know this statement is your problem statement? Unless you use a tool like STROBE you're merely guessing and not likely to be guessing right.
Second, unless you're executing this statement many millions of times it's no more likely than any other statement to be your problem.
Third, INSPECT or reference modification are not likely to be significantly faster than STRING.
Finally, "reduce CPU time" is an odd goal. Generally you want to get the job done faster, and elapsed time depends on so many factors other than CPU time that the exact same job, running twice on the same day, can vary by 50 ... 100 ... 5000% in elapsed time. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
Why not just move ws-first-name to first-name? Using string to move a single field seems a little strange. |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
because he is moving a 30 char field to a 20 char field and he wants to remove all trailing spaces. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
dbzTHEdinosauer wrote: |
because he is moving a 30 char field to a 20 char field and he wants to remove all trailing spaces. |
No comment. |
|
Back to top |
|
|
vicky10001 Warnings : 1 Active User
Joined: 13 Jul 2005 Posts: 136
|
|
|
|
Thanks for reply... I found statement from Strobe tool only..
The above statement we can modify to Inspect meant How?
Thanks in advance |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
The above statement we can modify to Inspect meant How? |
I do not understand. . .
Neither INSPECT nor STRING are a good choice if you want to reduce cpu usage. Both use cpu heavily.
As was asked earlier, why not use a simple move (or at least a reference modified move)?
If you post your "from" variable definition and your "to" variable definition, some sample data, and what you want in the receiving field after the "move", it may help us help you. |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
I have a very close friend with a two part first name, she gets very upset when it is cut off at the first space. |
|
Back to top |
|
|
|