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
 
How to Calculate the total working storage used

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
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    Post subject: How to Calculate the total working storage used
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: 2360
Location: Israel

PostPosted: Wed Feb 21, 2007 5:24 pm    Post subject:
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    Post subject: Re: How to Calculate the total working storage used
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: 2360
Location: Israel

PostPosted: Wed Feb 21, 2007 6:49 pm    Post subject:
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    Post subject: Re: How to Calculate the total working storage used
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    Post subject:
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

Site Director


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

PostPosted: Thu Feb 22, 2007 4:26 am    Post subject:
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: 149
Location: Ottawa Canada

PostPosted: Thu Mar 29, 2007 1:24 am    Post subject:
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    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sharing PLI storage Pedro PL/I & Assembler 2 Mon Oct 16, 2017 10:11 pm
No new posts LIBDEF not working in called proc packerm CLIST & REXX 0 Fri Sep 15, 2017 7:22 pm
No new posts Working with hex values in Filemanage... Emile Straker IBM Tools 0 Tue Sep 12, 2017 1:42 am
No new posts ISREDIT MACRO NOT WORKING! :cry: kirank889 TSO/ISPF 3 Thu Aug 03, 2017 5:46 pm
No new posts Iterative use of a REXX script causin... bryonyh CLIST & REXX 4 Fri Jul 28, 2017 12:52 pm

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