Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
More CPU time to execute the PERFORM statement

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
senthils

Active User


Joined: 15 Nov 2005
Posts: 117
Location: Chennai, India

PostPosted: Tue Oct 19, 2010 12:38 am    Post subject: More CPU time to execute the PERFORM statement
Reply with quote

I have 2 tables which are defined as below.

Quote:
01 table1.
03 sub1 occurs 18 times indexed by ix1.
05 t1-a pic 9(9) comp-3.
05 t1-b pic 9(17) comp-3.


Quote:
01 table2.
03 sub2 occurs 18 times indexed by ix2.
05 sub22 ocurrs 3 times indexed by ix22.
07 t2-a pic 9(9) comp-3.
07 t2-b pic 9(17) comp-3


I need to move t1-a and t1-b of first table to t2-a and t2-b of second table.

Before movement:
table1:
t1-a occurence 1 - 11
t1-a occurence 2 - 21
t1-a occurence 3 - 31
.
.
.
.
t1-a occurence 18 - 181

table 2:
t2-a occurence 1,1 - 0
t2-a occurence 1,2 - 0
t2-a occurence 1,3 - 0
.
.
.
.
t2-a occurence 18,1 - 0
t2-a occurence 18,2 - 0
t2-a occurence 18,3 - 0

After movement:

table 2:
t2-a occurence 1,1 - 11
t2-a occurence 1,2 - 0
t2-a occurence 1,3 - 0
.
.
.
.
t2-a occurence 18,1 - 181
t2-a occurence 18,2 - 0
t2-a occurence 18,3 - 0


I coded a PERFORM statement to do the movement.

Quote:
PERFORM VARYING ix1 FROM 1 BY 1
UNTIL ix2 IS GREATER THAN 18
SET ix2 TO ix1
MOVE t1-a(ix1) TO t2-a(ix2 1)
MOVE t1-b(ix1) TO t2-b(ix2 1)
MOVE ZEROS TO t2-a(ix2 2)
t2-b(ix2 2)
t2-a(ix2 3)
t2-b(ix2 3)
END-PERFORM


This is working now. But the problem is it is taking so much CPU time to execute this PERFORM statement and i have use this statement many times in my program.

Is there a better way of doing the above with less stress on CPU time?
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 19, 2010 1:32 am    Post subject:
Reply with quote

Hello,

How much is "so much"?

Why does this need to be done "many" times in the program?

Suggest you try using a w/s field that contains all 3 entries for a table2 entry.
Code:
05  hold-entry.
    10 he-a   pic 9(9)  comp-3.
    10 he-b   pic 9(17) comp-3.
    10 filler pic 9(9)  comp-3 value zeros.
    10 filler pic 9(17) comp-3 value zeros.
    10 filler pic 9(9)  comp-3 value zeros.
    10 filler pic 9(17) comp-3 value zeros.

Move the actual data to he-a and he-b and them move hold-entry to sub22 rather than the individual fields. This eliminates 2/3's of the moves and reduces the index operations.

If you more completely explain the process, we may have some better suggestions.
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2504
Location: Atlanta, Georgia, USA

PostPosted: Tue Oct 19, 2010 1:39 am    Post subject: Reply to: More CPU time to execute the PERFORM statement
Reply with quote

Dick,

What was that really old method used in OS/VS COBOL for table-initialization of very large tables, where a higher group level was moved to a subordinate elementary level, which contained all the elements that required initialization and an internal propagation occurred?

I remember the compiler indicated that an MVCL would be generated (or maybe spelled out "Move Character Long").

Shaking away the Cobwebs.... icon_wink.gif

Bill
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Oct 19, 2010 1:52 am    Post subject:
Reply with quote

Hi Bill,

Quote:
What was that really old method used in OS/VS COBOL for table-initialization of very large tables,
Something like:
Code:
01  my-table-init.
    05 my-init-item.
      10 filler pic s9(9)  comp-3 value zeros.
      10 filler pic s9(17) comp-3 value zeros.
      10 filler pic x(4)   value '1234'.
    05 rest-of-table.
      10 . . . item2
      10 . . . item3
      10 . . . itemn
01  the-actual table redefines my-table-init.

MOVE my-table-init to rest-of-table will propogate the initial value to the other array items. Once initialized, the "actual" table would be used for processing. (IIRC icon_smile.gif )
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 Comparing 2 Files using Current time arunsoods SYNCSORT 9 Fri Sep 22, 2017 6:00 pm
No new posts Regarding time parameter shanthi gude JCL & VSAM 7 Mon Sep 04, 2017 2:31 pm
No new posts WER268A OUTREC STATEMENT : SYNTAX E... frozenblood87 SYNCSORT 12 Sat Aug 26, 2017 9:45 pm
No new posts Suppress value reported by BREAK in D... Learncoholic DFSORT/ICETOOL 3 Wed Aug 16, 2017 6:03 pm
No new posts ON 2 AND EVERY 1 - Statement ??? UmeySan COBOL Programming 2 Tue Jul 25, 2017 1:20 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us