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

Working storage data length in a cobol program


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
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
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: 8797
Location: Welsh Wales

PostPosted: Tue Oct 14, 2008 2:28 pm
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
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

Superior Member


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

PostPosted: Tue Oct 14, 2008 3:38 pm
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Tue Oct 14, 2008 5:13 pm
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
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: 2481
Location: @my desk

PostPosted: Tue Oct 14, 2008 7:36 pm
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

Superior Member


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

PostPosted: Wed Oct 15, 2008 5:50 am
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
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

Superior Member


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

PostPosted: Thu Oct 16, 2008 12:24 am
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

Global Moderator


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

PostPosted: Thu Oct 16, 2008 2:01 am
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: 8696
Location: Dubuque, Iowa, USA

PostPosted: Thu Oct 16, 2008 3:21 am
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: 2481
Location: @my desk

PostPosted: Thu Oct 16, 2008 9:25 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Store the data for fixed length COBOL Programming 1
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts PARSE Syntax for not fix length word ... JCL & VSAM 7
Search our Forums:

Back to Top