Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Tuning UNSTRING function in cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
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    Post subject: Tuning UNSTRING function in cobol
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    Post subject:
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    Post subject: Re: Tuning UNSTRING function in cobol
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    Post subject:
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    Post subject: Re: Tuning UNSTRING function in cobol
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    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm
This topic is locked: you cannot edit posts or make replies. COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us