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

What happen if we use multiple using same memory location


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nijugopalan

New User


Joined: 15 Oct 2005
Posts: 15
Location: pune

PostPosted: Thu Jul 20, 2006 9:46 am
Reply with quote

what will happen if we will use multiple using for same memory location.in a given program
Back to top
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Thu Jul 20, 2006 10:01 am
Reply with quote

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
View user's profile Send private message
nijugopalan

New User


Joined: 15 Oct 2005
Posts: 15
Location: pune

PostPosted: Thu Jul 20, 2006 10:11 am
Reply with quote

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
View user's profile Send private message
Bharanidharan

New User


Joined: 20 Jun 2005
Posts: 86
Location: Chennai, India

PostPosted: Fri Jul 21, 2006 11:05 am
Reply with quote

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
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 -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Mainframe openings in Techmahnidra fo... Mainframe Jobs 0
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Multiple table unload using INZUTILB DB2 2
No new posts Grouping by multiple headers DFSORT/ICETOOL 7
Search our Forums:

Back to Top