MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to find a Assembler Copy Book length ?

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
krish_caitu
Beginner


Joined: 24 Oct 2005
Posts: 4
Topics: 1

PostPosted: Mon Oct 24, 2005 11:51 pm    Post subject: How to find a Assembler Copy Book length ? Reply with quote

Hi All !!

Could you please let me know how to find the length of the Assembler Copy book ?

And what will be the process of finding the length of multible copy books ?

For more clarity I want to know whether there is any procedure as like File-Aid option 8 (View) ...

To add more, currently we are putting all the copy books whose lengths are to be computed as different CSECTs in a dummy assembler program and just compiling it ...and then we are looking the SYSPRINT to know the length ..

I beleive there should be more efficient procedure than this.

Please help me out of this

Thanks for your time !!!
Back to top
View user's profile Send private message
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sat Nov 12, 2005 3:52 am    Post subject: Reply with quote

Quote:

we are putting all the copy books whose lengths are to be computed as different CSECTs in a dummy assembler program and just compiling it


Assembler copybooks may have different length depending on the input, how are you resolving this by compiling your dummy program?
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Sat Nov 12, 2005 4:27 am    Post subject: Reply with quote

Quote:

Assembler copybooks may have different length depending on the input, how are you resolving this by compiling your dummy program?


Dibakar,

Can't you just look at the ADDRI field associated to the copybook to find the length?

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Dibakar
Advanced


Joined: 02 Dec 2002
Posts: 700
Topics: 63
Location: USA

PostPosted: Sat Nov 12, 2005 5:48 am    Post subject: Reply with quote

Kolusu,

I am assuming that assembler copybooks are macros which can have dyanamic expansion during compilation.

I have come across some macros which are used for multiple structures. Based on the structure name provided the macros can have different expansion. Like -

Code:
AASTRUCT   DSECT
           DIBA123 ID=AA

ABSTRUCT   DSECT
           DIBA123 ID=AB



So I was thinking that just copying the macro will not be sufficient, one will have to know what are the possible expansions.

But if the macro has a fixed structure or if someone is interested only in a specific case then compiling a dummy program will work.

Diba.
Back to top
View user's profile Send private message Send e-mail
krish_caitu
Beginner


Joined: 24 Oct 2005
Posts: 4
Topics: 1

PostPosted: Mon Nov 14, 2005 2:08 am    Post subject: Thanks alot for your time .... and still need help Reply with quote

Dibakar & kolusu,

Thanks alot for your time

As I am a beginer in Assembly Language I dont know whether there are any loop holes in the procedure that we are currently following.

My requirement seems to be very simple but still I am unable to find an efficient solution.

Requirement is ...
Our installation is having 500+ Cobol Copy books and their corresponding MACLIBS. And each year there will be changes to the Cobol Copy books and we need to reflect those changes to the respective Maclibs. During data conversions from previous version to new version, as Length plays imp role we need to ensure that both, Cobol & corresponding Assembler Copy books, will be of same length.

As there are 500+ copy books i wanted to know whether there is any way to find the length in a single go.

We may assume that there wont be any Dynamic expansion of the Copy book lengths as i havnt seen any such instance till now in our installation.


Please help me out .........
Back to top
View user's profile Send private message
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Tue Nov 15, 2005 1:54 pm    Post subject: Copybook length Reply with quote

Krish Caitu,

If Length plays an important role (as you say), then you should (from now on) permanently include the length as a dynamically generated field inside each of your Assembler copybooks.

At the start and end of the copybook put an EQU, and also code an AL storage field. Example:-

Code:

WS_START EQU *
         DS CL8
         DS XL2
         DS CL20
WS_END   EQU *-WS_START
WS_LENG  DC AL2(WS_END)


At Assembly time, the length of this "copybook/storage" will be calculated, and a hex value of 20 (which is decimal 32) will be stored inside field "WS_LENG".

Where you go from there is up to you. One method is (perhaps) to write some script to insert appropriate statements inside all 500 copybooks, then throw them all in a dummy program, then scan (with a pgm) the assembled listing, extract the hex values (from the Length fields) and print them out as decimal values. It should not take more than 1 day to fully complete this task.

PS: Obviously you should not use the same name for the Length field in all the copybooks.
Back to top
View user's profile Send private message
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Tue Nov 15, 2005 4:43 pm    Post subject: Reply with quote

PS: One final note... all of the above code will only add 2 extra bytes to your code. 'A' is for Address, and a length of 2 = AL2. And if you omit the length specifer for Address Constants, you'll get a default Fullword.
Back to top
View user's profile Send private message
krish_caitu
Beginner


Joined: 24 Oct 2005
Posts: 4
Topics: 1

PostPosted: Tue Nov 15, 2005 11:22 pm    Post subject: Reply with quote

Hi MikeBaker,

Thanks alot .... Smile
Back to top
View user's profile Send private message
MikeBaker
Beginner


Joined: 04 May 2004
Posts: 96
Topics: 9

PostPosted: Wed Nov 16, 2005 1:22 am    Post subject: Reply with quote

WHOOPS... sorry, but I have made a mistake. Obviously cannot count. The decimal value here is 30 (not 32!), and you'll get the hex equivalent for 30 (whatever that is...)

I tested this code inside an assembler program this morning, but obviously missed out a 2 byte field along the way. However if you decide to include the AL2 within the two EQU's, then it will equal 32!

Prove it to yourself anyway, and you'll see.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group