View previous topic :: View next topic
|
Author |
Message |
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Hi,
I have a COBOL program which has high CPU usage in a UNSTRING function. The code is given below. Any suggesstion to improve this plsss..
UNSTRING WS-NETW-RECORD DELIMITED BY '|'
INTO
WS-NETW-DATE COUNT IN WS-CTR-01
S-NETW-ML-NBR COUNT IN WS-CTR-02
WS-NETW-NET-WORTH-AMT COUNT IN WS-CTR-03
WS-NETW-MUTL-FND-AMT COUNT IN WS-CTR-04
WS-NETW-BOND-AMT COUNT IN WS-CTR-05
WS-NETW-ISO-CURRENCY COUNT IN WS-CTR-06
WS-NETW-FOREIGN-AMT COUNT IN WS-CTR-07
WS-NETW-MARGIN-AMT COUNT IN WS-CTR-08
WS-NETW-CASH-BAL-AMT COUNT IN WS-CTR-09
WS-NETW-MONEY-MKT-AMT COUNT IN WS-CTR-10
WS-NETW-EQUITY-AMT COUNT IN WS-CTR-11
WS-NETW-EQUITY-LONG-AMT COUNT IN WS-CTR-12
WS-NETW-EQUITY-SHRT-AMT COUNT IN WS-CTR-13
WS-NETW-OPTION-LONG-AMT COUNT IN WS-CTR-14
WS-NETW-OPTION-SHRT-AMT COUNT IN WS-CTR-15
WS-NETW-MAINT-RQMT-AMT COUNT IN WS-CTR-16
WS-NETW-MARGN-LONG-AMT COUNT IN WS-CTR-17
WS-NETW-MARGN-SHRT-AMT COUNT IN WS-CTR-18
WS-NETW-TOT-CSH-SEC-AMT COUNT IN WS-CTR-19
WS-NETW-MARGN-PRTN-AMT COUNT IN WS-CTR-20. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
The only solution I can think of is to code the logic yourself, using ref/mod and looping thru the sending field looking for the delim and keeping track of the char count.
The process you use for the UNSTRING is pretty straightforward, so I don't see any opportunity for efficiencies.
If you have'nt already, try making your cntrs COMP or COMP-3 and see what that does. If you're uding DISPLAY cntrs the data conversion routines can add overhead. |
|
Back to top |
|
|
vijikesavan
Active User
Joined: 04 Oct 2006 Posts: 118 Location: NJ, USA
|
|
|
|
Thanks for the reply. I tried using the ref mod logic, but i seems to not work as the input file's structure is varying.
Trying some other alternatives for this. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
It can work w/VB files. Search the forums for "variable" or "VB". to understand how to process VB files.
Have you tried changing the counters to COMP? |
|
Back to top |
|
|
hey_its_me Warnings : 1 New User
Joined: 23 Aug 2006 Posts: 14 Location: USA
|
|
|
|
Hi all,
Could you please clarify my doubt on the above code.
Here with the unstring clause they have specified the main variable from which the string is unstringed into variables which are delimited by '|'.
My doubt is on the use of count in in the code.
Could you please clarify the doubt on the above given subject.
With regards,
Anil Kumar |
|
Back to top |
|
|
|