IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Tuning UNSTRING function in cobol


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Fri Oct 06, 2006 7:31 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 08, 2006 12:24 am
Reply with quote

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
View user's profile Send private message
vijikesavan

Active User


Joined: 04 Oct 2006
Posts: 118
Location: NJ, USA

PostPosted: Sun Oct 08, 2006 8:25 pm
Reply with quote

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
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 08, 2006 9:26 pm
Reply with quote

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
View user's profile Send private message
hey_its_me
Warnings : 1

New User


Joined: 23 Aug 2006
Posts: 14
Location: USA

PostPosted: Mon Oct 09, 2006 5:28 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top