Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

What happen if we use multiple using same memory location

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
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    Post subject: What happen if we use multiple using same memory location
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    Post subject: Re: multiple using
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    Post subject: Re: multiple using
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    Post subject: Re: multiple using
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    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
No new posts Changeman get multiple "Browse C... elixir1986 Compuware & Other Tools 4 Fri Jul 14, 2017 1:48 am
No new posts How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
This topic is locked: you cannot edit posts or make replies. SDSF multiple spool datasets extracte... PJAlarcon CLIST & REXX 1 Fri Apr 21, 2017 10:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us