View previous topic :: View next topic
|
Author |
Message |
nijugopalan
New User
Joined: 15 Oct 2005 Posts: 15 Location: pune
|
|
|
|
what will happen if we will use multiple using for same memory location.in a given program |
|
Back to top |
|
|
Bharanidharan
New User
Joined: 20 Jun 2005 Posts: 86 Location: Chennai, India
|
|
|
|
USING is an assembler directive, which would provide a stencil for your data; and since your data could have any number of mappings, you can have any number of USINGs that you want. However, it is programmer's responsibility to verify the type of the data record that matches the particular type of mapping and use that. |
|
Back to top |
|
|
nijugopalan
New User
Joined: 15 Oct 2005 Posts: 15 Location: pune
|
|
|
|
THANKYOU FOR YOUR REPLY.
CAN YOU EXPLAIN THE CONCEPT IN DETAIL. BECOZ BY USING MULTIPLE USING IN A PROGRAM HOW CAN WE CONTROL THE ADDRESSIBILITY |
|
Back to top |
|
|
Bharanidharan
New User
Joined: 20 Jun 2005 Posts: 86 Location: Chennai, India
|
|
|
|
I am not sure if you are looking for the coding specifics. Assume you have a file that has records with multiple record structures, and you may want to use different USINGs for different scenarios. After determining which mapping to be used for the particular record, you can DROP the previous USING and use the appropriate USING. Here is an example:
A file has 3 types of records with mappings TYPE1, TYPE2, TYPE3.
Code: |
PROCRECD DS 0H
USING TYPE1,R1
CLI 0(R1),C'2'
BE USETYP2
CLI 0(R1),C'3'
BE USETYP3
< PROCESS TYPE 1 RECORD >
B CONTINUE
USETYP2 EQU *
DROP R1
USING TYPE2,R1
< PROCESS TYPE 2 RECORD >
B CONTINUE
USETYP3 EQU *
DROP R1
USING TYPE3,R1
< PROCESS TYPE 3 RECORD >
B CONTINUE
|
Since you know how your mappings are going to be available during run time beforehand (USINGs are compiler directives), you can guide your execution sequence to follow in such a way that the appropriate mapping is used to process the correct record type.
In the above example, I am forcing my process for the type of record in the appropriate place that uses the corresponding USING.
If this doesn't answer your question, please expand your question. |
|
Back to top |
|
|
|