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
 

 

Working storage data length in a cobol program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Tue Oct 14, 2008 2:27 pm    Post subject: Working storage data length in a cobol program
Reply with quote

I have a COBOL prgram in which there is a file layout in the working storage section. I would like to know the block command to get the length of this high level working storage variable (which represents the file record) without having to manually count the no: of bytes in each sub variable. Please help me with the tso command for this.

Many Thanks,
Simi
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Tue Oct 14, 2008 2:28 pm    Post subject:
Reply with quote

What makes you think that there is one ?
Back to top
View user's profile Send private message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Tue Oct 14, 2008 2:40 pm    Post subject:
Reply with quote

I think I have used it before, but don't seem to remember the command. As I recall it was either a block CC or block RR and then a command on the tso command line.

Correct me if I am wrong.

Is there any way I can do this with fileaid?

Many Thanks,
Simi
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Oct 14, 2008 3:38 pm    Post subject:
Reply with quote

Hi,

Am not aware of some direct "block" command, but if you copy this group level variable to a member some PDS, then using F;FA;8 option of file-aid you can achieve what you are looking for.

Option 8 in File-Aid at my shop is : View interpreted record layout.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Tue Oct 14, 2008 5:13 pm    Post subject:
Reply with quote

Quote:
I think I have used it before, but don't seem to remember the command. As I recall it was either a block CC or block RR and then a command on the tso command line.
This sounds like a custom-written ISPF edit macro, not something that is standard.

Why not compile the program with the MAP option and look at the compiler output for the structure length?
Back to top
View user's profile Send private message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Tue Oct 14, 2008 5:18 pm    Post subject:
Reply with quote

Thanks for the reply, Anuj.

But I tried the Fileaid 8 option for View and it is giving me an error 'No Record Layout'. Could you please explain how you use FileAid for the same?

Thanks again,
Simi
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Tue Oct 14, 2008 7:36 pm    Post subject:
Reply with quote

Hello,

1) Go to fileaid option 8 (FA.8) and enter the program name.
2) The next screen will display something like this.
Code:
File-AID ------------------- SOURCE STATEMENT SELECTION ---- ERROR NEAR LINE 3
COMMAND ===>                                                                 
                                                                               
"CURRENT" source dataset: your.program.pds(pgm1)                               
                                                                               
    For entire member, enter blanks in top two sections.                       
     For partial member, enter line numbers or beginning and ending string.     
                                                                               
Record layout selection by full dataname or full word character string:       
     Beginning string     ===> ws-var1                                         
     Ending string        ===> ws-varn                                         

3) Here you need to enter your first and last ws-variable names in the layout which you want to see. ws-var1 and ws-varn in your program should be as follows
Code:
01  ws-group.
    05 ws-var1 PIC .....
    05 ws-var2 PIC .....
    05 ws-var3 PIC .....

..............
..............

    05 ws-varn PIC .....
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Oct 15, 2008 5:50 am    Post subject:
Reply with quote

simimathew wrote:
I tried the Fileaid 8 option for View and it is giving me an error 'No Record Layout'.
This is not much information to help you out. Please tell me little more what exactly you have done at your end. File-Aid options may differ across shops, so please go with the description for that option as I said earlier
Quote:
Option 8 in File-Aid at my shop is : View interpreted record layout.


You may also try hitting F1, the moment you get the message "No Record Layout".
Back to top
View user's profile Send private message
simimathew

New User


Joined: 26 Jan 2006
Posts: 23
Location: London

PostPosted: Wed Oct 15, 2008 3:26 pm    Post subject:
Reply with quote

Thanks very much everyone.

I tried the solution posted by Arun and it worked. Your example was spot on.

Thanks again,
Simi
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Thu Oct 16, 2008 12:24 am    Post subject:
Reply with quote

You're welcome & thanks for keeping us posted that it worked the way you needed.. icon_smile.gif

Some times it needs a little juggle around the menu/option when it comes to third party tools..

-Ad
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2025
Location: Silicon Valley

PostPosted: Thu Oct 16, 2008 2:01 am    Post subject: Reply to: Working storage data length in a cobol program
Reply with quote

Sorry, do not know cobol much... but for other languages, such offsets are shown in the compiler listing.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 7931
Location: Bellevue, IA

PostPosted: Thu Oct 16, 2008 3:21 am    Post subject:
Reply with quote

COBOL has options to allow display of such offsets as well. Check the Language Guide in the manuals link at the top of the page.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2180
Location: @my desk

PostPosted: Thu Oct 16, 2008 9:25 am    Post subject:
Reply with quote

Quote:
I tried the solution posted by Arun and it worked. Your example was spot on.

You're welcome. Glad that it's working. icon_smile.gif We do use this option in file-aid quite often as it allows us to view a ws-layout w/o actually creating a copybook.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Full Time COBOL Software Development ... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:24 am
No new posts COBOL Software Development Lead at Fi... shally Mainframe Jobs 0 Fri Jan 20, 2017 5:21 am
No new posts Storing huge volume of data, compare ... Pradeep K M All Other Mainframe Topics 3 Mon Jan 16, 2017 5:08 pm
No new posts how to recover an uncataloged VSAM da... archanamuthukrishnan All Other Mainframe Topics 3 Wed Jan 11, 2017 6:18 pm
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm


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