View previous topic :: View next topic
|
Author |
Message |
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
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 |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
What makes you think that there is one ? |
|
Back to top |
|
|
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
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 |
|
|
simimathew
New User
Joined: 26 Jan 2006 Posts: 23 Location: London
|
|
|
|
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 |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
You're welcome & thanks for keeping us posted that it worked the way you needed..
Some times it needs a little juggle around the menu/option when it comes to third party tools..
-Ad |
|
Back to top |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
|
|
|
|
Sorry, do not know cobol much... but for other languages, such offsets are shown in the compiler listing. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
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 |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Quote: |
I tried the solution posted by Arun and it worked. Your example was spot on. |
You're welcome. Glad that it's working. 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 |
|
|
|