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

How to Calculate the total working storage used


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Vineet Joshi

New User


Joined: 11 Dec 2006
Posts: 7
Location: Bhubaneswar

PostPosted: Wed Feb 21, 2007 4:37 pm
Reply with quote

Hi all,

Can anyone tell me how to write a program to calculate the total memory used by working storage variables in a program.
I want to write the program using REXX or if it is not possible in that way, so how to write that using COBOL or any other language.
The input will be the program name and the output will be the total amount of bytes required by working storage variables.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 21, 2007 5:24 pm
Reply with quote

Do you have FileAid?

O.
Back to top
View user's profile Send private message
Vineet Joshi

New User


Joined: 11 Dec 2006
Posts: 7
Location: Bhubaneswar

PostPosted: Wed Feb 21, 2007 6:29 pm
Reply with quote

Yes I have FileAid.
Can you please give me some light how to proceed for the above query.
Thanks a lot.
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Wed Feb 21, 2007 6:49 pm
Reply with quote

There is an option in FileAid called RLPRINT. This oprion creates a record layout from a working storage.

You can generate a batch RLPRINT and then convert it to REXX.

O.
Back to top
View user's profile Send private message
Vineet Joshi

New User


Joined: 11 Dec 2006
Posts: 7
Location: Bhubaneswar

PostPosted: Wed Feb 21, 2007 7:47 pm
Reply with quote

Hi Ofer71,

Can I find out the memory spaces of copy book variables which are defined in a copy book. If yes then how to do so.
Please help me in this regard.
Thanks
Back to top
View user's profile Send private message
Mickeydusaor

Active User


Joined: 24 May 2006
Posts: 258
Location: Salem, Oregon

PostPosted: Thu Feb 22, 2007 3:18 am
Reply with quote

Number one, you can not calculate the memory space used by any
programs working storage, you only calculate the number of bytes
as seen in the porgram. The compiler will add bytes for half, full and
doubleword alignments. Yes this can be done with REXx but its not a
simple process, you have to be able to handle redefines and the likes
as I have done this.
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: Thu Feb 22, 2007 4:26 am
Reply with quote

Hello,

From the discussion, i'm not sure what the real question is.

In addition to alignment bytes there is also the "literal pool". When you code "MOVE 'SOME VALUE' TO MY-FIELD", "SOME VALUE" is hidden away in the literal pool.

If you want the length of any and all 01 level entries AND you have file-aid, there is a "VIEW" option that will show the length of that 01 - just put the code into a pds member - then "view" it..

Code:
 File-AID ---------------------- VIEW LAYOUT ------------- Row 1 to 19 of 9,697
 COMMAND ===>                                                  SCROLL ===> PAGE
 Layout: MS.RDS.SRCLIB(Y2KCLMCP)                                               
                                                  FIELD                         
 --------- FIELD LEVEL/NAME ---------- -PICTURE- -NUMBER START     END  LENGTH 
 CLAIM-REC                                                   1   14466   14466 
   3 FSEG-RECORD                       GROUP          1      1     152     152 
     5 FSEG-FIN-ME-DATA                GROUP          2      1      51      51 
       10 FSEG-RECORD-ID-NUM           S999           3      1       2       2 
       10 FSEG-FIN-SORT-KEY            GROUP          4      3      26      24 
         15 FSEG-SORT-P-NUM1           X(9)           5      3      11       9 
         15 FSEG-P-NUM-FILLER          X(11)          6     12      22      11 
         15 FSEG-SORT-CLM-STATUS                                               

If you were to run batch fild-aid, you could create a sysout with all of the entries and their lengths.

What it sounds like is that you want to do the same calculation the compiler does. As Mickeyd said, you can do it - it is not simple.

What requirement are you working on or is this a learning exercise?
Back to top
View user's profile Send private message
TG Murphy

Active User


Joined: 23 Mar 2007
Posts: 148
Location: Ottawa Canada

PostPosted: Thu Mar 29, 2007 1:24 am
Reply with quote

I have a Rexx utility that extracts the size of working storage from the program's load module. The utility can do this for a single load or for all loads that match a mask...

The utility creates a file containing 1 line per program. I sort the file so that the biggest working storages are sorted to the bottom.

We use this utility to spot obese working storages.

The utility does not currently extract the size of LOCAL working storage. Needs to be fixed to do this...
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts CLIST - Virtual storage allocation error CLIST & REXX 5
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
No new posts how to calculate SUM for VB file usin... JCL & VSAM 1
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
No new posts Def PD not working for unsigned packe... JCL & VSAM 3
Search our Forums:

Back to Top