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

More CPU time to execute the PERFORM statement


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Tue Oct 19, 2010 1:32 am
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: 2501
Location: Atlanta, Georgia, USA

PostPosted: Tue Oct 19, 2010 1:39 am
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

Moderator Emeritus


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

PostPosted: Tue Oct 19, 2010 1:52 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts Execute secondary panel of sdsf with ... CLIST & REXX 1
No new posts To get the the current time DFSORT/ICETOOL 13
No new posts RC query -Time column CA Products 3
No new posts C Compile time time stamps Java & MQSeries 10
No new posts Parallelization in CICS to reduce res... CICS 4
Search our Forums:

Back to Top